Hi!

I tried to use the onClick Event from selectOneListBox for navigation, but
the action method get not called:

 

<%@ taglib uri="http://java.sun.com/jsf/html"; prefix="h"%>

<%@ taglib uri="http://java.sun.com/jsf/core"; prefix="f"%>

<%@ taglib uri="http://myfaces.apache.org/tomahawk"; prefix="t"%>

<script type="text/javascript">

                  function executeCommandLink(idLink,formName){

 
document.forms[0].elements[formName+':_link_hidden_'].value=idLink;

            if(document.forms[formName].onsubmit){

                document.forms[formName].onsubmit();

            }

            document.forms[0].submit();

            return false;

                  }           

                  </script>

<f:subview id="subViewSelect" rendered="#{mainContrl.renderSelect}">

      <h:form id="fSelect" enctype="UTF-8">

            <h:panelGroup id="selectPG2">

                  <h:selectOneListbox id="selectTransportListTitle"

                        onclick="executeCommandLink('cmdLink1','fSelect')"

                        styleClass="selectList"
value="#{selectContrl.transportSelected}">

                        <f:converter converterId="transportConverter" />

                        <f:selectItems value="#{selectContrl.transportList}"
/>

                  </h:selectOneListbox>

            </h:panelGroup>

            <h:commandLink id="cmdLink1" action="#{selectContrl.showDetail}"
/>

      </h:form>

</f:subview>

 

 

<navigation-rule>

            <from-view-id>/jsp/secure/main.jsp</from-view-id>

            <navigation-case>

                  <from-action>#{selectContrl.showDetail}</from-action>

                  <from-outcome>success</from-outcome>

                  <to-view-id>/jsp/secure/detail.jsp</to-view-id>

            </navigation-case>

</navigation-rule>

 

 

private static final String SHOW_DETAIL = "success";

      public String showDetail() {

            return SelectController.SHOW_DETAIL;

      }

Reply via email to