views:

40

answers:

3

Hi,

I am having problems in implementing menu navigation in JSF where I am using one header.jsp which is included in all other jsps, from main page forward navigation is working fine but if I want to go to any other page using dropdown menu I am getting javascript error as f: has no value.

here is my header.jsp menu part

<li><a href="#" class="MenuBarItemSubmenu">Fund Maintenance</a>
   <ul>
     <li class="bottomline"><h:commandLink value="General Ledger Mapping" action="#{fyeSelection.getGLMappingSelection}"></h:commandLink>
     <li class="bottomline">
       <h:commandLink value="File Upload" action="#{fyeSelection.getFYEUploadScreen}"></h:commandLink>
     </li>
     <li class="bottomline">
       <h:commandLink value="Provision Lock Down" action="#{fyeSelection.getProvisionScreen}"></h:commandLink>
     </li>
     <li class="bottomline">
       <h:commandLink value="Copy Provision for Tax Return" action="#{fyeSelection.getCopyProvisionTaxScreen}"></h:commandLink>
     </li>
   </ul>
 </li>

the faces-config.xml is like:

<managed-bean>
  <description>FYE Selection Screen</description>
  <managed-bean-name>fyeSelection</managed-bean-name>
  <managed-bean-class>
   com.bbh.tea.web.managedbeans.FisicalYearEndSelection</managed-bean-class>
  <managed-bean-scope>request</managed-bean-scope>

 </managed-bean>
<navigation-rule>
  <from-view-id>/views/dashboardtemplate.jsp</from-view-id>
  <navigation-case>
   <from-outcome>ProvisionScreen</from-outcome>
   <to-view-id>/views/provisionpackagelockdown.jsp</to-view-id>
  </navigation-case>
 </navigation-rule>


 <navigation-rule>
  <from-view-id>/views/dashboardtemplate.jsp</from-view-id>
  <navigation-case>
   <from-outcome>CopyProvisionTax</from-outcome>
   <to-view-id>/views/copyprovisionfortaxreturn.jsp</to-view-id>
  </navigation-case>
 </navigation-rule>

 <navigation-rule>
  <from-view-id>/views/dashboardtemplate.jsp</from-view-id>
  <navigation-case>
   <from-outcome>GLMappingSelection</from-outcome>
   <to-view-id>/views/generalledgerselection.jsp</to-view-id>
  </navigation-case>
 </navigation-rule>

and the class is like

/**
  * @return the ProvisionScreen(screen)
  */
 public String getProvisionScreen() {
  return "ProvisionScreen";
 }

 /**
  * @return the CopyProvisionTax(screen)
  */
 public String getCopyProvisionTaxScreen() {
  return "CopyProvisionTax";
 }

 /**
  * @return the FYEUploadScreen(screen)
  */
 public String getFYEUploadScreen() {
  return "FYEUploadScreen";
 }

any help or suggestion is appreciated

Thanks in advance

A: 

Hi

I found the solution.

we need to use <h:outputLink instead of h:commandLink

Thanks

A: 

Commandlinks needs to be inside a POST form. Is this all been placed inside a <h:form>? It's using JavaScript to submit the parent form. The JavaScript error you got is likely related to that it can't find the parent form element in the HTML DOM.

Regardless, using outputlinks for navigation is a much better choice (SEO!). So go ahead with that.

BalusC
A: 

Hi Balus,

Thanks for the valuable input. Yes you are right, I was using the inside but, since I am a novice to JSF, I was not aware of the proper usage of the tags. Now, after using it is working fine. Previously I tried to change faces-config.xml for using instead of but got no luck as I got some compilation issue with tree-id. Also I have one small question, I noticed that Eclipse Galileo doesn't provide content support for ui: tags. Is there any specific reason or I need to change settings in Eclipse.

Thanks Again for your help.

Regards, Ravi