jsf - ui:repeat with a list sending right object to a p:dialog -


i have giant ui:repeat. within ui:repeat, of repeated objects have url popup image associated them. when clicks display under particular object, need url popup in p:dialog.

<ui:repeat var="thing" value="#{bean.thinglist}">     <p:commandlink value="details" onclick="miniimage.show();"      update=":#{p:component('chart')}"     action="#{bean.setcurrentimg(thing.imageurl)}"      rendered="#{thing.includeimage}"> </p:commandlink> </ui:repeat> 

and @ bottom of page:

<p:dialog id="chart" widgetvar="miniimage" >     <h:graphicimage value="#{bean.currentimg}"/> </p:dialog> 

and in backing bean tried using simple setter , getter currentimg.

i bit confused on , accomplish without having submit entire form well. appreciated.

if you're using primefaces 3.3 or newer, add partialsubmit="true" command component. can control to-be-processed components in process attribute. in particular case, current component (the command component itself) sufficient, process="@this":

<p:commandlink ... process="@this" partialsubmit="true" /> 

this way request parameters necessary process sent.


unrelated concrete problem, suggest use oncomplete instead of onclick open dialog. otherwise dialog opened before update takes place , may cause poor user experience enduser see image instantly changing.


Comments

Popular posts from this blog

css - Which browser returns the correct result for getBoundingClientRect of an SVG element? -

gcc - Calling fftR4() in c from assembly -

Function that returns a formatted array in VBA -