4 Replies Latest reply on Sep 19, 2007 1:43 AM by dev aaa

    Problem in <rich:dataTable>

    dev aaa Newbie

      I am using Rich data Table to display list of urls.
      The user has an option to delete or edit a url.


      <rich:dataTable
      onRowMouseOver="this.style.backgroundColor='#F1F1F1'"
      onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'"
      cellpadding="0" cellspacing="0"
      width="550" border="0" value="#{CreateViewBean.urlList}" var="urlList1" rendered="#{CreateViewBean.displayTableData}" binding="#{CreateViewBean.dataTable}">
      <f:facet name="header">
      <rich:columnGroup>
      <rich:column >
      <h:outputText value="URL" />
      </rich:column>
      <rich:column>
      <h:outputText value="Actions" />
      </rich:column>
      </rich:columnGroup>
      </f:facet>
      <rich:columnGroup>
      <rich:column styleClass="style9"><h:outputText value="#{urlList1}" ></h:outputText></rich:column>
      <rich:column>
      <h:graphicImage value="../images/tab_actions_edit.gif" alt="Edit" /> <h:commandLink action="#{CreateViewBean.removeURL}"><h:graphicImage value="../images/tab_actions_delete.gif" alt="Delete" /> </h:commandLink> </rich:column>
      </rich:columnGroup>
      </rich:dataTable>

      The problem that I am facing is when the user clicks on the Delete button nothing happens.

      The java code is as follows:

      public void removeURL(){

      String urlRemove = (String)getDataTable().getRowData();
      System.out.println(urlRemove);
      }

      public boolean isDisplayTable() {
      if(urlList.size()>0)
      {
      displayTableData = true;
      }
      return displayTableData;
      }

      Please let me know, what mistake I am doing.
      Thanks in advance