You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Security Management <li...@secmgmt.com> on 2009/07/10 17:49:04 UTC

Help with JSP and javascript

Can someone suggest a way to do this:

<s:submit type="image" alt="Unlocked" src="%{unlocked_image}"
onclick='$("<s:property value="#foo"/>").request(); return false;'/>

I have tried a bunch of ways, but always wind up with the &lts:property...
in the resulting HTML, rather than '$("form1").submit()' like I need.

Thanks




---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


RE: Help with JSP and javascript

Posted by Martin Gainty <mg...@hotmail.com>.
onclick="$(&#146;door3&#146;).request(); return false;"

apologies for short response
Martin Gainty 
______________________________________________ 
Verzicht und Vertraulichkeitanmerkung
 
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.





> From: wesw@wantii.com
> To: user@struts.apache.org
> Subject: Re: Help with JSP and javascript
> Date: Fri, 10 Jul 2009 15:03:08 -0400
> 
> There is a way to escape quotes in OGNL... I thought I had a sample sitting 
> around somewhere but I am not finding it. Check google. I would guess that you 
> could just escape the single quotes you need and the rest will fall into 
> place.
> 
> -Wes
> 
> On Friday 10 July 2009 14:54:30 Security Management wrote:
> > OK, thanks Wes, I'm making progress:
> >
> > This:
> >
> > <s:submit type="image" alt="Unlocked" src="%{unlocked_image}"
> > onclick="%{'$(' + #foo + ').request(); return false;'}"/>
> >
> >
> > Generates:
> >
> > <input type="image" alt="Submit" src="/smc-appsuite/pages/door-control
> > /images/unlocked.png" id="door3_0" value="Submit"
> > onclick="$(door3).request(); return false
> > ;" alt="Unlocked"/>
> >
> > If I use single-quotes inside, I get errors.  Double quotes as well.
> > Escaped double quotes give me &quot;, but what I really need is:
> >
> > onclick="$('door3').request(); return false;"
> >
> > Note the single quotes around 'door3', which is what #foo is.
> >
> >
> > -----Original Message-----
> > From: Wes Wannemacher [mailto:wesw@wantii.com]
> > Sent: Friday, July 10, 2009 12:09 PM
> > To: Struts Users Mailing List
> > Subject: Re: Help with JSP and javascript
> >
> > On Friday 10 July 2009 11:49:04 Security Management wrote:
> > > Can someone suggest a way to do this:
> > >
> > > <s:submit type="image" alt="Unlocked" src="%{unlocked_image}"
> > > onclick='$("<s:property value="#foo"/>").request(); return false;'/>
> > >
> > > I have tried a bunch of ways, but always wind up with the
> > > &lts:property... in the resulting HTML, rather than '$("form1").submit()'
> > > like I need.
> > >
> > > Thanks
> >
> > Try this -
> >
> > <s:submit type="image" alt="Unlocked" src="%{unlocked_image}"
> >  onclick="%{'$(' + #foo + ').request(); return false;}'}"/>
> 
> -- 
> Wes Wannemacher
> Author - Struts 2 In Practice 
> Includes coverage of Struts 2.1, Spring, JPA, JQuery, Sitemesh and more
> http://www.manning.com/wannemacher
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 

_________________________________________________________________
Lauren found her dream laptop. Find the PC that’s right for you.
http://www.microsoft.com/windows/choosepc/?ocid=ftp_val_wl_290

RE: Help with JSP and javascript

Posted by Martin Gainty <mg...@hotmail.com>.
Good Morning Mike

http://www.prototypejs.org/api/ajax/updater

could you illustrate how the prototype JS function works in struts?
are you using a <struts>plugin?
how would struts identify and create the 'items' container for 1st parameter
illustrated here:
new Ajax.Updater('items', '/items', {
  parameters: { text: $F('text') }
});

when script elements are in response and evalScripts=true
evalScripts
    false
    This determines whether <script> elements in the response text are evaluated or not.where are the script functions located that would be eval'ed

can prototype return json formatted response?

apologies for long-winded response,
Martin
______________________________________________ 
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
 
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.




> From: list-subscriptions@secmgmt.com
> To: user@struts.apache.org
> Subject: RE: Help with JSP and javascript
> Date: Tue, 14 Jul 2009 09:33:23 -0400
> 
> For the record, here's what works.
> 
> <s:submit type="image" alt="Unlocked" src="%{unlocked_image}"
> onclick="%{'$(\\'' + #form_name + '\\').request(); setTimeout(new
> Ajax.Updater(\\'' + #door_url + '\\', \\'' + #foo +'\\', {evalScripts:
> true}), 1000000); return false;'}"/>
> 
> Thanks for the help.
> 
> Mike.
> 
> -----Original Message-----
> From: Wes Wannemacher [mailto:wesw@wantii.com] 
> Sent: Friday, July 10, 2009 3:03 PM
> To: Struts Users Mailing List
> Subject: Re: Help with JSP and javascript
> 
> There is a way to escape quotes in OGNL... I thought I had a sample sitting 
> around somewhere but I am not finding it. Check google. I would guess that
> you 
> could just escape the single quotes you need and the rest will fall into 
> place.
> 
> -Wes
> 
> On Friday 10 July 2009 14:54:30 Security Management wrote:
> > OK, thanks Wes, I'm making progress:
> >
> > This:
> >
> > <s:submit type="image" alt="Unlocked" src="%{unlocked_image}"
> > onclick="%{'$(' + #foo + ').request(); return false;'}"/>
> >
> >
> > Generates:
> >
> > <input type="image" alt="Submit" src="/smc-appsuite/pages/door-control
> > /images/unlocked.png" id="door3_0" value="Submit"
> > onclick="$(door3).request(); return false
> > ;" alt="Unlocked"/>
> >
> > If I use single-quotes inside, I get errors.  Double quotes as well.
> > Escaped double quotes give me &quot;, but what I really need is:
> >
> > onclick="$('door3').request(); return false;"
> >
> > Note the single quotes around 'door3', which is what #foo is.
> >
> >
> > -----Original Message-----
> > From: Wes Wannemacher [mailto:wesw@wantii.com]
> > Sent: Friday, July 10, 2009 12:09 PM
> > To: Struts Users Mailing List
> > Subject: Re: Help with JSP and javascript
> >
> > On Friday 10 July 2009 11:49:04 Security Management wrote:
> > > Can someone suggest a way to do this:
> > >
> > > <s:submit type="image" alt="Unlocked" src="%{unlocked_image}"
> > > onclick='$("<s:property value="#foo"/>").request(); return false;'/>
> > >
> > > I have tried a bunch of ways, but always wind up with the
> > > &lts:property... in the resulting HTML, rather than
> '$("form1").submit()'
> > > like I need.
> > >
> > > Thanks
> >
> > Try this -
> >
> > <s:submit type="image" alt="Unlocked" src="%{unlocked_image}"
> >  onclick="%{'$(' + #foo + ').request(); return false;}'}"/>
> 
> -- 
> Wes Wannemacher
> Author - Struts 2 In Practice 
> Includes coverage of Struts 2.1, Spring, JPA, JQuery, Sitemesh and more
> http://www.manning.com/wannemacher
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 

_________________________________________________________________
Hotmail® has ever-growing storage! Don’t worry about storage limits. 
http://windowslive.com/Tutorial/Hotmail/Storage?ocid=TXT_TAGLM_WL_HM_Tutorial_Storage_062009

RE: Help with JSP and javascript

Posted by Security Management <li...@secmgmt.com>.
For the record, here's what works.

<s:submit type="image" alt="Unlocked" src="%{unlocked_image}"
onclick="%{'$(\\'' + #form_name + '\\').request(); setTimeout(new
Ajax.Updater(\\'' + #door_url + '\\', \\'' + #foo +'\\', {evalScripts:
true}), 1000000); return false;'}"/>

Thanks for the help.

Mike.

-----Original Message-----
From: Wes Wannemacher [mailto:wesw@wantii.com] 
Sent: Friday, July 10, 2009 3:03 PM
To: Struts Users Mailing List
Subject: Re: Help with JSP and javascript

There is a way to escape quotes in OGNL... I thought I had a sample sitting 
around somewhere but I am not finding it. Check google. I would guess that
you 
could just escape the single quotes you need and the rest will fall into 
place.

-Wes

On Friday 10 July 2009 14:54:30 Security Management wrote:
> OK, thanks Wes, I'm making progress:
>
> This:
>
> <s:submit type="image" alt="Unlocked" src="%{unlocked_image}"
> onclick="%{'$(' + #foo + ').request(); return false;'}"/>
>
>
> Generates:
>
> <input type="image" alt="Submit" src="/smc-appsuite/pages/door-control
> /images/unlocked.png" id="door3_0" value="Submit"
> onclick="$(door3).request(); return false
> ;" alt="Unlocked"/>
>
> If I use single-quotes inside, I get errors.  Double quotes as well.
> Escaped double quotes give me &quot;, but what I really need is:
>
> onclick="$('door3').request(); return false;"
>
> Note the single quotes around 'door3', which is what #foo is.
>
>
> -----Original Message-----
> From: Wes Wannemacher [mailto:wesw@wantii.com]
> Sent: Friday, July 10, 2009 12:09 PM
> To: Struts Users Mailing List
> Subject: Re: Help with JSP and javascript
>
> On Friday 10 July 2009 11:49:04 Security Management wrote:
> > Can someone suggest a way to do this:
> >
> > <s:submit type="image" alt="Unlocked" src="%{unlocked_image}"
> > onclick='$("<s:property value="#foo"/>").request(); return false;'/>
> >
> > I have tried a bunch of ways, but always wind up with the
> > &lts:property... in the resulting HTML, rather than
'$("form1").submit()'
> > like I need.
> >
> > Thanks
>
> Try this -
>
> <s:submit type="image" alt="Unlocked" src="%{unlocked_image}"
>  onclick="%{'$(' + #foo + ').request(); return false;}'}"/>

-- 
Wes Wannemacher
Author - Struts 2 In Practice 
Includes coverage of Struts 2.1, Spring, JPA, JQuery, Sitemesh and more
http://www.manning.com/wannemacher

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Help with JSP and javascript

Posted by Wes Wannemacher <we...@wantii.com>.
There is a way to escape quotes in OGNL... I thought I had a sample sitting 
around somewhere but I am not finding it. Check google. I would guess that you 
could just escape the single quotes you need and the rest will fall into 
place.

-Wes

On Friday 10 July 2009 14:54:30 Security Management wrote:
> OK, thanks Wes, I'm making progress:
>
> This:
>
> <s:submit type="image" alt="Unlocked" src="%{unlocked_image}"
> onclick="%{'$(' + #foo + ').request(); return false;'}"/>
>
>
> Generates:
>
> <input type="image" alt="Submit" src="/smc-appsuite/pages/door-control
> /images/unlocked.png" id="door3_0" value="Submit"
> onclick="$(door3).request(); return false
> ;" alt="Unlocked"/>
>
> If I use single-quotes inside, I get errors.  Double quotes as well.
> Escaped double quotes give me &quot;, but what I really need is:
>
> onclick="$('door3').request(); return false;"
>
> Note the single quotes around 'door3', which is what #foo is.
>
>
> -----Original Message-----
> From: Wes Wannemacher [mailto:wesw@wantii.com]
> Sent: Friday, July 10, 2009 12:09 PM
> To: Struts Users Mailing List
> Subject: Re: Help with JSP and javascript
>
> On Friday 10 July 2009 11:49:04 Security Management wrote:
> > Can someone suggest a way to do this:
> >
> > <s:submit type="image" alt="Unlocked" src="%{unlocked_image}"
> > onclick='$("<s:property value="#foo"/>").request(); return false;'/>
> >
> > I have tried a bunch of ways, but always wind up with the
> > &lts:property... in the resulting HTML, rather than '$("form1").submit()'
> > like I need.
> >
> > Thanks
>
> Try this -
>
> <s:submit type="image" alt="Unlocked" src="%{unlocked_image}"
>  onclick="%{'$(' + #foo + ').request(); return false;}'}"/>

