What event to use in <h: inputText> to cover all changes

I want to update the icon immediately while the user enters a value in <h: inputText>.

I have the following makup:

<h:inputText id="listprice" value="#{mybean.listPrice}"> <f:converter converterId="mybean.convertPrice"/> <a4j:ajax event="keyup" render="infoIcon" /> </h:inputText> 

Everything works fine if I really type value!

However, if I revise the page and start entering a value, my firefox offers me a list of values โ€‹โ€‹from my previous sessions to select, and now if I select one of these values โ€‹โ€‹with the mouse , I do not receive the event!

I understand this because in this case there is no keyboard. Therefore, I linked another event handler as follows:

 <h:inputText id="listprice" value="#{mybean.listPrice}"> <f:converter converterId="mybean.convertPrice"/> <a4j:ajax event="keyup" render="infoIcon" /> <a4j:ajax event="mouseout" render="infoIcon" /> </h:inputText> 

... and tied all kinds of events from "onchange, to onmouseout" without success.

So, how can I immediately cover up this โ€œbrowser-sugesstion-list select eventโ€?

+4
source share
2 answers

If you do not need values โ€‹โ€‹from previous user sessions, you can use the autocomplete = "off" attribute .

Otherwise, you can use the onmouseup event, it works for me.

+6
source

This may be a known bug, and a workaround is proposed here: http://forums.mozillazine.org/viewtopic.php?f=38&t=584166&start=0&st=0&sk=t&sd=a

Linked mail is very old and discusses Firefox v2, so there is a fair chance that it is no longer relevant, but if you have a chance to try the proposed workaround, you can tell us if this works or not.

+1
source

All Articles