[英]JSF cannot update single form in ui:repeat from outside
我有兩個密切相關的問題:
我需要這樣做的原因:更新“批發清單”(當前情況)會以某種方式(沒有錯誤...)破壞<p:dialog>
內的所有<p:calendar>
(日歷覆蓋圖是第一次顯示,但是更新了列出它不再出現(必須再次重新加載頁面)。如果只更改一個元素,我也不想每次都更新100個元素
page.xhtml
<h:panelGroup id="wholelist">
<ui:repeat var="entry" value="#{bean.foundEntries}" id="repeatId">
<customTag:someTag entry="#{entry}" />
</ui:repeat>
</h:panelGroup>
...
<p:dialog widgetVar="dialog" id="dialog">
<p:calendar value="#{bean.date}" ... /> <!-- overlay pops up on select until the whole list is refreshed. after that it does not appear until page reload -->
<p:commandButton actionlistener="#{bean.saveSomething()}" update="#{bean.componentToUpdate WHICH DOES NOT WORK...}"/>
</p:dialog>
someTag.xhtml
並在<customTag:someTag>
(由於多次重用而成為標簽)內:
...
<h:form>
... display a lot of data which can be changed by the dialog...
<p:commandButton value="show edit dialog" onComplete="PF('dialog').show()" update=":dialog">
<f:setPropertyActionListener value="??? (@form does not work)" target="#{bean.componentToUpdate}" />
</p:commandButton>
</h:form>
第一個問題:
我需要從對話框中刷新一個表單(=該對話框需要知道要刷新的表單,我不知道該怎么做...)
以及如何使update-logic起作用(將組件傳遞給Bean以使對話框知道要更新或等於什么)?
第二個問題:
如果未在ui內的命名容器中定義id =“ ...”的情況下,JSF為何生成:重復類似
當我定義<h:form id="formname">
( <h:form id="formname">
)時,類似
哪個會導致重復的ID(因為名稱中缺少“迭代器編號”)?
這有意義嗎?
我已經解決了; 錯誤在其他地方:我忘記了一個包含在內的標記文件,該文件引起js警告(這破壞了日歷)。
非常感謝
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.