This content has been marked as final.
Show 3 replies
-
1. Re: ModalPanel rerender
mail.micke Jul 28, 2008 12:37 PM (in response to ashsneider)Not sure this is a good idea or works (just typed it in here) but it should get you started.
You just need to save the current index of the image you are showing in your backing bean (which should be PAGE scoped) and increment and decrement that value.
In the dataGrid
<a4j:commandLink value="Show" action="#{backing.setImageIndex(varItem)}" reRender="theImage" oncomplete="#{rich:component('modalPanel')}.show();""/>
In the modal panel
<h:graphicImage id="theImage" value="#{backing.currentImage}"/> <a4j:commandLink value="Prev" action="#{backing.prevImage}" reRender="theImage"/> <a4j:commandLink value="Next" action="#{backing.nextImage}" reRender="theImage"/>
In the backing bean
public void setImageIndex(final String imageStr){ imageIndex = imageList.indexOf(imageStr); } public String getCurrentImage(){ return imageList.get(imageIndex); } public void nextImage(){ imageIndex++; }
-
2. Re: ModalPanel rerender
ashsneider Jul 28, 2008 3:44 PM (in response to ashsneider)Thank you, Mikael Andersson.
Indeed, it helped me get started, and I managed to solve the problem.
-
3. Re: ModalPanel rerender
kukeltje.ronald.jbpm.org Jul 28, 2008 10:47 PM (in response to ashsneider)Would be a nice example to put in the wiki somewhere if you'd care to share it with us