1 Reply Latest reply on Aug 28, 2007 5:54 AM by Tomislav Jakopec

    How to remove the dataTable column

    Thiagu Mariappan Novice

      hai everyone

      this is my table structure

      product_category property
      cell phone messaging
      cell phone camera
      cell phone Entertainment
      Car fuel
      Car price
      id fuel price
      m55 petrol 35000
      c56 diesel 50000
      id messaging camera Entertainment
      2288 sms video capture FM
      4466 email zoom camera games

      i need to display the all products information under one category at a time.
      The datatable should be column wise and completely dynamic
      if i am going to display the car category i have two list for display the dataTable
      one from Table_products and another one from Table_Car

      this is my view part

      <rich:dataTable var="product" value="#{table_products_list}">
       <f:facet name="header">
       <h:outputText value="property" />
       <c:forEach items="#{car_list}" var="car">
       <h:outputText value="#{car .id}"/>  
       <h:commandLink value="Remove" action="#{bean.removeColumn}" /> </h:panelGroup>
       <h:outputText value="#{product.property}" />
       <c:forEach items="#{car_list}" var="car">
       <h:outputText value="#{car.returnValue(product.property)}"/>

      the DB have two entries in Table_car. so the dataTable shows three columens . one for showing properties and another two for dispaly two different entries in the DB.

      here when i click remove link on any column i need to remove that particular column. i dont know how to do this
      it is possible in Richface
      please anyone help me


        • 1. Re: How to remove the dataTable column
          Tomislav Jakopec Novice

          try something like this

          <c:forEach items="#{car_list}" var="car">
           <rich:column rendered="#{car.rendered}">
           <h:outputText value="#{car .id}"/>
          <h:commandLink value="Remove" action="#{bean.removeColumn}" />

          even thou I am not so sure that datatable is designet for this kind of work. Datatable shows properties of same type (ex. Car (id,type,motor))