1

I am trying to render an input box based on the value selected in the drop down.

I had placed the input box under a panelGrid as below

                        <h:panelGrid id="pnl1" styleClass="Container90"
                            columnClasses="Wid20, Wid80" columns="2" cellpadding="5">
                            <p:outputLabel for="clientRegAcessToken1"
                                value="Client Registration Token"
                                rendered="#{clientRegistration.regSecretShown}" />
                            <p:inputText id="clientRegAcessToken1"
                                rendered="#{clientRegistration.regSecretShown}"
                                value="#{clientRegistration.regToken}" />
                        </h:panelGrid>

I have the selectOneMenu as below

                                <p:selectOneMenu styleClass="w250"
                                    id="idTokenSignedResponseAlg" 
                                    value="#{clientRegistration.client.idTokenSignedResponseAlg}" 
                                    >
                                    <f:selectItems
                                        value="#{clientRegistration.getJwsAlgorithms()}" var="algo"
                                        itemValue="#{algo}" itemLabel="#{algo.name}" />
                                    <p:ajax update="ViewClientRegistration:pnl1"
                                        listener="#{clientRegistration.onHmacSigningKeySelected}"/>
                                </p:selectOneMenu>

Method definition in the bean (ViewScoped) is as below

public void onHmacSigningKeySelected(AjaxBehaviorEvent event) {

        System.out.println("Entered" + client.getIdTokenSignedResponseAlg());
        regSecretShown=true;
    }

I see that changing the value is sending a network request. However, I am not seeing the method getting executed on the server side. Is there something I am missing ?

Balaji Katika
  • 2,835
  • 2
  • 21
  • 19
  • Did you exclude all of http://stackoverflow.com/questions/2118656/commandlink-commandbutton-ajax-backing-bean-action-listener-method-not-invoked? Are you absolutely sure that it isn't just a conversion or validation error? (which is normally displayed in a messages component and otherwise logged in server log) – BalusC Oct 12 '15 at 11:55
  • @BalusC, Do you see any specific point in the list applicable for me ? I don't think it applies to me. My issues is that server side method is not getting invoked. – Balaji Katika Oct 12 '15 at 11:59
  • That is where the whole Q/A BalusC referred to is about!!!. Find out yourself which one is applicable – Kukeltje Oct 12 '15 at 12:05
  • I did go through it and it helped me earlier. But I don't think this issue is due to any of the points mentioned in the link. – Balaji Katika Oct 12 '15 at 12:07
  • So, you added a ``, but you didn't see any messages? You did nowhere explicitly exclude that. – BalusC Oct 12 '15 at 12:12
  • Yes. I have at the top of my page. I don't see any conversion/validation errors. Indeed I see a 200 OK response returned from the server after the value is changes for the p:selectOneMenu. My concern is the onHmacSigningKeySelected() method in the server is not getting invoked after changing the values. Looks like I am missing something else.. – Balaji Katika Oct 12 '15 at 13:52
  • @BausC, I've figured out the cause. Its because the idTokenSignedResponseAlg element is under a panel that gets rendered based on a boolean value tied to the backend. As per point #5 from the link above, the rendered attribute evaluates to false and method doesn't get invoked. Now, passing the params via ajax call as but no luck. Is there some other way to pass a params so I can parse it through request parameters – Balaji Katika Oct 13 '15 at 04:32

0 Answers0