Primefaces rowExpansion not working in primefaces 3.5 - primefaces

I am trying to use the p:rowToggler and p:rowExpansion in my datatable. It was working fine on primefaces 3.2, recently i upgraded to primefaces 3.5. Since then it is not working. Following is the datatable with roToggler and rowExpansion
<p:datatable value="#{myBean.valueList}">
<p:column>
<p:rowToggler/>
</p:column>
<p:rowExpansion>
...
</p:rowExpansion>
</p:datatable>
Any help would be appreciated
Thanks
Praveen

Please try as below,
<p:dataTable var="education"
value="#{backingBean.schoolList}"
reflow="true"
paginator="true"
sortMode="multiple"
emptyMessage="No records found."
rows="#{backingBean.rowsPerPage}">
<p:column headerText="Details" styleClass="Wid10">
<p:rowToggler expandLabel="Show" collapseLabel="Hide" icon="ui-icon-close"/>
</p:column>
<p:column headerText="Center">
<h:outputText value="#{education.centerName}"/>
</p:column>
<p:column headerText="Address">
<h:outputText value="#{education.addr}" />
</p:column>
<p:rowExpansion>
<p:outputLabel value="Course: " styleClass="FontBold" />
<BR />
<h:outputText value="#{education.course}" />
<Br />
<p:outputLabel value="Details: " styleClass="FontBold" />
<BR />
<h:outputText value="#{education.details}" />
</p:rowExpansion>
</p:dataTable>

Related

header not aligning with columns when scrollable enabled JSF Primefaces 6.0

I am developing web using PrimeFaces 6.0 components. On
<p:dataTable> component when we set scrollable="true" option, columns headers alignment goes wrong.
Following is my code snippet:
<p:fieldset legend="Machine Test Match" id="panel233" toggleable="true" toggleSpeed="500" >
<!--<p:panel id="panel233" header=" Machine Test Match" style="height:325px;border: none">-->
<p:dataTable id="testmatchtable" var="testMatchvalues" value="#{manufactureBean.listTestMatchata}" filteredValue="#{manufactureBean.filteredManufacture}" editable="true"
styleClass="mystyle" tableStyle="table-layout:auto;width:100% important!;" rowKey="#{testMatchvalues.testId}" scrollRows="10" scrollable="true" scrollHeight="230" rows="40" liveScroll="true" selection="#{manufactureBean.testMatchModel}" selectionMode="single" resizableColumns="true" >
<p:column headerText="Test ID" filterBy="#{testMatchvalues.testId}" filterMatchMode="contains" style="width:35px">
<h:outputText value="#{testMatchvalues.testId}" />
</p:column>
<p:column headerText="Test Desc" filterBy="#{testMatchvalues.testDesc}" filterMatchMode="contains" style="width:35px" >
<h:outputText value="#{testMatchvalues.testDesc}" />
</p:column>
<p:column headerText="Specimen Desc" filterBy="#{testMatchvalues.specimenDesc}" filterMatchMode="contains" style="width:35px" >
<h:outputText value="#{testMatchvalues.specimenDesc}" />
</p:column>
<p:column headerText="Path Test Desc" filterBy="#{testMatchvalues.pathTestDesc}" filterMatchMode="contains" style="width:35px">
<h:outputText value="#{testMatchvalues.pathTestDesc}" />
</p:column>
<p:column headerText="Path Param Name" style="width:35px" filterBy="#{testMatchvalues.parameterName}" filterMatchMode="contains">
<h:outputText value="#{testMatchvalues.parameterName}" />
</p:column>
<p:column headerText="Additional Factor" style="width:35px" >
<h:outputText value="#{testMatchvalues.additionFactor}" />
</p:column>
<p:column headerText="Multiply Factor" style="width:35px">
<h:outputText value="#{testMatchvalues.multiplyFactor}" />
</p:column>
<p:column headerText="Machine Host Code" style="width:35px">
<h:outputText value="#{testMatchvalues.machineHostCode}" />
</p:column>
<p:column headerText="Active" style="width:35px">
<h:outputText value="#{testMatchvalues.active}" />
</p:column>
</p:dataTable>
<!--</p:panel>-->
</p:fieldset>
Code taken from https://www.primefaces.org/showcase/ui/data/datatable/basic.xhtml
Attached image shows the problem clearly as column headers and data is not aligned properly.
Image link
For p:column, width="4%" works for me rather than using '4px'

