Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within JSF
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Jeanne Boyarsky
Ron McLeod
Paul Clapham
Liutauras Vilda
Sheriffs:
paul wheaton
Rob Spoor
Devaka Cooray
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Carey Brown
Frits Walraven
Tim Moores
Bartenders:
Mikalai Zaikin
Forum:
JSF
submit only with inputText and without valueChangeListener
Jana Wetzel
Greenhorn
Posts: 4
posted 15 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hello everybody,
i need some help for a problem I can't solved.
To submit a formular I can only used an inputText because of a barcode scanner. I start with the following code
<h:inputText id="inputField" value="#{inputHandler.inputField}" valueChangeListener="#{inputHandler.processValueChange}" onchange="submit();"> <h:outputLabel for="inputField" value="Barcode-Scan: " /> </h:inputText>
This code is working but I don't need a valueChangeListener. An ActionListener would be better, because I need every input also twice the same.
The element inputText don't offer an actionListener, so what can I do?
Can someone help me, please?
Bye Jana
Bauke Scholtz
Ranch Hand
Posts: 2458
posted 15 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Because it is just an input element, not some action element.
Add a h:commandButton to the form and specify the actionListener in there.
Jana Wetzel
Greenhorn
Posts: 4
posted 15 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hello Bauke,
That's the problem. I can't use a button because I have only a barcode scanner as input. No mouse, no keyboard.
Does a solution exist without button or commandLink?
Thanks for your help.
Bye Jana
Bauke Scholtz
Ranch Hand
Posts: 2458
posted 15 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Well, continue misusing the valueChangeEvent then. That's the easiest way.
If you want the event to happen during the invoke application phase, so that it would behave like during actionListener, then you need to queue the event.
Something like
if (event.getPhaseId() != PhaseId.INVOKE_APPLICATION)) { event.setPhaseId(PhaseId.INVOKE_APPLICATION); event.queue(); } else { // Do your thing here. }
Jana Wetzel
Greenhorn
Posts: 4
posted 15 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hello Bauke,
i misused the commandButton now
<h:commandButton value="submit" action="#{inputHandler.processValueChange}" type="submit" style="display: none"/>
Now the inputText do what I want.
Thanks for your help.
Bye Jana
When I was younger I felt like a man trapped inside a woman’s body. Then I was born. My twin is a tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Loosing focus on a inputText box?
jsf ajax rerender inputText
question for h:inputText with struts tile 1.1
JSF ValueChange problems and Default method where the form submits to
valueChangeListener
More...