-
1. Re: divide column in to two columns
michpetrov Sep 25, 2014 6:58 AM (in response to asimshaikh1)Hi,
I don't understand your issue, why can't you just add two columns to the table?
-
2. Re: divide column in to two columns
asimshaikh1 Sep 25, 2014 8:01 AM (in response to michpetrov)I am trying to divide the attachment column into two sub columns 1st attachment should Displays "Downloads" ans 2nd attachment should display "Ammended Download"
-
3. Re: divide column in to two columns
michpetrov Sep 25, 2014 8:34 AM (in response to asimshaikh1)1 of 1 people found this helpfulYou mean something like this: http://showcase.richfaces.org/richfaces/component-sample.jsf?demo=dataTable&skin=blueSky ? Having two subheaders in the last column?
-
4. Re: divide column in to two columns
asimshaikh1 Sep 25, 2014 9:11 AM (in response to michpetrov)Yes I wanted like this only But I am fetching Data from the same column in database I just want to show it in two different subcolumns
-
5. Re: divide column in to two columns
michpetrov Sep 25, 2014 9:39 AM (in response to asimshaikh1)Well if you know for sure there will be two files then simply use li.files.get(0), li.files.get(1). Assuming li.files is a List.
-
6. Re: divide column in to two columns
asimshaikh1 Sep 29, 2014 1:37 AM (in response to michpetrov)I have created two columns and trying to show two columns but it gives me the following error .my attachments are either 1 or 2 not exactly two .can it be possible to show them by Id column of table (where AttachmentId=1 in first column and AttachmentId=2 in second column)
javax.el.ELException: /merc/outputjsf/licenceissueddata.xhtml @55,85 value="#{li.files.get(1)}": java.lang.IndexOutOfBoundsException: Index: 1, Size: 1
<rich:column style="width:15%;" id="LicenceDataclm3">
<f:facet name="header" >#{lbl['label.attachment']}</f:facet>
<rich:dataTable value="#{li.files.get(1)}" var="file" id="LicenceDatatable1"
style="width:100%;border: 0px;">
<rich:column style="width:20%; border: 0px;">
<h:commandLink actionListener="#{licenceIssuedMaster.downloadFile}" value="#{lbl['label.download']}" id="LicenceDatacmdlkdwndld">
<f:param name="fileName" value="#{file.uploadedFileName}"/>
<f:param name="caseFileId" value="#{file.caseFileId}"/>
</h:commandLink>
</rich:column>
</rich:dataTable>
</rich:column>
<rich:column style="width:15%;" id="LicenceDataclm3_a">
<f:facet name="header" >#{lbl['label.attachment']}</f:facet>
<rich:dataTable value="#{li.files.get(0)}" var="file" id="LicenceDatatable1_a"
style="width:100%;border: 0px;">
<rich:column style="width:20%; border: 0px;">
<h:commandLink actionListener="#{licenceIssuedMaster.downloadFile}" value="#{lbl['label.download']}" id="LicenceDatacmdlkdwndld_a">
<f:param name="fileName" value="#{file.uploadedFileName}"/>
<f:param name="caseFileId" value="#{file.caseFileId}"/>
</h:commandLink>
</rich:column>
</rich:dataTable>
</rich:column>
-
7. Re: divide column in to two columns
liuliu Sep 29, 2014 3:07 AM (in response to asimshaikh1)I dont think you can (need) put a datatable in another datatable. If I dont misunderstand, you just need put colspan for your column header attachement.
Or you show us what you want by a picture.
-
8. Re: divide column in to two columns
michpetrov Sep 29, 2014 3:30 AM (in response to asimshaikh1)java.lang.IndexOutOfBoundsException: Index: 1, Size: 1
Well, that happens if there is only one item. You have to check the size of the list and then render accordingly - use the fn:length function (from xmlns:fn="http://java.sun.com/jsp/jstl/functions") to check the size of the list, list.size() won't work.
-
9. Re: divide column in to two columns
asimshaikh1 Sep 30, 2014 5:18 AM (in response to michpetrov)What to do If I wanted like if LicenceAttachId='1' show in first column
if LicenceAttachId='2' show it in 2nd column or something like that #{li.files.get(0)} is good but throwing errors
-
10. Re: divide column in to two columns
liuliu Sep 30, 2014 9:05 AM (in response to asimshaikh1)if you remove .get(0), what you get?
-
11. Re: divide column in to two columns
asimshaikh1 Oct 1, 2014 1:34 AM (in response to liuliu)If I remove .get(o) I will get both the attachment perfectly. but I wanted to divide those attachment in two columns.
a ) If there is 1 attachment it should display in 1st column, 2nd column blank
b ) if 2 attachments should be displayed in both columns
<rich:dataTable value="#{li.files}" var="file" id="LicenceDatatable1">
-
12. Re: divide column in to two columns
liuliu Oct 1, 2014 3:13 AM (in response to asimshaikh1)you cant put a datatable in another datatable.
try this :
<rich:column>
li.file[0].uploadedFileName
</rich:column>
<rich:column>
li.file[1].uploadedFileName
</rich:column>
-
13. Re: Re: divide column in to two columns
michpetrov Oct 1, 2014 5:12 AM (in response to asimshaikh1)a ) If there is 1 attachment it should display in 1st column, 2nd column blank
b ) if 2 attachments should be displayed in both columns
Well, why don't you put this into the page?
<rich:column> <h:commandLink> <!-- li.files.get(0) --> </h:commandLink> </rich:column> <rich:column> <h:commandLink rendered="#{fn:length(li.files) == 2}"> <!-- if there are two items --> <!-- li.files.get(1) --> </h:commandLink> </rich:column>
-
14. Re: divide column in to two columns
asimshaikh1 Oct 1, 2014 7:04 AM (in response to michpetrov)Thank you I will try with this .is their any need to declare fn :length seperately