2 Replies Latest reply on Dec 20, 2007 8:22 AM by Matthias Besemer

    Outjected variable as parameter for enhanced EL

    Matthias Besemer Newbie

      Hi,

      how can I get an outjected object as a call parameter for an action method in a Facelets XHTML page?

      In DataTable its easy by using

       <h:dataTable id="customerlist"
       value="#{customerList}"
       var="customer">
       ...
       <h:commandLink value="#{customer.name}"
       action="#{ChooseCustomer.showDetails(customer)}"/>
      ...
      


      But if I haven't got a data table, i've no idea how to do that with enhanced EL. Nested EL expressions obviously doesn't work (choosenCustomer is outjected here by @Out and present if I check it with #{choosenCustomer.name}):

      <h:commandLink id="back-customerdetails"
       value="Back to details"
       action="#{ChooseCustomer.showDetails(#{choosenCustomer})}"/>
      


      And that one doesn't work, too - as expected:

      <h:commandLink id="back-customerdetails"
       value="Back to details"
       action="#{ChooseCustomer.showDetails(choosenCustomer)}"/>
      


      Is there any solution with enhanced EL or am I doomed to use page parameters?

        • 1. Re: Outjected variable as parameter for enhanced EL
          Pete Muir Master

           

          "mahbe" wrote:

          <h:commandLink id="back-customerdetails"
           value="Back to details"
           action="#{ChooseCustomer.showDetails(choosenCustomer)}"/>
          


          This is the one that should work. What scope do you outject the chosenCustomer to?

          • 2. Re: Outjected variable as parameter for enhanced EL
            Matthias Besemer Newbie

            By now, I solved the problem with page id.

            What scope do you outject the chosenCustomer to?


            I did outject it at standard scope (only with @Out). The page with the commandLink is generated from an @End annotated action method. Oddly enough

             <s:link id="back-customerdetails"
             value="Back to details"
             action="#{ChooseCustomer.showDetails(null)}">
             <f:param name="custno" value="#{choosenCustomer.customerNo}"/>
             </s:link>
            


            does work now, but

            <h:commandLink id="back-customerdetails"
             value="Back to details"
             action="#{ChooseCustomer.showDetails(choosenCustomer)}"/>
            

            did not.

            And don't nail me down to it, but I'm quite sure that I used commandLink inside form tags.