9 Replies Latest reply on Jan 28, 2009 6:35 AM by ilya_shaikovsky

    ExtendedDataTable with empty column ?

    sebekk23

      Programing with richfaces is new thing to me and maybe i don't read all docs for component extendedDataTable, so don't be angry if I ask about something obvious :). So question is: Is it normal behavior for ExtendedDataTable to renderer more columns that is write in code ?
      My code is:

      <rich:extendedDataTable id="edt" value="#{articleList.articles}" var="edt" style="padding:0;margin0;overflow:auto;"
       sortMode="single" selectionMode="single" selection="#{articleList.selection}" rowKeyVar="rvk" rules="all"
       stateVar="#{articleList.tableState}" width="795px" height="300px">
       <rich:column id="lp" sortable="false" width="5%">
       <f:facet name="header">
       <h:outputText value="Lp" />
       </f:facet>
       <h:outputText value="#{rvk}" />
       </rich:column>
       <rich:column id="name" headerClass="dataTableHeader" label="Tytuł" sortable="true" sortBy="#{edt.name}"
       sortIconAscending="dataTableAscIcon" sortIconDescending="dataTableDescIcon" width="30%">
       <f:facet name="header">
       <h:outputText value="Tytuł" />
       </f:facet>
       <h:outputText value="#{edt.name}" />
      
       </rich:column>
       <rich:column id="date" headerClass="dataTableHeader" label="Data publikacji" sortable="true" sortIconAscending="dataTableAscIcon"
       sortIconDescending="dataTableDescIcon" width="20%">
       <f:facet name="header">
       <h:outputText value="Data publikacji" />
       </f:facet>
       <h:outputText value="#{edt.published_date}" ><f:convertDateTime pattern="yyyy-MM-dd HH:mm:ss"/></h:outputText>
      
       </rich:column>
       <rich:column id="autor" headerClass="dataTableHeader" label="Autor" sortable="true" sortIconAscending="dataTableAscIcon"
       sortIconDescending="dataTableDescIcon" width="10%">
       <f:facet name="header">
       <h:outputText value="Autor" />
       </f:facet>
       <h:outputText value="#{edt.user.name}" />
      
       </rich:column>
       <rich:column id="attachment" headerClass="dataTableHeader" label="Załącznik" sortable="false" width="10%">
       <f:facet name="header">
       <h:outputText value="Załącznik" />
       </f:facet>
       <h:outputText value="#{edt.id_attachment.mime}" />
      
       </rich:column>
       <rich:column id="articleHeader" headerClass="dataTableHeader" label="Nagłówek" sortable="false" width="27%">
       <f:facet name="header" >
       <h:outputText value="Nagłówek" />
       </f:facet>
       <rich:simpleTogglePanel switchType="client" label="Fragment artukułu" opened="false" width="100%">
       <h:outputText value="#{edt.content}" />
       </rich:simpleTogglePanel>
      
       </rich:column>
       </rich:extendedDataTable>


      [url=http://img150.imageshack.us/my.php?image=zrzutekranu1wu7.png][img=http://img150.imageshack.us/img150/2731/zrzutekranu1wu7.th.png][/url]

      Ps.
      Sorry for my poor english :).

        • 1. Re: ExtendedDataTable with empty column ?
          ilya_shaikovsky

          yes fake column used in the markup because the extended table columns resizable.

          • 2. Re: ExtendedDataTable with empty column ?
            sebekk23

            Thx for answer. Is it possible to turn it off ? When i set width to 100% this table looks ugly! :) Or, maybe, to set it to given width with Css (or something else)?

            • 3. Re: ExtendedDataTable with empty column ?
              ilya_shaikovsky

              just hide the borders for this column via CSS. Or adjust other columns to fit the table.

              • 4. Re: ExtendedDataTable with empty column ?
                smutzski

                You can't delete this column? it is always shown? what stupid....

                How can i adjust other column to fit the table?

                • 5. Re: ExtendedDataTable with empty column ?
                  ilya_shaikovsky

                   

                  You can't delete this column? it is always shown? what stupid....


                  feel free to create your own markup for this component and to show us how to implement resize ability without fake column.

                  How can i adjust other column to fit the table?

                  by specifying the sizes.

                  • 6. Re: ExtendedDataTable with empty column ?
                    smutzski

                     

                    "ilya_shaikovsky" wrote:
                    You can't delete this column? it is always shown? what stupid....


                    feel free to create your own markup for this component and to show us how to implement resize ability without fake column.

                    How can i adjust other column to fit the table?

                    by specifying the sizes.


                    Yeah i'm sorry.. :P
                    I just think it's strange that 1 column is added, Datatable doesn't have it.

                    My table is not always the same size, so when i add a column or delete 1 it has to fit the table, and not that the extra column is shown. :)

                    (sorry for my bad english).


                    • 7. Re: ExtendedDataTable with empty column ?
                      ilya_shaikovsky

                       

                      <rich:extendedDataTable value="#{extendedTableBean.capitalsDataModel}" var="cap" id="table"
                       width="580px" height="400px" sortMode="#{extendedTableBean.sortMode}"
                       selectionMode="#{extendedTableBean.selectionMode}">
                       <rich:column sortable="false" label="Flag" width="70%">
                       <f:facet name="header">
                       <h:outputText value="Flag"/>
                       </f:facet>
                       <h:graphicImage value="#{cap.stateFlag}"/>
                       </rich:column>
                       <rich:column sortable="true" sortBy="#{cap.state}" filterBy="#{cap.state}" filterEvent="onkeyup" width="30%" label="State Name">
                       <f:facet name="header">
                       <h:outputText value="State Name"/>
                       </f:facet>
                       <h:outputText value="#{cap.state}"/>
                       </rich:column>
                      
                       </rich:extendedDataTable>


                      width in percents works as it should for me. columns fits the table width


                      • 8. Re: ExtendedDataTable with empty column ?
                        smutzski

                         

                        "ilya_shaikovsky" wrote:
                        <rich:extendedDataTable value="#{extendedTableBean.capitalsDataModel}" var="cap" id="table"
                         width="580px" height="400px" sortMode="#{extendedTableBean.sortMode}"
                         selectionMode="#{extendedTableBean.selectionMode}">
                         <rich:column sortable="false" label="Flag" width="70%">
                         <f:facet name="header">
                         <h:outputText value="Flag"/>
                         </f:facet>
                         <h:graphicImage value="#{cap.stateFlag}"/>
                         </rich:column>
                         <rich:column sortable="true" sortBy="#{cap.state}" filterBy="#{cap.state}" filterEvent="onkeyup" width="30%" label="State Name">
                         <f:facet name="header">
                         <h:outputText value="State Name"/>
                         </f:facet>
                         <h:outputText value="#{cap.state}"/>
                         </rich:column>
                        
                         </rich:extendedDataTable>


                        width in percents works as it should for me. columns fits the table width


                        and how to fit the table to your page..? i can't use 100% or 1% or something?? :)

                        • 9. Re: ExtendedDataTable with empty column ?
                          ilya_shaikovsky

                          Yes, I've found the problem. will be checked.
                          https://jira.jboss.org/jira/browse/RF-5942

                          thanks.

                          b.t.w. table correctly rendered with % sizes I defined. But the columns trunkated within the table.