Hello Team-Dev Support
During the evaluation of your QuipuKit components we noticed some strange behavior.
We have the following View:
+ <ui:repeat var="datalogger" value="#{m_Facility.dataloggers}">+ <h:form> <q:dataTable var="node" value="#{datalogger.nodes}" width="100%" applyDefaultStyle="false" styleClass="data_table" headerSectionClass="data_header" bodyRowClass="data_row" bodyOddRowClass="data_row_tainted"> <f:facet name="noDataMessage"> <h:outputText value="#{q_msg.f_mes_noDevices}" /> </f:facet> <q:column> <f:facet name="header"> <h:outputText value="#{q_msg.f_netId}" /> </f:facet> <h:outputText value="#{node.networkAddress}" /> </q:column> <q:column> <f:facet name="header"> <h:outputText value="#{q_msg.f_retentionTime}" /> </f:facet> <h:outputText value="#{deviceAction.calcDuration(node)}" /> </q:column> </q:dataTable> </h:form> </ui:repeat>
At the method call deviceAction.calcDuration(node) I pass a node object.
If I debug calcDuration(Device node) my node object is null!
I found two solutions for which the passing will work:
I use a h:dataTable instead of the q:dataTable
I use the q:dataTable in a nested c:forEach
In this situation, I can't work with nested c:forEach loops!
Do I understand something wrong, that sould be possible, or not?
Is it possible to pass objects inside a dataTable?
Thanks for helping
Daniel
PS: We use JBoss AS 4.2.2 and JBoss Seam 2.0.1
Hello Daniel,
Please, provide us with the following info:
- Your page (JSP or XHTML)
- Backing bean
- Scenario to reproduce the problem
- QuipuKit version
- JSF implementation and version
- Your web.xml file
Also it would be great if you can send us war-file that contains the reproducing example.
Regards,
Darya
Hello Darya
Infos about our platform:
JBoss AS 4.2.2
JBoss Seam 2.0.1
Richfaces Ajax-Support Components
QuipuKit 1.4.2
JSF/Facelets Implementation
I added you three page files as example:
facility_work.xhtml / This example works, call is within a h:dataTable (line number 99)
facility_notwork.xhtml / This example doesn't work, call is within a q:dataTable (line number 117)
device_work.xhtml / This example works, call is within a q:dataTable (line number 153)
I also noticed, that object passing with a h:commandLink works, but not with a seam s:link!
Thank you for helping
Regards Daniel
Hello Daniel,
We tried to reproduce the problem using the ear-file you have provided, but unfortunately we couldn't run the ear file as is. It couldn't start because of some database issues. Nevertheless we've been able to create a separate sample page right in your application. This page contains a q:dataTable component inside of ui:repeat iterator, and passing parameters in EL expressions inside of this table works fine. We've also checked this use case in other applications having similar configurations, but haven't succeeded with reproducing the problem. You can find the test page and the backing bean that it uses in the attachment. Please try this page on your side and confirm that it works for you as well. Please also confirm that it demonstrates the use case that you were having a problem with.
If you still cannot resolve the problem using this sample, please try to localize the problem and create the simplest possible application without the database that demonstrates this problem. Please send us the ear-file with this localized example. This way we'll be able to reproduce and investigate the problem effectively.
Regards,
Dmitry
P.S. The problem with s:link is a known issue (see the list of known issues). The fix for this issue will most probably be included in the nearest release, which will preliminary be available in a month.
Hello Dmitry
Unfortunately I don't get your example to work.
But I'm now able to reproduce the problem.
If I call a method with a variable passing in the q:dataTable component I have two scenarios:
1. (this doesn't work)
<q:dataTable var="node" value="#{datalogger.nodes}" width="100%" applyDefaultStyle="false"
styleClass="data_table" headerSectionClass="data_header" bodyRowClass="data_row" bodyOddRowClass="data_row_tainted">
<q:column>
<f:facet name="header">
<h:outputText value="#{q_msg.f_retentionTime}" />
</f:facet>
<h:outputText value="#{deviceAction.calcDuration(node)}" />
</q:column>
</q:dataTable>
2. (this work)
<q:dataTable var="node" value="#{datalogger.nodes}" width="100%" applyDefaultStyle="false"
styleClass="data_table" headerSectionClass="data_header" bodyRowClass="data_row" bodyOddRowClass="data_row_tainted">
<q:column>
<f:facet name="header">
<h:outputText value="#{q_msg.f_retentionTime}" />
</f:facet>
#{deviceAction.calcDuration(node)}
</q:column>
</q:dataTable>
So if we look at this examples we see, that a call within <h:outputText /> doesn't work while a plain call like #{deviceAction.calcDuration(node)} works.
I don't know if this is a JBoss Seam related problem but with Seam I don't need to use <h:outputText /> to write text to the view since I can make it directly.
Hello Daniel,
I have just tried using a method call expression inside of <h:outputText> component instead of just plain method binding expression, and it worked fine both in our testing application, and in the war file that you have provided. Note that I've only tried the modified version of a test page that I have attached in my previous post. So there must be some other specifics that causes this behavior.
Please tell if you still need help with resolving this problem.
Regards,
Dmitry
Hello Daniel,
We've fixed the issue with JBoss Seam's s:link component and the fix is available in QuipuKit 1.4.3.
Regards,
Tatyana