• 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

Command button click issue

 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

I have an issue when submitting the form using commandbutton.

When the control is within a textbox and I click the command button the form does not gets submitted. But when I press tab and then click the button it gets submitted.

Can anyone provide a solution to overcome this problem.

I am using JSF 1.2 with Trinidad faces.
 
Greenhorn
Posts: 14
Hibernate Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When the control is within a textbox and I click the command button

I believe that you are pressing enter key when control is within textbox, jsf does not support this. you have to use javascript to achieve it.


Arshad.
 
Ranch Hand
Posts: 50
Hibernate Eclipse IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Arshad, You can do it in JSF without using goofy javascript. All you need to do is use attribute type="submit" for your commandButton.

-Srik
 
Ranch Hand
Posts: 167
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Srik Messmer:
Arshad, You can do it in JSF without using goofy javascript. All you need to do is use attribute type="submit" for your commandButton.

-Srik



The final behavior will be vary depends of the number of fields and browser type.
 
Arshad Sharief
Greenhorn
Posts: 14
Hibernate Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks srik, Iam using oracle adf commandButton which does not have an attribute of 'type'.

I might try to test how jsf commandButton behaves.


Arshad.
 
Ranch Hand
Posts: 42
Eclipse IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
sorry guys, i am also facing this same problem.

If anyone can help me the please do. when i am pressing enter while on textField then the same page is getting refresh but if i click on Submit button then it is giving me desired output.

it is working fine in FF and creating problem in IE.

adding type="submit" attribute is not working..
 
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please start a new topic instead of resurrecting an old and dead one.
Feel free to link the relevant topics in your new topic.
 
Mahendra Pratap
Ranch Hand
Posts: 42
Eclipse IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hello Bauke Scholtz thanks for your reply..

i just resurrected this thread because my problem is same as the creator of this thread. i just thought that starting a new duplicate thread will not be good.

but ok from now onwards i will take care of this sort of issues. do i need to create a new thread now or it is fine for this time.
 
Mahendra Pratap
Ranch Hand
Posts: 42
Eclipse IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks guys ..

i solved this problem by adding

<f:verbatim>
<input type="text" name="xyz" style="display: none;">
</f:verbatim>

just below <h:form> tag

now it is working fine with IE too...

and this problem exists only if you have only 1 input field(i.e. textField, textArea etc)
 
Ruth Stout was famous for gardening naked. Just like this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic