4 Replies Latest reply on Jul 18, 2014 2:02 PM by Daniel Merchán

    GoLinks recommended instead of CommandLinks for Webcenter Navigation?

    user11282566

      http://www.ateam-oracle.com/webcenter-afcommandlink-or-afgolink-for-navigation/#comment-637

       

      The above A-Team blog says

      " WebCenter apps are different in that regard, so this is why ATEAM always recommend af:goLinks for WebCenter based custom applications."

       

       

      But I am surprised by this statement.  CommandLink and goLink each have their different use case. If I want to process the action before navigating, or just want PPR then wouldn't I want to use commandLink? Why would I use goLink always. If I use goLinks how can I do action processing?

        • 1. Re: GoLinks recommended instead of CommandLinks for Webcenter Navigation?
          Daniel Merchán

          Hi.

           

          As they said, is a HIGHLY recommendation, not mandatory.

           

          About your questions...

           

          • With goLink you have just the chance of using ADF JavaScript + Server Event if you want to execute Java Code when clicking the af:goLink
          • You can use commandLink without PPR and finally use a redirection using the WebCenter API to the goLinkPrettyURL <-- make commandLink works as goLink

           

          For WebCenter Pages Navigation... my recommendation is goLinks as well. You will reduce navigation issues as "Browser Back", "Session timeout" etc etc...

           

          I hope this helps.

          Regards.

          • 3. Re: GoLinks recommended instead of CommandLinks for Webcenter Navigation?
            user9157535

            Hi Daniel,

             

            In our WebCenter portal application, we have implemented both top navigation and left navigation. We have a scenario where two or more navigation links will be using the same JSPX page.

             

            We have used af:goLink with goLinkPrettyUrl for both top navigation and left navigation. Issue exist with left navigation only, top navigation works good.

             

            Scenario is 2 different navigations point to the same jspx page(Example, when we cick on navigation link "HR" we should show the "hr.jspx" page and when we click on navigation link "Finance" we should show the same "hr.jspx" page).


            We are getting an exception in below scenario for left navigation:
            1. First Click on "HR" navigation link, "hr.jspx" page opens successfully
            2. Second click on "Finance" navgation link, same "hr.jspx" page is displayed but with below error pop-up
            JBO-25005: Object name oracle_webcenter_tagging_view_pageDefs_oracle_webcenter_tagging_view_jsf_fragments_launch_dialogPageDef_oracle_webcenter_tagging_controller_taskflows_launch_dialog_xml_tagging_launch_dialog of type Iterator Binding Definition is invalid.
            3. Same exception occurs if click "Finance" link first and "HR" link second

             

            We do not see the above exception, if we navigate in below order:
            1. First click on "HR" navigation link
            2. second click on "Employee" navigation link
            3. Third click on "Finance" navigation link

             

            If i use af:commandLink for left navigation, the issue doesn't occur. But client is more leaned towards af:goLink against af:commandLink. Please let me know if you have any solution to fix this issue using goLink.

             

            Below is the code for Left Navigation:

             

            <?xml version='1.0' encoding='UTF-8'?>
            <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
                      xmlns:af="http://xmlns.oracle.com/adf/faces/rich"
                      xmlns:c="http://java.sun.com/jsp/jstl/core"
                      xmlns:f="http://java.sun.com/jsf/core">
               <c:set var="portalBundle" value="#{adfBundle['resources.PortalBundle']}"/>
                <af:panelGroupLayout id="pgl1" layout="vertical" styleClass="leftNavBG">
                    <c:set var="startNode" value="startNode=#{pageFlowScope.startNode}"
                           scope="page"/>
                    <c:set var="includeStartNode"
                           value=",includeStartNode=#{pageFlowScope.includeStartNode}"
                           scope="page"/>
                    <c:set var="navigationParams" value="#{startNode}#{includeStartNode}"
                           scope="page"/>
                    <af:iterator id="i1"
                                 value="#{pageFlowScope.NavigationBean.workingCopyForLeftNavList}"
                                 var="node" varStatus="vs" rows="0">
                        <!--<af:outputText id="ot5" value="Test :: #{node.attributes['Significance']}"/>-->
                        <af:switcher facetName="#{node.attributes['Significance'] eq 'NavigationRef'}" id="s11">
                        <f:facet name="true">
                        <af:panelGroupLayout id="pgl2" layout="vertical" styleClass="leftNavContainer">
                            <af:outputText id="ot1" value="#{node.title}"
                                           styleClass="heading1"/>

                                          
                            <af:iterator id="i2" value="#{node.children}" var="node2"
                                         varStatus="vs" rows="0">
                                <af:switcher facetName="#{node2.navigable}" id="s2">
                                    <f:facet name="true">
                                         <!-- 
                                         <af:commandLink text="#{node2.title}" id="cil1" action="pprnav"
                                                actionListener="#{navigationContext.processAction}"
                                                styleClass="#{node2.selected ? 'leftNavSelectedLink' : 'lefNavGoLink'}">
                                                <f:attribute name="node" value="#{node2}"/>
                                                </af:commandLink>
                                         -->
                                         
                                        <af:goLink id="gl2" text="#{node2.title}"
                                                           destination="#{node2.goLinkPrettyUrl}"
                                                           targetFrame="#{node2.attributes['Target']}"
                                                           styleClass="#{node2.selected ? 'leftNavSelectedLink' : 'lefNavGoLink'}"/>
                                       
                                    </f:facet>
                                    <f:facet name="false">
                                        <af:panelGroupLayout id="pgl5">
                                            <af:outputText value="#{node2.title}"
                                                           styleClass="#{node.parent.title eq portalBundle.TOPNAV_REGIONS_BUSINESSES_TITLE ? 'regionheading2' : node.parent.title eq portalBundle.TOPNAV_DEPT_SERVICES_TITLE ?  'departmentheading2' : node.parent.title eq portalBundle.TOPNAV_LIFE_CAREER_TITLE ?  'lifeCareerheading2' : node.parent.title eq portalBundle.TOPNAV_ONE_EATON_TITLE ?  'oneEatonheading2' : ''}"
                                                           id="ot2"/>
                                        </af:panelGroupLayout>
                                        </f:facet>
                                   
                                </af:switcher>
                                <af:iterator id="pt_i4" value="#{node2.children}"
                                             var="node3" varStatus="vs" rows="0">
                                    <af:switcher facetName="#{node3.navigable}" id="s4">
                                        <f:facet name="true">
                                             <!--
                                             <af:commandLink text="#{node3.title}" id="cil2" action="pprnav"
                                                      actionListener="#{navigationContext.processAction}"
                                                      styleClass="#{node3.selected ? 'lefNavSelectedChildLink' : 'lefNavChildLink'}">
                                                      <f:attribute name="node" value="#{node3}"/>
                                             </af:commandLink>
                                             -->
                                             <af:goLink  text="#{node3.title}"
                                                           destination="#{node3.goLinkPrettyUrl}"
                                                           targetFrame="#{node3.attributes['Target']}"
                                                           styleClass="#{node3.selected ? 'lefNavSelectedChildLink' : 'lefNavChildLink'}"
                                                        id="gl1"/>
                                           
                                        </f:facet>
                                        <f:facet name="false">
                                            <af:panelGroupLayout id="pgl4">
                                                <af:spacer width="10" height="10" id="s5"/>
                                                <af:outputText value="#{node3.title}"
                                                               styleClass="heading2"
                                                               id="ot4"/>
                                            </af:panelGroupLayout>
                                        </f:facet>
                                    </af:switcher>
                                </af:iterator>
                            </af:iterator>
                        </af:panelGroupLayout> 
                        </f:facet>
                       
                       
                       
                       
                        <f:facet name="false">
                                <af:panelGroupLayout id="pgl3">
                                <af:switcher facetName="#{node.navigable}" id="s1">
                                    <f:facet name="true">
                                         <!--
                                         <af:commandLink text="#{node.title}" id="cil3" action="pprnav"
                                              actionListener="#{navigationContext.processAction}"
                                              styleClass="#{node.selected ? 'leftNavSelectedLink' : 'lefNavGoLink'}">
                                              <f:attribute name="node" value="#{node}"/>
                                          </af:commandLink>
                                         -->
                                        
                                         <af:goLink id="pt_gl2" text="#{node.title}"
                                                           destination="#{node.goLinkPrettyUrl}"
                                                           targetFrame="#{node.attributes['Target']}"
                                                           styleClass="#{node.selected ? 'leftNavSelectedLink' : 'lefNavGoLink'}"/>
                                       
                                    </f:facet>
                                    <f:facet name="false">
                                        <af:panelGroupLayout id="pgl6" styleClass="leftNavContainer">
                                            <af:outputText value="#{node.title}"
                                                           styleClass="heading1" id="ot3"/>
                                        </af:panelGroupLayout>
                                        </f:facet>
                                   
                                </af:switcher> 
                            <af:iterator id="i3" value="#{node.children}" var="secondNode"
                                         varStatus="vs" rows="0">

                                    <af:switcher facetName="#{secondNode.navigable}" id="s7">
                                        <f:facet name="true">
                                             <!--
                                             <af:commandLink text="#{secondNode.title}" id="cil4" action="pprnav"
                                                actionListener="#{navigationContext.processAction}"
                                                styleClass="#{secondNode.selected ? 'lefNavSelectedChildLink' : 'lefNavChildLink'}">
                                                <f:attribute name="node" value="#{secondNode}"/>
                                             </af:commandLink>
                                             -->
                                             <af:goLink  text="#{secondNode.title}"
                                                           destination="#{secondNode.goLinkPrettyUrl}"
                                                           targetFrame="#{secondNode.attributes['Target']}"
                                                           styleClass="#{secondNode.selected ? 'lefNavSelectedChildLink' : 'lefNavChildLink'}"
                                                        id="gl3"/>
                                           
                                        </f:facet>
                                        <f:facet name="false">
                                            <af:panelGroupLayout id="pgl9">
                                                <af:spacer width="10" height="10" id="s9"/>
                                                <af:outputText value="#{secondNode.title}"
                                                               styleClass="heading2"
                                                               id="ot5"/>
                                            </af:panelGroupLayout>
                                        </f:facet>
                                    </af:switcher>
            </af:iterator>
            </af:panelGroupLayout>
                        </f:facet>
                        </af:switcher>
                    </af:iterator>
                </af:panelGroupLayout>
            </jsp:root>

            • 4. Re: GoLinks recommended instead of CommandLinks for Webcenter Navigation?
              Daniel Merchán

              Hi.

               

              Please don't duplicate posts. I answered in your post .

               

              Regards.