Open modalPanel with a parameter
I'd like to have modal panel in a page, but I would like to be able to supply a parameter开发者_运维问答. Now I do it like this:
Panel:
<rich:modalPanel id="panel" width="500" height="435">
...
[#{bean.tempId}]
</rich:modalPanel>
button to open panel:
<ui:repeat ... var="item">
<h:form>
<a4j:commandLink id="link" oncomplete="Richfaces.showModalPanel('panel');" reRender="panel">
<f:setPropertyActionListener value="#{item.id}" target="#{bean.tempId}"></f:setPropertyActionListener>
text...
</a4j:commandLink>
</h:form>
</ui:repeat>
This doesn't seem to be the best approach. What would be a better one?
In case you don't want it to go to the server, it is not so much JSF related. in oncomplete
you can assign the value to a javascript variable and use that variable in the panel.
精彩评论