2 Replies Latest reply on Feb 18, 2010 5:29 PM by lasuchobciuch

    EntityQuery and @DataModelSelection

      Hi


      I'm trying to use @DataModelSelection from EntityQuery to get selected row from ExtendedDataTable but it doesn't work for me.
      Here's part of code:


         
      <h:outputText value="#{data.dataModelSelection.id}" id="text2" />
        <rich:extendedDataTable
                      id="exdt"
                      value="#{data.dataModel}" var="zl" 
                      sortMode="multi" selectionMode="single"
                      height="650px" >
      



      and ajax


                     <a4j:support reRender="outcomment, text, text2"
                              event="onselectionchange" />
      



      When page loads, i see id of element in first row.
      Then if i click i get null pointer exception :(


      Could someone give me working example ?


        • 1. Re: EntityQuery and @DataModelSelection
          ranophoenix

          EntityQuery is by default an Event scope component. Change it to Page scope and your code must work.


          Regards,

          • 2. Re: EntityQuery and @DataModelSelection

            Thanks for reply
            I have changed the code and now get this exception:


            javax.el.ELException: /DataList.xhtml @419,92 value="#{data.dataModelSelection.id}": Error reading 'dataModelSelection' on type org.domain.testpro.session.DataList_$$_javassist_seam_2
            



            I use entities generated with jboss tools with some modifications.
            If i change this line:


            <h:outputText value="#{data.dataModelSelection.id}" id="text2" />
            


            into



            <h:outputText value="#{data.dataModelSelectionIndex}" id="text2" />
            


            I won't get exception, but clicking on row shows good index for just a second and then changes to -1