2 Replies Latest reply on May 16, 2012 9:27 AM by ajsushil

    Component binding inside datatable (to row item)

    okanxyz

      Is there a solution for component binding to row item property inside datatable, i.e.

       

      <rich:datatable value="#{bean.details}" var="item">

          ...

           <rich:column>

                <rich:dropDownMenu binding="#{item.menu}" />

           </rich:column>

           ...

      </rich:datatable>

       

      It's trigger a Exception

      Target Unreachable, identifier 'item' resolved to null.


      When i remove column, everything renders fine, all the item properties.

       

      Richfaces masters, please can someone check this.

       

      Thanks in advance!

        • 1. Re: Component binding inside datatable (to row item)
          okanxyz

          For now, i figure out why isn't possible to bind component to row item. It's because binding is executed before table is generated in restoreview and renderresponse phase, so that a item is unreachable.

           

          To avoid component binding inside datatable, i have to create dynamically (inside a bean) datatable, what is a enormous job to do,  and bind it to view.

           

          My next suggestion for richfaces developers (or JSF developers) is to try develop richfaces component container (for example: tag rich:componentContainer) which has a value attribute. For attribute value value i will put expression evaluated to UIComponent, and inject that component inside view tree.

           

          This could be some kind of replacement for component binding.

           

          And, offcource, if something similiar already exists, please posted here. I use richfaces 4.0 final and JSF 2.0.

          • 2. Re: Component binding inside datatable (to row item)
            ajsushil

            I am facing same issue. I have a editable table. I have to bind the table data to backing bean. Can you pleaase elaborate the "To avoid component binding inside datatable, i have to create dynamically (inside a bean) datatable, what is a enormous job to do,  and bind it to view." .  This will be a great help.