在 hiddenInput 的 valueChange 之后渲染一个 panelGroup
Render a panelGroup after a valueChange of a hiddenInput
我想在隐藏输入的 valueChange 之后呈现 <h:panelGroup>
:
<h:inputHidden id="code" valueChangeListener="bean.myFunc()" />
...
<h:panelGroup id="block">...</h:panelGroup>
我该怎么做?我无法在 <h:inputHidden>
中添加 <f:ajax>
,因为它是一个非 ClientBehaviorHolder 父级。
谢谢!
您可以使用 PartialViewContext
将其添加到要从服务器端呈现的组件列表中,在 myFunc()
内
FacesContext cxt = FacesContext.getInstance();
PartialViewContext partialCtxt = ctxt.getPartialViewContext();
partialCtxt.getRenderIds.add("block"); //adds the block to the list of items to be ajax-rendered
我想在隐藏输入的 valueChange 之后呈现 <h:panelGroup>
:
<h:inputHidden id="code" valueChangeListener="bean.myFunc()" />
...
<h:panelGroup id="block">...</h:panelGroup>
我该怎么做?我无法在 <h:inputHidden>
中添加 <f:ajax>
,因为它是一个非 ClientBehaviorHolder 父级。
谢谢!
您可以使用 PartialViewContext
myFunc()
内
FacesContext cxt = FacesContext.getInstance();
PartialViewContext partialCtxt = ctxt.getPartialViewContext();
partialCtxt.getRenderIds.add("block"); //adds the block to the list of items to be ajax-rendered