1 Reply Latest reply on Jun 10, 2007 4:58 PM by Moritz Herrmann

    Problem getting data or a simple value from <rich:dataTable>

    Moritz Herrmann Newbie

      I hope somebody can help me.

      I'm trying to get the data from a selected row of a <rich:dataTable> into my backing bean.
      The action works fine but until now I couldn't get the data from the table into my backing bean which I want to use in this action.

      "action" in table:

      ...
      <rich:column>
       <f:facet name="header">
       <h:outputText value="#{mess.ticket_data_date}" />
       </f:facet>
       <h:outputText value="#{item.date}" />
       <a4j:support event="onclick" action="#{ticketbean.resetTicket}" reRender="panel_ticket" />
      </rich:column>
      ...


      I hope my problem is understandable. Many thanks for your help in advance.

        • 1. Re: Problem getting data or a simple value from <rich:dataTa
          Moritz Herrmann Newbie

          I solved it this way:

          Code in JSF-Page

          ...
          <rich:column>
           <f:facet name="header">
           <h:outputText value="#{mess.ticket_data_date}" />
           </f:facet>
          
           <h:outputText value="#{item.date}" />
           <a4j:support event="onclick" action="#{ticketbean.selectActivity}" reRender="panel_ticket" />
           </rich:column>...


          Code for setting values in ticketbean
          ...
          public java.lang.String selectMission(){
           HashMap<String, String> Mission= DataBean.giveMissionDesc();
           missiondescription=Mission.get("description");
           numbermission=Mission.get("mission");
           return null;
           }...


          Code in DataBean for giveMissionDesc()
          ...
          public static java.util.HashMap giveMissionDesc() {
           MissionDescriptionAll selectedObjectMission = (MissionDescriptionAll) missionTabel
           .getRowData();
          
           Mission.put("description", selectedObjectMission.getDescription());
           Mission.put("date", selectedObjectMission.getDate());
           Mission.put("mission", selectedObjectMission.getMission());
           return Mission;
           // return selectedObject;
           }...