Webflow、JSF、Primefaces:为什么此列表为空?
我的网络流中有四个列表,是从服务层加载的。 它们看起来像这样:
<evaluate expression="partyService.getPostalAddresses()" result="viewScope.uiPostalAddresses"
result-type="java.util.ArrayList" />
在我的 JSF/Primefaces UI 中,我有这样的:
<p:dataTable id="partyAddressTable" widgetVar="partyAddressTable"
var="address" value="#{viewScope.uiPostalAddresses}" style="width:100%;"
rows="#{msg.parties_address_table_rows}" styleClass="partyAddressTable"
paginator="#{msg.parties_address_table_paginator}"
paginatorPosition="#{msg.parties_address_table_paginatorPosition}"
paginatorTemplate="#{msg.parties_address_table_paginatorTemplate}"
lazy="#{msg.parties_address_table_lazy}" selectionMode="single"
selection="#{viewScope.selectedItem}"
scrollable="#{msg.parties_address_table_scrollable}">
[...]
</p:dataTable>
当我打开页面时,webflow 加载列表并且 JSF/Primefaces 正确显示它。 然后,如果我按下“addEntry”按钮,列表中的条目将全部消失。我看到 webflow 正在正确地将一个条目添加到列表中。
Webflow“addEntry”-Snippet:
<transition on="addPostal">
<evaluate expression="uiPostalAddresses.add(personService.getEmptyPostalAddress())" />
</transition>
这一切都发生在相同的视图状态中,整个应用程序在 Liferay 上的 Portlet 中运行。
我不知道问题出在哪里。请你帮助我好吗?
我正在使用:
- JSF:1.2
- Primefaces:1.1
- Webflow:2.3
- Portlet:2.0 --> JSR286
- Liferay: 6.0.6
I have four lists in my webflow, which I load from my service layer.
They look like this one:
<evaluate expression="partyService.getPostalAddresses()" result="viewScope.uiPostalAddresses"
result-type="java.util.ArrayList" />
In my JSF/Primefaces UI, I have this:
<p:dataTable id="partyAddressTable" widgetVar="partyAddressTable"
var="address" value="#{viewScope.uiPostalAddresses}" style="width:100%;"
rows="#{msg.parties_address_table_rows}" styleClass="partyAddressTable"
paginator="#{msg.parties_address_table_paginator}"
paginatorPosition="#{msg.parties_address_table_paginatorPosition}"
paginatorTemplate="#{msg.parties_address_table_paginatorTemplate}"
lazy="#{msg.parties_address_table_lazy}" selectionMode="single"
selection="#{viewScope.selectedItem}"
scrollable="#{msg.parties_address_table_scrollable}">
[...]
</p:dataTable>
When I open my page, webflow loads the list and JSF/Primefaces shows it correctly.
And then, if I press my "addEntry"-Button, the entries in the list all disappear. I saw that webflow is adding one entry to the list correctly.
Webflow "addEntry"-Snippet:
<transition on="addPostal">
<evaluate expression="uiPostalAddresses.add(personService.getEmptyPostalAddress())" />
</transition>
It all happens in the same view-state and the whole application is running in a Portlet on Liferay.
I have no more idea what the problem could be. Could you please help me?
I'm using:
- JSF: 1.2
- Primefaces: 1.1
- Webflow: 2.3
- Portlet: 2.0 --> JSR286
- Liferay:
6.0.6
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我终于找到了解决方案。
我研究了指向 uiPostalAddresses 的指针,如果我清除 party 上的列表并将 All 添加到 party,则列表为空。
所以那是我的错;-)
I finally found the solution.
I worked on a pointer to uiPostalAddresses and if I clear the list on party and addAll to party, the list is empty.
So that was my fault ;-)