Hi,

 

I know what you mean. 

Your first solution: We do not use trinidat. 

The second solution: There is a strange behavior in our pages: The method
“blah” is used but a server request is executed anyway.

We have a combination of ajax- and tomahawk-buttons and the enter-command
executes the first occurring tomahawk-commandbutton (ajax-buttons are
ignored).

 

In my understanding the server request should not be happened. Is this
correct?

Thanks 

Peter


-----Ursprüngliche Nachricht-----
Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Im Auftrag von
Matthias Wessendorf
Gesendet: Freitag, 21. Dezember 2007 12:50
An: MyFaces Discussion
Betreff: Re: return event in text fields

In Trinidad, the form has a defaultCommand attribute.
You can specify a id of a link/button and on ENTER the form would be
submitted.
If not set, nothing happens on enter.

Not tried...,
but just an idea.

Is it possible to say
<h:form ........ onkeypress="blah(event);"">

and a little JS-script, like:

function blah(event)
{

if(event.keyCode == 13)
  return false;
}

On Dec 21, 2007 11:32 AM, Peter Dahm <[EMAIL PROTECTED]> wrote:
>
> Hello,
>
> we have this code sniplet in our page. This forces an event, if the value
of
> the textfield changes.
>
> <t:inputText styleClass="textfield" style="width:100%"
>       value="#{directReportOverviewBean.filterNameAsString}"
>
valueChangeListener="#{directReportOverviewBean.filterNameValueChange}">
>
>       <a4j:support event="onchange" reRender="tblUebersicht" />
>
> </t:inputText>
>
>
> Know we have the need to force the same event on submitting the textfield
> with the enter button. Unfortunately the current effect is, that one of
the
> buttons gets the submit event.
>
> Does someone of you have an idea to solve this problem ?
>
> Peter
>
>
>
>
>



-- 
Matthias Wessendorf

further stuff:
blog: http://matthiaswessendorf.wordpress.com/
sessions: http://www.slideshare.net/mwessendorf
mail: matzew-at-apache-dot-org


Reply via email to