You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Hubert Rabago <hr...@gmail.com> on 2006/04/29 01:07:04 UTC

Emulation of the action link being clicked

I was looking at the sample application in
http://www.jsftutorials.net/interface/jsf-popup.html.

In it, the author has this form:

<h:form id="placeList">
    <h:commandLink id="find" action="showPlace" value=""/>
</h:form>

He has some Javascript that essentially sets the value of the command
link equal to its id before submitting the form, also through
javascript:
  form['placeList:find'].value = 'placeList:find';

with a comment that states "This is an emulation of the action link
being clicked."

Where is this fact documented?  I tried looking for it in the spec but
couldn't find it.

thanks,
Hubert

Re: Emulation of the action link being clicked

Posted by Andrew Robinson <an...@gmail.com>.
I use another method. Using CSS, I add a hidden link, then using
javascript, I invoke a mouse click event on the link to cause it to
submit. It behaves just as if the user clicked the link. I posted the
code on a past thread.

On 5/5/06, Hubert Rabago <hr...@gmail.com> wrote:
> Anyone?
>
> On 4/28/06, Hubert Rabago <hr...@gmail.com> wrote:
> > I was looking at the sample application in
> http://www.jsftutorials.net/interface/jsf-popup.html.
>
> In it, the author has this form:
>
> <h:form id="placeList">
>     <h:commandLink id="find" action="showPlace" value=""/>
> </h:form>
>
> He has some Javascript that essentially sets the value of the command
> link equal to its id before submitting the form:
>   form['placeList:find'].value = 'placeList:find';
>
> with a comment that states "This is an emulation of the action link
> being clicked."
>
> Where is this fact documented?  I tried looking for it in the spec but
> couldn't find it.
>
> thanks,
> Hubert
>

Re: Emulation of the action link being clicked

Posted by Hubert Rabago <hr...@gmail.com>.
Anyone?

On 4/28/06, Hubert Rabago <hr...@gmail.com> wrote:
> I was looking at the sample application in
http://www.jsftutorials.net/interface/jsf-popup.html.

In it, the author has this form:

<h:form id="placeList">
    <h:commandLink id="find" action="showPlace" value=""/>
</h:form>

He has some Javascript that essentially sets the value of the command
link equal to its id before submitting the form:
  form['placeList:find'].value = 'placeList:find';

with a comment that states "This is an emulation of the action link
being clicked."

Where is this fact documented?  I tried looking for it in the spec but
couldn't find it.

thanks,
Hubert

Re: Emulation of the action link being clicked

Posted by Andrew Robinson <an...@gmail.com>.
I went ahead and updated the WIKI [1] with the code I was talking about

-Andrew

[1] http://wiki.apache.org/myfaces/JavascriptWithJavaServerFaces

On 5/5/06, Matthias Wessendorf <ma...@apache.org> wrote:
> This wiki page contains some informations about JavaScript and Faces [1]
>
> HTH,
> Matthias
>
> [1] http://wiki.apache.org/myfaces/JavascriptWithJavaServerFaces
>
> On 4/29/06, Hubert Rabago <hr...@gmail.com> wrote:
> > I was looking at the sample application in
> > http://www.jsftutorials.net/interface/jsf-popup.html.
> >
> > In it, the author has this form:
> >
> > <h:form id="placeList">
> >     <h:commandLink id="find" action="showPlace" value=""/>
> > </h:form>
> >
> > He has some Javascript that essentially sets the value of the command
> > link equal to its id before submitting the form, also through
> > javascript:
> >   form['placeList:find'].value = 'placeList:find';
> >
> > with a comment that states "This is an emulation of the action link
> > being clicked."
> >
> > Where is this fact documented?  I tried looking for it in the spec but
> > couldn't find it.
> >
> > thanks,
> > Hubert
> >
>
>
> --
> Matthias Wessendorf
> Aechterhoek 18
> 48282 Emsdetten
> http://jroller.com/page/mwessendorf
> mwessendorf-at-gmail-dot-com
>

Re: Emulation of the action link being clicked

Posted by Matthias Wessendorf <ma...@apache.org>.
This wiki page contains some informations about JavaScript and Faces [1]

HTH,
Matthias

[1] http://wiki.apache.org/myfaces/JavascriptWithJavaServerFaces

On 4/29/06, Hubert Rabago <hr...@gmail.com> wrote:
> I was looking at the sample application in
> http://www.jsftutorials.net/interface/jsf-popup.html.
>
> In it, the author has this form:
>
> <h:form id="placeList">
>     <h:commandLink id="find" action="showPlace" value=""/>
> </h:form>
>
> He has some Javascript that essentially sets the value of the command
> link equal to its id before submitting the form, also through
> javascript:
>   form['placeList:find'].value = 'placeList:find';
>
> with a comment that states "This is an emulation of the action link
> being clicked."
>
> Where is this fact documented?  I tried looking for it in the spec but
> couldn't find it.
>
> thanks,
> Hubert
>


--
Matthias Wessendorf
Aechterhoek 18
48282 Emsdetten
http://jroller.com/page/mwessendorf
mwessendorf-at-gmail-dot-com