This week's book giveaway is in the Other Languages forum.
We're giving away four copies of Functional Reactive Programming and have Stephen Blackheath and Anthony Jones on-line!
See this thread for details.
Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Command button click issue

 
Arun Sudharsanam
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • 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.
 
Arshad Sharief
Greenhorn
Posts: 14
Hibernate Java Spring
  • Mark post as helpful
  • send pies
  • 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.
 
Srikanth Madasu
Ranch Hand
Posts: 48
Eclipse IDE Hibernate Spring
  • Mark post as helpful
  • send pies
  • 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
 
Sergey Smirnov
Ranch Hand
Posts: 167
  • Mark post as helpful
  • send pies
  • 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 Java Spring
  • Mark post as helpful
  • send pies
  • 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.
 
Mahendra Pratap
Ranch Hand
Posts: 42
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • 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..
 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
  • 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 Java Spring
  • Mark post as helpful
  • send pies
  • 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 Java Spring
  • Mark post as helpful
  • send pies
  • 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)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic