【发布时间】:2011-04-03 19:21:41
【问题描述】:
我有一个要求,在单击图像时,我需要在模态面板上显示更大尺寸的相同图像。
为此,我所做的是将图像位置作为 f:param 传递给模态面板,然后在图像标签中使用传递的参数。
但不知何故,我无法获得我传递的参数的值。
代码如下:
这就是我激活 modalPanel 以及使用 f:param 传递参数的方式
<h:graphicImage value="../images/DSCN0965.JPG" height="50" width="50" styleClass="iconClass">
<rich:componentControl for="imagePanel" operation="show" event="onclick">
<f:param value="../images/DSCN0965.JPG" name="imagePath"/>
</rich:componentControl>
</h:graphicImage>
这是模态面板代码以及我如何尝试在此处获取 f:param 值...
<rich:modalPanel id="imagePanel" width="600" height="600">
<f:facet name="header">
<h:panelGroup>
<h:outputText value="Image"></h:outputText>
</h:panelGroup>
</f:facet>
<f:facet name="controls">
<h:panelGroup>
<h:graphicImage value="../images/closeIcon.GIF" styleClass="iconClass" id="closeImageLink"/>
<rich:componentControl for="imagePanel" attachTo="closeImageLink" operation="hide" event="onclick"/>
</h:panelGroup>
</f:facet>
<h:outputLabel value="#{imagePath}"/>
<h:graphicImage value="{imagePath}" height="400" width="500" styleClass="iconClass"/>
</rich:modalPanel>
你能告诉我如何访问传递的参数值吗?
问候,
萨提亚
【问题讨论】:
标签: javascript jsf richfaces