Primefaces Data Exporter : Exporting data issue

I have an List of List. lets say student and address. one to many relationship. In my data table there are 3 columns for the Name, Surname, Age related to the Student and In a single column I need to show address with concatenating the following fields like, address1, address2, city, country.Now I need to export this table by using <p:dataExporter>. When I try to export as Excel the corresponding column of Address is exported as Object (org.primefaces.uirepeat. blah blah..)
My code is
<p:dataTable value="#{manager.studentList}" var="item" id="studentData">
<p:column>
<f:facet name="header">Name</f:facet>
<h:outputText value="#{item.name}" />
</p:column>
<p:column>
<f:facet name="header">Surname</f:facet>
<h:outputText value="#{item.surname}" />
</p:column>
<p:column>
<f:facet name="header">Age</f:facet>
<h:outputText value="#{item.age}" />
</p:column>
<p:column>
<f:facet name="header">Address</f:facet>
<ui:repeat value="#{studentBean.addressList}" var="address">
<h:outputText value="#{address.address1}" /> <br />
<h:outputText value="#{address.address2}" /> <br />
<h:outputText value="#{address.city}" /> <br />
<h:outputText value="#{address.country}" />
</ui:repeat>
</p:column>
</p:dataTable>
<h:commandLink>
<p:graphicImage name="/images/excel.png" />
<p:dataExporter type="xls" target="studentData" fileName="studentdetails" pageOnly="true"/>
</h:commandLink>
Suggest me some way to export. even I tried with c:forEach and columns.
<p:dataTable value="#{manager.studentList}" rowIndexVar="index" var="item" id="studentData">
<p:column>
<f:facet name="header">Name</f:facet>
<h:outputText value="#{item.name}" />
</p:column>
<p:column>
<f:facet name="header">Surname</f:facet>
<h:outputText value="#{item.surname}" />
</p:column>
<p:column>
<f:facet name="header">Age</f:facet>
<h:outputText value="#{item.age}" />
</p:column>
<p:column>
<f:facet name="header">Address</f:facet>
<c:forEach var="address" items="#{studentBean.addressList.get(index).address}">
<h:outputText value="#{address.address1}" />,
<h:outputText value="#{address.address2}"/>,
<h:outputText value="#{address.city}" />,
<h:outputText value="#{address.country}" />
</c:forEach>
</p:column>
</p:dataTable>
<h:commandLink>
<p:graphicImage name="/images/excel.png" />
<p:dataExporter type="xls" target="studentData" fileName="studentdetails" pageOnly="true"/>
</h:commandLink>
i trying with c:forEach is ok

Datatable emptyMessage is not shown in PF5.3

I am using PF 5.3, on (weblogic 11g/jsf2.0/java 1.6).
I thought the issue of not shown emptyMessage in Datatable is fixed in 5.3, but inspite of using the latest version, i still dont see the message. Below is my sample code.
<p:dataTable id="attaDt" var="fileRow" value="#{pendpaybean.selectedPayDetailsFiles}"
rowIndexVar="rowIndex"
emptyMessage="No Files Uploaded"
>
<p:column headerText="Uploaded Date"
width="15px;" style="text-align:center"
>
<h:outputText value="#{fileRow.columns[0]}" />
</p:column>
<p:column headerText="Uploaded By"
width="30px;" style="text-align:center"
>
<h:outputText value="#{fileRow.columns[3]}" />
</p:column>
</p:datatable>
Any help ?
Your code works well. NOTE I put attribute value to null for showing emptyMessage.
Your adapted code:
<h:body>
<h:form>
<p:dataTable id="attaDt" value="#{null}" var="fileRow" rowIndexVar="rowIndex" emptyMessage="No Files Uploaded">
<p:column headerText="Uploaded Date" width="15px;" style="text-align:center">
<h:outputText value="#{fileRow.columns[0]}" />
</p:column>
<p:column headerText="Uploaded By" width="30px;" style="text-align:center">
<h:outputText value="#{fileRow.columns[3]}" />
</p:column>
</p:dataTable>
</h:form>
</h:body>

