3 Replies Latest reply on Mar 30, 2011 2:10 PM by anonyin

    <rich:dataGrid accessing the element content

    anonyin

      I am using a richDataGrid for gallery View and on double click of the each element I need to pass the element information to open a popup. I have a onRowDbClick event on the dataGrid and I see the first element id being passed for each element in that row.

       

      I was expecting the id of each element getting passed respectively on the click but rather the first element id of the corresponding row is getting passed.

       

      How do I acheive this functionality ?

       

      <rich:dataGrid  columns="4" elements="#{_bean.list.size()}"  value="#{_bean.list}"

                                  var="_listvar" width="55%" styleClass="galleryDataGrid" style="border-top: 1px;border-left: 1px;"

                                  onRowDblClick="openPopup('#{_listvar.id}');" >

       

       

      Thanks

      Kiran

        • 1. <rich:dataGrid accessing the element content
          ilya_shaikovsky

          because it's really row click and not element click. In order to implement element click you should use something like:

           

          <rich:dataGrid value="#{dataTableScrollerBean.allCars}" var="car" columns="3" elements="9" width="600px">

                                        <rich:panel bodyClass="pbody">

                                                  <f:facet name="header">

                                                            <h:outputText value="#{car.make} #{car.model}"></h:outputText>

                                                  </f:facet>

                                                  <h:panelGrid columns="2" onclick="alert(#{car.price})">

           

          (define the event at content container)

          • 2. <rich:dataGrid accessing the element content
            ilya_shaikovsky

            b.t.w. thanks! reviewing hwo it works in 4.x found that not implemented and tracked in jira. RF-10827

            • 3. <rich:dataGrid accessing the element content
              anonyin

              No issues, Thanks Ilya that explanation helped.

               

              Kiran.