This post provides different flavors of af:commandLink usage however the component itself has been deprecated in favor of af:link in 12c. A command link generates an action event on the server following a link click which largely differs from the behavior of a goLink.
Using af:commandLink to call an action method with params in your bean
1 2 3 4 5 6 7 8 9
<af:commandLink text="#{bundle.MY_LINK}" id="cl1" actionListener="#{myBean.actionMe}" partialSubmit="true" partialTriggers="cl2" rendered="#{myBean.showLink}"> <af:setActionListener from="#{myBean.oneVariable}" to="#{myBean.otherVariable}"/> </af:commandLink>
Using af:commandLink to open a popup
1 2 3 4 5
<af:commandLink text="#{bundle.SUI_RECENT_SEARCHES}" id="cl1" partialSubmit="true" clientComponent="true"> <af:showPopupBehavior triggerType="click" popupId="p1"/> </af:commandLink>
Calling a JavaScript function with af:commandLink
1 2 3 4 5 6 7 8 9
<af:commandLink text="#{row.header}" id="cl1" clientComponent="true" partialSubmit="true"> <af:clientAttribute name="name" value="#{myBean.name}"/> <af:clientListener method="showAlert" type="click"/> </af:commandLink>
This has been deprecated now in favor of a more generic af:link - See more at: http://www.abhinandanpanda.com/2014/06/adf-code-examples-afcommandlink_25.html#sthash.ZKiEv2jr.dpuf
ReplyDelete