0 Replies Latest reply on May 20, 2008 9:33 AM by rdomingo22041976

    scrollableDataTable / gmap, please HELP !!

    rdomingo22041976

      Hello All,

      I'm coding jsf for some months now, but still looking for a jsf implementation that works for me :(

      I just started using richfaces which looks great, but I just can't get it to work. Please help.

      I have a scrollable data table and my selections seems to be working. See code on end of my message.

      When I select a user in my table, the username is shown by outputText myOutput.

      But I need to access the selected user in my javascript oncomplete (so I can update my gmap using the street/city from the user).

      The current problem using the a4j:support is that 'data' is retrieved befor the action is executed. So in the oncomplete I have no access to the new selected user.

      How can I obtain the new selected user in the oncomplete javascript, after I clicked on a different row in my table ? Or how can I update gmap after I select a different user in my table.

      Currently for updating gmap I have some javascript function having the adres as argument. Converting the address to a point and setting the center on the map using this point.

      My gmap looks like:
      <rich:gmap
      gmapVar="map"
      rendered="true"
      gmapKey="...">

      Best regards,
      Raymond Domingo


      <h:outputText id="myOutput" value="#{usersDataBean.name}"/>

      <rich:scrollableDataTable
      value="#{usersDataBean.users}" binding="#{usersDataBean.tableComponent}"
      selection="#{usersDataBean.selection}" var="user">

      <rich:column>
      <f:facet name="header">
      <h:outputText value="Name"/>
      </f:facet>

      <h:outputText value="#{user.name}"/>
      </rich:column>

      <a4j:support
      event="onRowClick"
      reRender="userDetails"
      action="#{usersDataBean.takeSelection}"
      data="#{usersDataBean.name}"
      oncomplete="alert(data);"
      >
      </a4j:support>

      </rich:scrollableDataTable>