命令爲什麼以下工作:號碼:內部轉盤
<h:form id="form1">
<p:carousel id="carousel" value="#{galleriaBean.paths_tn}" var="img" itemStyle="width: 200px">
<p:graphicImage value="#{img}"/>
</p:carousel>
<p:commandLink id="here" value="click me" update="hello11" oncomplete="dlg.show()">
<f:setPropertyActionListener value="hello!!!" target="#{galleriaBean.selected}"/>
</p:commandLink>
<p:dialog widgetVar="dlg">
<h:outputText id="hello11" value="#{galleriaBean.selected}"/>
</p:dialog>
</h:form>
但移動commandLink進入旋轉木馬,它不工作? setPropertyActionListener甚至沒有在bean中設置變量。
@RequestScoped CDI Bean。
<p:carousel id="carousel" value="#{galleriaBean.paths_tn}" var="img" itemStyle="width: 200px">
<p:graphicImage value="#{img}"/>
<p:commandLink id="here" value="click me" update=":form1:hello11" oncomplete="dlg.show()">
<f:setPropertyActionListener value="#{img}" target="#{galleriaBean.selected}"/>
</p:commandLink>
</p:carousel>
你的支持bean的範圍是什麼? – partlov
@RequestedScope – jacktrades
嘗試@ViewScope,看看發生了什麼。 – partlov