0

I have a component like this

<p:selectOneMenu value="#{loadCouponGroupBean.functionHolderType}" style="width:100px"
                required="true" requiredMessage="#{msgs['msg.required']}" onkeyup="submit()"
                id="typeofCard" panelStyleClass="hideDisabled"  valueChangeListener="#{loadCouponGroupBean.findbytypeFunction}">
                <f:selectItem itemLabel="" itemValue="" />
                <f:selectItems value="#{loadCouponGroupBean.functionHolderBo.functionHolderTypes}" />
            </p:selectOneMenu>

and in my managed bean i have a method like this

public void findbytypeFunction(ValueChangeEvent e) {

        System.out.println("Helloooooooooooooooooooooooooo");
        String functionHolderType = (String) ((UIInput) e.getSource()).getAttributes().get("functionholdertype");

        System.out.println("FunctionHolderType" + functionHolderType);

    }

when i change the value the form is getting submitted and error page is coming instead i want to be on the same page and get the value from the dropdown in my managed bean .How can i do this?

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
prasad
  • 61
  • 1
  • 1
  • 6
  • The error shown in the error page represents the answer to your problem. In case you're incapable of interpreting the error message, by all means include it in the question. We can translate it in layman's terms so you finally understand it. Nonetheless, the correct solution depends on the functional requirement (i.e. what are you planning to do with the selected value, e.g. populating another dropdown?). You should also make sure you're reading resources matching your JSF version. This approach is much JSF 1.x based while there are much better ways in JSF 2.x. – BalusC Aug 12 '16 at 07:23
  • i am getting view expired exception.Yes i want to populate another dropdown – prasad Aug 12 '16 at 07:31
  • The abovelinked duplicate answers your current problem. Once you have fixed it, advance here how to populate a cascading dropdown: http://stackoverflow.com/q/16378099. In the future questions, please don't ignore exceptions. They represent the answer. – BalusC Aug 12 '16 at 07:33
  • javax.faces.application.ViewExpiredException: /loadCouponGroup.facesNo saved view state could be found for the view identifier: /loadCouponGroup.faces at org.apache.myfaces.lifecycle.RestoreViewExecutor.execute(RestoreViewExecutor.java:128) ~[com.ibm.ws.jsf.myfaces.jar:?] at org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:172) [com.ibm.ws.jsf.myfaces.jar:?] at org.apache.myfaces.lifecycle.LifecycleImpl.execute at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:960) [com.ibm.ws.webcontainer.jar:?] at – prasad Aug 12 '16 at 07:44

0 Answers0