Invoke Rich Modal Panel Onclick

天涯浪子 提交于 2019-12-11 17:22:50

问题


I am using the following code for displaying dynamic image in rich DataTable. Onclick of the thumbnail I need to display Full Image fetched from different location.

But the second a4j:mediaOutput tag is fetching all the Full images and keeping in memory. (Ofcourse modalPanel is displayed on click only )

I want the second a4j:mediaOutput tag to call daImageRetrievalBean.retrieveFullImage only after click.

Please help.



回答1:


                            <h:outputLink value="#" id="link">
                            <a4j:mediaOutput element="img" cacheable="false" session="true" style="height:75px; width:75px;"
                                createContent="#{daImageRetrievalBean.retrieveThumbnail}" value="#{digAsset.digitalAssetId}" mimeType="image/jpeg" />
                            <rich:componentControl for="panel" attachTo="link" operation="show" event="onclick">
                            </rich:componentControl>
                        </h:outputLink>
                        <rich:modalPanel id="panel" resizeable="false" autosized="true" minHeight="650" minWidth="700">
                            <f:facet name="header">
                                <h:outputText value="#{digAsset.fileName}     Click on the image to hide" />
                            </f:facet>
                        <f:facet name="controls">
                            <h:panelGroup>
                                <a4j:mediaOutput element="img" cacheable="false" session="true" id="hidelink" style="height:600px; width:700px;margin-top: 30px"
                                            createContent="#{daImageRetrievalBean.retrieveFullImage}" value="#{digAsset.fileName}" mimeType="image/jpeg" />
                                <rich:componentControl for="panel" attachTo="hidelink" operation="hide" event="onclick"/>
                        </h:panelGroup>
                        </f:facet>                      
                        </rich:modalPanel>


来源:https://stackoverflow.com/questions/1142150/invoke-rich-modal-panel-onclick

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!