jsf 2 - JSF - Two Questions about actions on UIComponent -


so, let me show troubles :)

1 - when click on commandbutton

<h:commandbutton value="somethings">     <f:setpropertyactionlistener target="#{bean.method}" value="some" />     <f:ajax render="rendering"/> </h:commandbutton> 

i dont action commandbutton. fire ajax call. if add action on button (like action="bean.myaction) executedat 5° phase of jsf lifecycle (allright, if write event="action" in f:ajax, thats default). right? f:ajax fired cliccing on button default? because listbox example, it's fired if write event="change" (the same, shouldnt write it, because default).

2 - when click on image

<h:graphicimage value="img/img.png" alt="img">     <f:setpropertyactionlistener target="#{bean.method}" value="some" />     <f:ajax event="onclick" render="rendering"/> </h:graphicimage> 

this doesnt work. why?

as usual, help!!!!

1 - when click on commandbutton

i dont action commandbutton. fire ajax call. if add action on button (like action="bean.myaction) executedat 5° phase of jsf lifecycle

the f:setpropertyactionlistener executed in 5th phase well.

(allright, if write event="action" in f:ajax, thats default). right? f:ajax fired cliccing on button default? because listbox example, it's fired if write event="change" (the same, shouldnt write it, because default).

the f:ajax changes behaviour synchronous submit asynchronous (partial) submit. generating additional javascript code desired event attribute of parent component (e.g. onclick, onchange, etc, in generated html output in webbrowser). doesn't change in jsf lifecycle. rendered response partial response part updated in component(s) id definied in render attribute.


2 - when click on image

this doesnt work. why?

because h:graphicimage not support f:setpropertyactionlistener @ all. works in uicommand components.

you want wrap in h:commandlink instead.

<h:commandlink>     <f:setpropertyactionlistener target="#{bean.method}" value="some" />     <f:ajax event="action" render="rendering"/>     <h:graphicimage value="img/img.png" alt="img"/> </h:commandlink> 

(and if necessary style border/underline caused generated <a> element away css)


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -