The best place to ask programming/development questions, imo. UPDATE: stackoverflow is the *worst* place to *ask* questions (if your first question/comment doesn't get any up-rating/response, then u can't ask anymore questions--ridiculously unrealistic), but a great reference for finding answers.

My Music (Nickleus)

20111128

richfaces rich hotkey backspace navigation disabling not working with oncomplete [SOLVED]

in my post richfaces rich hotkey backspace navigation disabling not working [SOLVED] i showed how to get the rich hotkey working by changing oncomplete to onclick, but what if you need oncomplete?

the hack i found to work was to set the focus to somewhere in the panel after the a4j:commandLink link was clicked.



<a4j:commandLink
value="#{detail.action}"
id="editlink"
ajaxSingle="true"
action="#{myBean.myAction}"
reRender="detailsPanel"
rendered="#{detail.actionEdit and myBean.isBuyer}"
oncomplete="if (#{facesContext.maximumSeverity==null}) #{rich:component('detailsPanel')}.show();#{rich:element('CDD_quatityInput')}.focus();">
<f:setPropertyActionListener
value="#{detail}"
target="#{myBean.currentDtlItem}" />
<f:setPropertyActionListener
value="#{row}"
target="#{myBean.currentRow}" />
</a4j:commandLink>
CDD_quatityInput is the id of an element in the panel i am showing when the link is clicked.

i saw an example today where the author also put "event.stopPropagation(); event.preventDefault();" into the handler attribute, but i havent seen the need for it yet.

No comments:

Post a Comment