5 Replies Latest reply on Dec 11, 2008 12:12 AM by amiliosanchez

    Why parametes passed via JSF EL always null?

    amiliosanchez

      In this example:


      <a4j:repeat value="#{someList}" var="someValue">
      ...
      <h:selectBooleanCheckbox id="#{someUtil.generateAnIdForAPurpose(someValue)}"
      ...
      



      The someValue is always null when passed to my generateAnIdForAPurpose method.


      My application is running in JBoss 4.2.2, I have tried implementing the Seam component as both an EJB and POJO. Originally I had it as POJO with stateless scope and bypassing interceptors.


      I went up to the point of trying it as a stateful EJB with application scope in attempt to get it to work.


      I assume there is something on the client end that I'm not aware of that is causing this?

        • 1. Re: Why parametes passed via JSF EL always null?
          amiliosanchez

          anyone?

          • 2. Re: Why parametes passed via JSF EL always null?

            what control do you use for submit?

            • 3. Re: Why parametes passed via JSF EL always null?
              matt.drees

              Amilio Sanchez wrote on Dec 10, 2008 20:47:


              <a4j:repeat value="#{someList}" var="someValue">
              ...
              <h:selectBooleanCheckbox id="#{someUtil.generateAnIdForAPurpose(someValue)}"
              ...
              




              Yeah, I don't think you can do that.
              The id expression only gets evaluated once; there's only one HtmlSelectBooleanCheckbox component in the component tree.  When the page renders, this component will be asked to render itself multiple times, but there's only one component.
              So the id can't be row-dependent.

              • 4. Re: Why parametes passed via JSF EL always null?

                I agree; don't think it's possible.  However, could you use an a4j:actionParam here on someValue and set it to your backing bean?


                For example, I did something similar here:



                <rich:dataTable
                               id="contactTypes"
                               var="contactTypes"
                               value="#{eventManager.getEventContactTypes()}"
                               rendered="true"
                               rowClasses="evenRows"
                               sortMode="single"
                               width="#{globals['dataTable.width.default']}"
                               rows="#{englinkUtil.getDefaultDataTableRows(facesContext, null)}">
                <!-- columns -->
                               
                
                <a4j:commandLink 
                     value="Add User"
                     action="#{userPicker.initPicker('eventManager.addContact')}"
                     onclick="#{rich:component('defaultUserPickerModal')}.show()">
                <a4j:actionparam name="selectedContactTypeId" value="#{contactTypes.id}"
                assignTo="#{eventManager.selectedContactTypeId}"/>
                </a4j:commandLink>



                • 5. Re: Why parametes passed via JSF EL always null?
                  amiliosanchez

                  Thanks for the suggestions I'll try them out and let you know.