A friendly place for programming greenhorns!
Big Moose Saloon
Search
|
Java FAQ
|
Recent Topics
Register / Login
Win a copy of
Arduino in Action
this week in the
General Computing
forum!
A special promo:
Enter your blog post or vote on a blogger to be featured in an upcoming Journal
JavaRanch
»
Java Forums
»
Java
»
JSF
Author
command button issue
lynn fann
Ranch Hand
Joined: Oct 15, 2006
Posts: 115
posted
Apr 08, 2009 02:28:05
0
I cant get the command button to be rendered as normal button. I have try to set type="button", but when it is rendered out, in html is type="submit".
i need the button to be type button as i need to trigger javascript when onclick.
Im using jsf 1.2.
Anyway to overcome this issue.?
-thanks
Dominik Scholz
Greenhorn
Joined: Mar 30, 2009
Posts: 8
posted
Apr 08, 2009 04:33:37
0
<html> <head> <title>someHTML</title> <script type="text/javascript"> function doThings() { // do things } </script> </head> <body> <h:commandButton value="Do it!" action="doThings()"/> </body> </html>
does this help you?
Bauke Scholtz
Ranch Hand
Joined: Oct 08, 2006
Posts: 2458
posted
Apr 08, 2009 05:44:37
0
No, not that way.
<h:commandButton value="Execute JS" onclick="doThings(); return false;" />
Code depot of a Java EE / JSF developer
|
JSF / Eclipse / Tomcat kickoff tutorial
|
DAO kickoff tutorial
|
I ♥ Unicode
I agree. Here's the link:
http://aspose.com/file-tools
subject: command button issue
Similar Threads
dataTable problem
action method not invoked
Enter key
JSF : Differenc e between attribute and property of a component
commandbutton inside panelgroup dont work
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter