You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by LIM Adam <al...@groupehelice.fr> on 2006/11/28 16:26:42 UTC

Scriptlet and Javascript

Hi y'all!!!!

Here is my problem:
I have a "javascript:history.back()" link button. When I click on it, I
want to remove an entry in my object with scriptlet.
The problem is that the scriptlet is executed when my page is loaded and
not when I click on my button.
How could I manage it?

Thanks.

-----------------------------
Ce message et les eventuelles pieces jointes sont confidentiels ou appartenant au Groupe HELICE et etablis a l'intention exclusive de ses destinataires.
Toute divulgation, utilisation, diffusion ou reproduction (totale ou partielle) non-autorisee de ce message, ou des informations qu'il contient, est interdite.
Tout message electronique est susceptible d'alteration. Le Groupe HELICE decline toute responsabilite au titre de ce message s'il a ete modifie ou falsifie.
----
This e-mail and any attachments contain confidential information belonging to Groupe HELICE and are intended solely for the addressees.
Any unauthorised disclosure, use, dissemination or copying (either whole or partial) of this e-mail, or any information it contains, is prohibited.
E-mails are susceptible to alteration. Neither Groupe HELICE shall be liable for the message if altered or falsified.
-----------------------------


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


Re: [OT] Scriptlet and Javascript

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Adam,

LIM Adam wrote:
> I have a "javascript:history.back()" link button. When I click on it, I
> want to remove an entry in my object with scriptlet.
> The problem is that the scriptlet is executed when my page is loaded and
> not when I click on my button.
> How could I manage it?

You'll need to post your HTML code so we can better understand your
situation.

I'm not sure what you mean when you say that your scriptlet is executed
when your page is loaded. Do you mean that you have something like this:

<script type="text/javascript"><!--
  history.back();
// --></script>

... in your code? That doesn't seem right. Since you said that your
javascript code is "javascript:history.back();", I'm assuming that your
HTML is like this:

<input type="button" onclick="javascript:history.back();" />

(Note that "javascript:" is unnecessary in the "onclick" handler... it's
always javascript.)

Anyhow, I'm also unclear about what you want to do when this button is
clicked.... you want to remove an object entry? Do you mean a javascript
object, or something on the server? If you mean the server, are you
using AJAX or something like that, or do you want to call an action on
the server in order to do that (which, I guess, doesn't exactly preclude
the use of AJAX)?

- -chris

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFbFhv9CaO5/Lv0PARAnSOAJ9D6GyUC/yFc4XMcyK0QtyoHdjvtwCgwKhI
YTk/UxpaOrJjMP0Ew2e0Kik=
=M9mj
-----END PGP SIGNATURE-----

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


Re: Scriptlet and Javascript

Posted by Martin Gainty <mg...@hotmail.com>.
Hi adam-

I would suggest invalidating what your session is carrying with session.invalidate() and then re-populate ActionForm
I found this link quite helpful
http://mail-archives.apache.org/mod_mbox/struts-dev/200601.mbox/%3C20060113205129.29471.56280@ajax.apache.org%3E

Anyone else?
M-
This e-mail communication and any attachments may contain confidential and privileged information for the use of the 
designated recipients named above. If you are not the intended recipient, you are hereby notified that you have received
this communication in error and that any review, disclosure, dissemination, distribution or copying of it or its 
contents
----- Original Message ----- 
From: "LIM Adam" <al...@groupehelice.fr>
To: <us...@struts.apache.org>
Sent: Tuesday, November 28, 2006 10:26 AM
Subject: Scriptlet and Javascript


Hi y'all!!!!

Here is my problem:
I have a "javascript:history.back()" link button. When I click on it, I
want to remove an entry in my object with scriptlet.
The problem is that the scriptlet is executed when my page is loaded and
not when I click on my button.
How could I manage it?

Thanks.

-----------------------------
Ce message et les eventuelles pieces jointes sont confidentiels ou appartenant au Groupe HELICE et etablis a l'intention exclusive de ses destinataires.
Toute divulgation, utilisation, diffusion ou reproduction (totale ou partielle) non-autorisee de ce message, ou des informations qu'il contient, est interdite.
Tout message electronique est susceptible d'alteration. Le Groupe HELICE decline toute responsabilite au titre de ce message s'il a ete modifie ou falsifie.
----
This e-mail and any attachments contain confidential information belonging to Groupe HELICE and are intended solely for the addressees.
Any unauthorised disclosure, use, dissemination or copying (either whole or partial) of this e-mail, or any information it contains, is prohibited.
E-mails are susceptible to alteration. Neither Groupe HELICE shall be liable for the message if altered or falsified.
-----------------------------


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