2 Replies Latest reply: Feb 11, 2013 10:21 AM by spamula RSS

    How to get  a Current Navigation model  Current Selection (node) ID

    spamula
      Hi,
      we are using default navigation model for page navigation in our application.
      I am trying to get Id of Default Navigation model node, I am able to get the Title using following code which available in globe template.

      Code – pageTemaplate_globe.jspx :
      <af:forEach var="node" varStatus="vs"
      items="#{navigationContext.defaultNavigationModel.listModel['startNode=/, includeStartNode=false']}">
      <af:subform id="pt_sfm1">
      <div class="bea-portal-book-primary-menu-single-item">
      <af:switcher id="pt_sw1"
      facetName="#{(empty node.attributes['Target']) || (node.attributes['Target'] == '_popup') ? 'command' : 'golink'}">
      <f:facet name="command">
      <af:commandLink id="pt_cl1" text="#{node.title}"
      action="#{MyAccBean.menuItemListAction}"
      disabled="#{not node.navigable}"
      actionListener="#{navigationContext.processAction}"
      clientComponent="#{node.attributes['Target'] == '_popup' ? true : false}">
      <!-- pass node to processAction for setting current selection and navigation -->
      <f:attribute name="node" value="#{node}"/>
      <af:setActionListener from="#{node.title}"
      to="#{pageFlowScope.menunodetitle}"/>

      I am using +<af:setActionListener/>+ to set Title to variable and using in that in code.

      Is there a way that i can get ID in the same way as title?

      I see following EL from documentation but there is no ID attributes available.
      EL: #{navigationContext.defaultNavigationModel.currentSelection.attributes['Description']}
      EL: #{navigationContext.defaultNavigationModel.currentSelection.title}

      Please help me…

      Thank you,
      SP