4 Replies Latest reply on Dec 4, 2008 7:01 AM by vladimir.kovalyuk

    ui:repeate and el expression with argument

    dcowan.david.dcowan.com

      I have a SLSB dataService that has a method queryDataByDays(String identifier, int days) that I want to call from within a ui:repeat tag



      <ui:repeat value="#{deviceList.resultList}" var "device">
         <ui:repeat value="#{dataService.queryDataByDays(device.identifier, 30)">
           ... do display work here
         </ui:repeat>
      </ui:repeat>



      The part that fails is the device.identifier is not available when queryDataByDays is actually called. It gets converted to an empty string.  I can't seem to find a way to make this work.  Based on the documentation and JBSEAM-1733 it seems this is not possible.  Given that's the case does anyone have any suggestions of another way to do this?

        • 1. Re: ui:repeate and el expression with argument
          vladimir.kovalyuk

          From my perspective it does not seem to be related to https://jira.jboss.org/jira/browse/JBSEAM-1733.


          Your excerpt seems incomplete. For instance you do not have 'var' attribute in the second ui:repeat and do not show the use of that variable.

          • 2. Re: ui:repeate and el expression with argument
            dcowan.david.dcowan.com

            I was trying to keep it simple, but cut out a bit to much




            <ui:repeat value="#{myDevicesList.resultList}" var="device">
                 <p:linechart title="#{device.identifier}" width="500" height="300" legend="true">
                             
                     <p:series key="Value"  > 
                        <ui:repeat value="#{dataService.queryDataForDeviceByDays(#{device.identifier}, 30)}" var="data">
                            <p:data key="#{data.dateCreated}" value="#{data.value}" />
                        </ui:repeat>
                     </p:series>
            
                        </ui:repeat>
                     </p:series>     
                 </p:linechart> 
            </ui:repeat>    


            • 3. Re: ui:repeate and el expression with argument
              vladimir.kovalyuk

              Does the following work?


              <ui:repeat value="#{dataService.queryDataForDeviceByDays(device.identifier, 30)}" var="data">



              The first excerpt didn't contain an extra #{} within expression.

              • 4. Re: ui:repeate and el expression with argument
                vladimir.kovalyuk

                try the following:


                <c:forEach items="#{myDevicesList.resultList}" var="device">
                     <p:linechart title="#{device.identifier}" width="500" height="300" legend="true">
                                 
                         <p:series key="Value"  > 
                            <c:forEach items="#{dataService.queryDataForDeviceByDays(device.identifier, 30)}" var="data">
                                <p:data key="#{data.dateCreated}" value="#{data.value}" />
                            </ui:repeat>
                         </p:series>
                
                     </p:linechart> 
                </ui:repeat>    



                please post the result.