Dynaform: Component attribute does not work with datatable
See original GitHub issueDescribe the bug Use a component for dynaFormControl of Dynaform, that component has attributes and a datatable. Those attributes resolved to empty values although we pass non-empty values to those attributes.
Reproducer A sample project is at https://github.com/lttung04/dynaform-with-datatable
Environment:
- PF Version: 11.0.0
To Reproduce Steps to reproduce the behavior:
- Go to your deployed application, e.g. http://localhost:8080/primefaces-test/
- Cannot see a table
NOTE Look at the sample code, you could see <h:outputText value=“#{cc.attrs.nameColumnRendered}” />, but #{cc.attrs.nameColumnRendered} is resolved to empty value.
Expected behavior See a table with one row
Sample XHTML File dynaform.xhtml
<h:form id="form">
<local:DocumentContainer />
</h:form>
File DocumentContainer.xhtml
<cc:interface>
</cc:interface>
<cc:implementation>
<pe:dynaForm id="dyna-form" value="#{dynaFormController.model}" var="dynaData">
<pe:dynaFormControl type="FileUpload" for="fileUpload">
<local:DocumentTable id="fileUpload" notInDynaform="true" nameColumnRendered="true" />
</pe:dynaFormControl>
</pe:dynaForm>
</cc:implementation>
File DocumentTable.xhtml
<cc:interface>
<cc:attribute name="nameColumnRendered" default="true" />
<cc:attribute name="notInDynaform" default="true" />
</cc:interface>
<cc:implementation>
<cc:renderFacet name="componentHeader" />
<p:dataTable id="document-table" value="#{dynaFormController.documents}" var="document"
style="border:solid; border-width:1px">
<p:column headerText="Name" rendered="#{cc.attrs.nameColumnRendered}">
<h:outputText id="name" value="#{document}" title="#{document}" />
</p:column>
</p:dataTable>
<h:outputText value="#{cc.attrs.nameColumnRendered}" />
<cc:renderFacet name="componentFooter" rendered="#{cc.attrs.notInDynaform}" />
</cc:implementation>
Sample Bean
@ManagedBean
@ViewScoped
public class DynaFormController implements Serializable {
private static final long serialVersionUID = 1L;
private DynaFormModel model;
private List<String> documents;
public DynaFormController() {
model = new DynaFormModel();
documents = new ArrayList<>();
documents.add("First doc");
DynaFormRow row = model.createRegularRow();
row.addControl(row, "FileUpload");
}
public DynaFormModel getModel() {
return model;
}
public void setModel(DynaFormModel model) {
this.model = model;
}
public List<String> getDocuments() {
return documents;
}
public void setDocuments(List<String> documents) {
this.documents = documents;
}
}
Issue Analytics
- State:
- Created a year ago
- Comments:22 (15 by maintainers)
Top Results From Across the Web
3.0 - 3.7 - Dynaform Do's and Dont's - ProcessMaker Wiki
It is the component in charge of creating controls, building the responsive layout and connecting services to gather and handle form data. Architectural...
Read more >Using advanced data table features | Apache MyFaces 1.2 ...
In this case, the <t:dataTable> component will make every column in the table sortable. Unfortunately, this feature does not work if a Facelets...
Read more >dataTables HTML5 data-search cell attribute does not work
The HTML5 data-* attributes works if all cells in a column have the data-* attribute at the time the table is initialised. You...
Read more >Add validators in dynaform components - PrimeFaces forum
I can get validator rule name in outputText but when I set disabled=false in <f:validator > then I'm getting error : "javax.servlet.
Read more >Column width not working — DataTables forums
Hi I have read the other posts in the forum. Did not find solution.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
That is great to hear! I posted on the MyFaces users list asking for a release: https://lists.apache.org/list.html?users@myfaces.apache.org
I have also confirmed this is now fixed in Mojarra 2.3.18 and 4.0.