2 Replies Latest reply on Mar 13, 2007 3:36 AM by .:lexx:.

    Seam+dataTable+methods with parameter

    .:lexx:. Newbie

      Does anybody knows how to implement dataTable with columns which values evaluated in method with parameters:

      <ice:dataTable id="foundPackets" value="#{foundPackets}" var="packet" columnClasses="basicColumn"
       rowClasses="basicTableRow1, basicTableRow2">
       <ice:column>
       <f:facet name="header">Time</f:facet>
       <ice:outputText value="#{packet.date}">
       <f:convertDateTime pattern="#{uiConstants.defaultPattern}"/>
       </ice:outputText>
       </ice:column>
      
       <ice:column>
       <f:facet name="header">SMSC</f:facet>
       <ice:outputText value="#{deliveryStatusHelper.isDeliveredToSmsc(packet.deliveries)}"/>
       </ice:column>
      </ice:dataTable>
      


      DeliveryStatusHelper.java:
      @Scope(ScopeType.SESSION)
      @Name("deliveryStatusHelper")
      public class DeliveryStatusHelper {
       public boolean isDeliveredToSmsc(DeliveryEvent[] deliveryEvents) {
       for (DeliveryEvent deliveryEvent : deliveryEvents) {
       if (deliveryEvent.getStatus() == DeliveryStatus.SMSC.getCode()){
       return true;
       }
       }
       return false;
       }
      


      The main problem is inoperability of construction "#{deliveryStatusHelper.isDeliveredToSmsc(packet.deliveries)}".
      Also i tried to use this construction:
      <h:outputText value="Yes" rendered="#{deliveryStatusHelper.isDeliveredToSmsc(packet.deliveries)}"/>
      But this one ends with parse exception:

      Caused by: javax.el.ELException: Error Parsing: #{deliveryStatusHelper.isDeliveredToSmsc(packet.deliveries)}
       at com.sun.el.lang.ExpressionBuilder.createNodeInternal(ExpressionBuilder.java:140)
       at com.sun.el.lang.ExpressionBuilder.build(ExpressionBuilder.java:157)
       at com.sun.el.lang.ExpressionBuilder.createValueExpression(ExpressionBuilder.java:201)
       at com.sun.el.ExpressionFactoryImpl.createValueExpression(ExpressionFactoryImpl.java:74)
       at org.jboss.seam.ui.facelet.SeamExpressionFactory.createValueExpression(SeamExpressionFactory.java:107)
       at com.sun.facelets.tag.TagAttribute.getValueExpression(TagAttribute.java:256)
       ... 71 more
      Caused by: com.sun.el.parser.ParseException: Encountered "(" at line 1, column 41.
      Was expecting one of:
       "}" ...
       "." ...
       "[" ...
       ">" ...
       "gt" ...
       "<" ...
       "lt" ...
       ">=" ...
       "ge" ...
       "<=" ...
       "le" ...
       "==" ...
       "eq" ...
       "!=" ...
      ...