he all,
thanks for your fast replies. but i think this is going in the wrong direction.
i just want to realize that if someone fills in a string into this input text
and presses return
<h:inputText id="username"value="#{myBean.userName}"
onKeyPress="if(event.keyCode == 13)
document.getElementsByName('selectbutton').doclick();"/>
the t:commandbutton
<t:commandButton id="selectbutton" name="selectbutton"
action="#{myBean.select}" value="#{msg['action.select.label']}"
title="#{msg['action.select.tooltip']}" />
is pressed as the user would do.
sorry but cant do anything you proposed.
ben
On Tue, 22 May 2007 08:23:28 -0400, William Hoover wrote
> I think he ment to say:
>
> Internet Expolder:
> myInputObj.click();
>
> Firefox:
> HTMLElement.prototype.click = function() {
> var evt = this.ownerDocument.createEvent('MouseEvents');
> evt.initMouseEvent('click', true, true, this.ownerDocument.defaultView,
> 1, 0, 0, 0, 0, false, false, false, false, 0, null);
> this.dispatchEvent(evt);
> }
>
> -----Original Message-----
> From: Benjamin Bratkus [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, May 22, 2007 8:15 AM
> To: MyFaces Discussion
> Subject: Re: howto click a t:commandbutton via js
>
> i guess you mean the x_onClick() for the submit button ? or do you mean i
> have to write my own method ?
>
> ben
>
> p.s. the x_onClick does not work...
>
> On Tue, 22 May 2007 14:51:30 +0300, Ayhan Güngör wrote
> > try
> > ...
> > document.getElementsByName('selectbutton').x_x_onClick();"/>
> > ...
> >
> > On 5/22/07, Benjamin Bratkus <[EMAIL PROTECTED]> wrote:hi folks,
> >
> > actually i am fighting with my different browsers :P so for firefox 1.x and
> > 2.x my app works fine but the same side within ie6 do not work.
> >
> > means i fill in in a h:inputText a string and press return and i got the
> > next
> > view by using the button under the inpuText
> >
> > ie ignores me :9
> >
> > so i thought about something like :
> >
> > <div>
> > <label for="username">#{msg['add.byusername']} </label>
> > <h:inputText id="username"value="#{myBean.userName}"
> > x_x_onKeyPress="if(event.keyCode == 13)
> > document.getElementsByName('selectbutton').doclick();"/>
> > <!-- get the select button and press it ? ->
> > </div>
> > <div class="indent-large">
> > <ul class="buttons">
> > <li class="select">
> > <t:commandButton id="selectbutton" name="selectbutton"
> > action="#{myBean.select}" value="#{msg['action.select.label']}"
> > title="#{msg['action.select.tooltip']}" />
> > </li>
> > <li class="cancel">
> > <t:commandButton action="#{ myBean.cancel}" immediate="true"
> > value="#{msg['action.cancel.label']}"
> > title="#{msg['action.cancel.tooltip']}" />
> > </li>
> > </ul>
> > </div>
> >
> > question : how can i press the select button via a js function ?
> >
> > best regards,
> >
> > ben
> >
> >
>
> Viele Grüße, best regards,
>
> Benjamin Bratkus
> --
> Orientation in Objects GmbH
> Weinheimer Str. 68
> D-68309 Mannheim
> http://www.oio.de
> Tel. +49(0)621-71839-0
> Fax +49(0)621-71839-50
>
> Amtsgericht Mannheim
> HRB 38348
>
>
Viele Grüße, best regards,
Benjamin Bratkus
--
Orientation in Objects GmbH
Weinheimer Str. 68
D-68309 Mannheim
http://www.oio.de
Tel. +49(0)621-71839-0
Fax +49(0)621-71839-50
Amtsgericht Mannheim
HRB 38348