-- 
Wes Wannemacher
Author - Struts 2 In Practice 
Includes coverage of Struts 2.1, Spring, JPA, JQuery, Sitemesh and more
http://www.manning.com/wannemacher

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


RE: Help with JSP and javascript

Posted by Security Management <li...@secmgmt.com>.
OK, thanks Wes, I'm making progress:

This:

<s:submit type="image" alt="Unlocked" src="%{unlocked_image}"
onclick="%{'$(' + #foo + ').request(); return false;'}"/>


Generates:

<input type="image" alt="Submit" src="/smc-appsuite/pages/door-control
/images/unlocked.png" id="door3_0" value="Submit"
onclick="$(door3).request(); return false
;" alt="Unlocked"/>

If I use single-quotes inside, I get errors.  Double quotes as well.
Escaped double quotes give me &quot;, but what I really need is:

onclick="$('door3').request(); return false;"

Note the single quotes around 'door3', which is what #foo is.


-----Original Message-----
From: Wes Wannemacher [mailto:wesw@wantii.com] 
Sent: Friday, July 10, 2009 12:09 PM
To: Struts Users Mailing List
Subject: Re: Help with JSP and javascript

On Friday 10 July 2009 11:49:04 Security Management wrote:
> Can someone suggest a way to do this:
>
> <s:submit type="image" alt="Unlocked" src="%{unlocked_image}"
> onclick='$("<s:property value="#foo"/>").request(); return false;'/>
>
> I have tried a bunch of ways, but always wind up with the &lts:property...
> in the resulting HTML, rather than '$("form1").submit()' like I need.
>
> Thanks
>

Try this - 

<s:submit type="image" alt="Unlocked" src="%{unlocked_image}"
 onclick="%{'$(' + #foo + ').request(); return false;}'}"/>

-- 
Wes Wannemacher
Author - Struts 2 In Practice 
Includes coverage of Struts 2.1, Spring, JPA, JQuery, Sitemesh and more
http://www.manning.com/wannemacher

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Help with JSP and javascript

Posted by Wes Wannemacher <we...@wantii.com>.
On Friday 10 July 2009 11:49:04 Security Management wrote:
> Can someone suggest a way to do this:
>
> <s:submit type="image" alt="Unlocked" src="%{unlocked_image}"
> onclick='$("<s:property value="#foo"/>").request(); return false;'/>
>
> I have tried a bunch of ways, but always wind up with the &lts:property...
> in the resulting HTML, rather than '$("form1").submit()' like I need.
>
> Thanks
>

Try this - 

<s:submit type="image" alt="Unlocked" src="%{unlocked_image}"
 onclick="%{'$(' + #foo + ').request(); return false;}'}"/>

-- 
Wes Wannemacher
Author - Struts 2 In Practice 
Includes coverage of Struts 2.1, Spring, JPA, JQuery, Sitemesh and more
http://www.manning.com/wannemacher

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Help with JSP and javascript

Posted by dusty <du...@yahoo.com>.
    <s:submit type="image" alt="Unlocked" src="/residentrn/images/accept.png"
onclick="%{\"$('\" + #foo +  \"').request(); return false;\"}" />




Security Management wrote:
> 
> Can someone suggest a way to do this:
> 
> <s:submit type="image" alt="Unlocked" src="%{unlocked_image}"
> onclick='$("<s:property value="#foo"/>").request(); return false;'/>
> 
> I have tried a bunch of ways, but always wind up with the &lts:property...
> in the resulting HTML, rather than '$("form1").submit()' like I need.
> 
> Thanks
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Help-with-JSP-and-javascript-tp24430017p24437333.html
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org