PrimeFaces 3.2 dataExporter not working

I am using PrimeFaces 3.2 and want to export a dynamically created table as an .xls file. When i click on export, nothing seems to be happening.
Export Code
<h:commandLink id="Download_Excel_Format" ajax="false">
<p:graphicImage value="/resources/Excel_Icon.jpg" height="25" width="25" />
<p:dataExporter type="xls" target="dataTable" fileName="SomeFileName"/>
</h:commandLink>
dataTable
<p:dataTable id="dataTable" var="c" value="#{databaseSearch.customerList}"
paginator="true" rows="10" paginatorAlwaysVisible="false"
paginatorTemplate="Page {CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} Rows per page {RowsPerPageDropdown}"
rowsPerPageTemplate="5,10,15,30">
<p:column>
<f:facet name="header">
<h:outputText value="Machine" />
</f:facet>
<p:commandButton id="basic" value="#{c.machine}" action="#{updateEntry.setMachine(c.machine)}" oncomplete="dlg1.show();" styleClass="ui-Machinebutton" update=":Update_Entry"/>
<p:tooltip for="basic" value="Update/Delete Database Entry" showEffect="fade" hideEffect="fade" />
</p:column>
<p:column>
<f:facet name="header">
<h:outputText value="Company" />
</f:facet>
<h:outputText value="#{c.company}" />
</p:column>
<p:column>
<f:facet name="header">
<h:outputText value="Contact" />
</f:facet>
<h:outputText value="#{c.contact}" />
</p:column>
<p:column>
<f:facet name="header">
<h:outputText value="Phone" />
</f:facet>
<h:outputText value="#{c.phone}" />
</p:column>
<p:column>
<f:facet name="header">
<h:outputText value="Email" />
</f:facet>
<!-- <h:outputText value="#{c.email}" />-->
<h:outputLink value="mailto:#{c.email}?Subject=Baseline Monitor Alert | Machine : #{c.machine}">#{c.email}</h:outputLink>
</p:column>
</p:dataTable>
Both the dataTable and the Export command are within one form, however the dataTable is in a output panel (within the form).
Form
<h:form prependId="false" id="Main_Form">
</h:form>
Output Panel
<p:outputPanel id="panel" autoUpdate="false">
</p:outputPanel>
I even updated to PrimeFaces 3.4.2 to see if the dataExporter would work, but no avail, as far as i remember 3.2 has a bug if the dataTable generates columns dynamically, but that is not the case here right? am i doing something wrong?
dataExporter option looks much simpler, but if there is an alternative which is simple enough i am up for it.
Update
I am using a GlassFish 3.1.2.2 (build 5) & NetBeans 7.2.1, i do not get any errors, just the page refresh's, has a '#' at the end of the URL and stops, no errors means that i am not lacking any dependencies either... so i am lost here ...
Ok, i found the answer ! Tricky one though ... i had a commandButton with the ID=submit...renamed it and that did the trick !
<p:commandButton id="xsubmit" icon="ui-icon-search" title="Search Database" update="panel" actionListener="#{databaseSearch.customerList}" />

Primefaces -DataTable - Internal Sort

can we do a internal sorting in primeface datetable ? If i have column a ,b ,c. can i sort the column c and then internally by column b in p:dataTable.
<h:form>
<p:dataTable var="car" value="#{tableBean.carsSmall}">
<p:column headerText="Model">
<h:outputText value="#{car.model}" />
</p:column>
<p:column headerText="a">
<h:outputText value="#{car.year}" />
</p:column>
<p:column headerText="b">
<h:outputText value="#{car.manufacturer}" />
</p:column>
<p:column headerText="c">
<h:outputText value="#{car.color}" />
</p:column>
</p:dataTable>
</h:form>
Yes, you can. http://www.primefaces.org/showcase/ui/datatableSortingMultiple.jsf
P.S Don't forget pressing CTRL or Cmd :)