You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Peter Dahm <pd...@itsd-consulting.de> on 2007/12/21 11:32:42 UTC

return event in text fields

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
 




AW: return event in text fields

Posted by Peter Dahm <pd...@itsd-consulting.de>.
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: mwessendorf@gmail.com [mailto:mwessendorf@gmail.com] 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 <pd...@itsd-consulting.de> 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



Re: return event in text fields

Posted by Matthias Wessendorf <ma...@apache.org>.
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 <pd...@itsd-consulting.de> 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