我们有一个更新动态包含的ajax导航菜单.包含文件各有各自的表单.
<h:form>
<h:commandButton value="Add" action="#{navigator.setUrl('AddUser')}">
<f:ajax render=":propertiesArea" />
</h:commandButton>
</h:form>
<h:panelGroup id="propertiesArea" layout="block">
<ui:include src="#{navigator.selectedLevel.url}" />
</h:panelGroup>
Run Code Online (Sandbox Code Playgroud)
它工作正常,但包含文件中的任何命令按钮在第一次单击时都不起作用.它仅适用于第二次点击.
我发现这个问题commandButton/commandLink/ajax动作/监听器方法没有被调用或输入值没有更新,我的问题在第9点描述.我明白我需要明确地包含在解决它的包<h:form>
中的ID <f:ajax render>
.
<f:ajax render=":propertiesArea :propertiesArea:someFormId" />
Run Code Online (Sandbox Code Playgroud)
但是,在我的情况下,表单ID事先是未知的.此表格最初也不会在上下文中提供.
上述方案有什么解决方案吗?