Advertisement

09.17.2007 at 03:40AM PDT, ID: 22832781
[x]
Attachment Details

Default action on enter for JSF/Seam

Asked by tims in Java Server Faces (JSF), Java Programming Language, JavaScript

Tags: jsf, action, default, enter

I have a form with a commandButton but when the user hits the enter button in a text box, the page it reloaded.

I would like the default action to be the same as the commandButton.

I have tried <j4j:defaultAction /> but this does not seem to generate any javascript to forward to the required action.

Could some nice person point me in the direction of a solution to the default action on enter problem or help me with why the <j4j:defaultAction /> is not working?

Thanks, Tim

faces snip....
---------------------------------------------
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:c="http://java.sun.com/jstl/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:t="http://myfaces.apache.org/tomahawk"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:s="http://jboss.com/products/seam/taglib"
        xmlns:j4j="http://javascript4jsf.dev.java.net/">
        
  <body>
    <ui:composition template="/WEB-INF/template.xhtml">

...........
...........

                <h:commandButton action="#{jobFinder.performSearch}"
                                    style="vertical-align: middle;width: 89px; height: 33px; border: none; margin: 0px; padding: 0px"
                                    id="searchButton"
                                    value="Search"
                                    image="images/btn_search.jpg">

                          <j4j:defaultAction />
                         
                </h:commandButton>
...........
...........
---------------------------------------------
j4j.jar in WEB-INF/lib

JBoss Seam 1.1.0.GAStart Free Trial
[+][-]09.17.2007 at 03:47AM PDT, ID: 19903900

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09.17.2007 at 02:20PM PDT, ID: 19908510

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09.17.2007 at 10:21PM PDT, ID: 19910422

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09.18.2007 at 01:08AM PDT, ID: 19910959

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09.18.2007 at 02:39PM PDT, ID: 19916794

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09.18.2007 at 09:53PM PDT, ID: 19918427

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Java Server Faces (JSF), Java Programming Language, JavaScript
Tags: jsf, action, default, enter
Sign Up Now!
Solution Provided By: mnrz
Participating Experts: 2
Solution Grade: A
 
 
[+][-]10.22.2007 at 12:43PM PDT, ID: 20126217

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 7-day free trial to view this Administrative Comment or ask the Experts your question.

 
[+][-]10.24.2007 at 08:05AM PDT, ID: 20139603

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10.24.2007 at 10:07PM PDT, ID: 20145206

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.25.2007 at 10:38PM PDT, ID: 20153376

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 7-day free trial to view this Administrative Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_1_20070628