2 Replies Latest reply on Jan 14, 2009 9:56 PM by Donald Hook

    Attempted to bind an @Out attribute of the wrong type

    Donald Hook Newbie
      I receive this error after executing a query and binding the result EntityQuery to the @Out parameter.  Not sure what I am doing wrong. Any insight would be appreciated. Thanks!


      Class Code Snippet:
      ===================
      @Out(required=false)
      protected EntityQuery<AccountStock> openPositions;

      viewOpenPositions Method:
      =========================
      openPositions = new EntityQuery<AccountStock>();
                              openPositions.setEjbql("select accountStock from AccountStock accountStock where accountStock.accountId = #{accountHome.getInstance().getAccountId()} and sellDate is NULL ");
                              openPositions.setOrderColumn("purchaseDate");
                              openPositions.setOrderDirection("ASC");
                              openPositions.getResultList();

      Page Snippet
      ============
      <rich:tab id="openPositionsTab" label="Open Positions" labelWidth="150" onclick="#{myAccount.viewOpenPositions()}">
          <rich:panel>
              <f:facet name="header">Open Positions</f:facet>
                  <div class="results" id="openPositions">
                                     
                      <h:outputText value="There are no open positions in your account."
                              rendered="#{empty openPositions.resultList}"/>
                                             
                      <rich:dataTable id="openPositions" var="_position"
                              value="#{openPositions.resultList}"
                              rendered="#{not empty openPositions.resultList}">
                          <h:column>
                              <f:facet name="header">
                                  <ui:include src="layout/sort.xhtml">
                                      <ui:param name="entityList" value="#{openPositions}"/>
                                      <ui:param name="propertyLabel" value="Symbol"/>
                                      <ui:param name="propertyPath" value="accountStock.stockId"/>
                                  </ui:include>
                              </f:facet>
                              <h:outputText value="#{_position.stockId}"/>
                               </h:column>