myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mike Kienenberger" <>
Subject Re: Problem with t:inputText in s:subForm
Date Mon, 26 Mar 2007 15:39:09 GMT
Why do you expect enter to submit the form correctly?

It sounds like your browser has some specific behavior that when a
one-field input text receives an enter event that it triggers a form
submit.   That's not going to work well as it'll probably end up
skipping all of the submit-related javascript.

My recommendation would be to add a sandbox:submitOnEvent child to
your inputText so that you explicitly trap the event and do the right
thing rather than hoping the browser will guess the correct action to

On 3/26/07, Alexander Herrmann <> wrote:
> Howdy,
> I'm using a subform within my application. It contains an input text
> field as well as a submit button. Submitting per submit button works
> fine. But when the input text field is empty and I hit enter while
> focused on it a wrong action is performed.
> How can I solve this?
> <s:subForm id="searchForm">
>   <t:inputText value="#{SearchBean.searchString}" size="30"
> style="vertical-align: top; margin-top:0px; border:1px solid black;
> height:13px;" />
>   <t:commandLink action="#{SearchBean.doSearch}" type="submit" >
>     <f:verbatim>
>       <img class="menuImage" style="margin-left: 10px; float:none;"
> src="img/search.png" />
>     </f:verbatim>
>     <h:outputText value="#{messages['search.product']}" />
>   </t:commandLink>
> </s:subForm>

View raw message