Displaying a JSP in a pop-up window

2006-12-06 Thread Pierre Goupil

Hi, all !



wilson wong xrote :



can you simply use javascript
window.open(your_url_for_jsp) ?


Yes, it does work. But I realize that my problem is a bit more complicated.

I would like to :

- open a popup when clicking on a link into a JSP (done)
- which would give, as a link parameter, a value
- taken itself from a bean property which is a collection.

Here's what I've got :


*** CODE ***

logic:iterate id=choix name=mainCouranteForm property=allAgents


bean:define id=thisAgent name=choix property=idAgent/

   script language=JavaScript
 function popup() {
window.open(/initSupprimerAgent.html?myAgent=%=
thisAgent %);
return false;
   }
   /script

   a href= onclick=return popup()supprimer/a

/logic:iterate

*** / CODE ***



And this all works but not as I would like. What happens is that the link is
created and the popup is dispayed when clicking it but in the link, the
parameter (myAgent) gives me always the same value, which is the last one of
the collection (or the first one, I don't know).

It seems that the bean is instantiated only once. So I thought what I would
need would be a way to give a number to the bean. So I used indexId=xxx of
logic:iterate and bean:define id=thisAgent%= xxx % and it compiles.

But I can't figure out a way to give the xxx to the javascript because
inside it there's already a %= %.

Can someone help, a way or another ? If my method is bad, just tell me !
Else just give me the missing syntax.

Thanx in advance !


Regards,


Pierre




--
L'une des raisons pour lesquelles la vie est complexe
C'est qu'elle a une partie réelle et une partie imaginaire.


Displaying a JSP in a pop-up window

2006-12-05 Thread Pierre Goupil

Hello, Strusters !

My question is quite simple. As you should have guessed : is there a way, in
Struts / Tomcat to display a JSP, not in the main browser window but rather
in a pop-up window ?

This would but great for confirm requests, errors displaying and such.

Regards,


Pierre

--
L'une des raisons pour lesquelles la vie est complexe
C'est qu'elle a une partie réelle et une partie imaginaire.


Re: Displaying a JSP in a pop-up window

2006-12-05 Thread Ed Griebel

The trick is to use the target=xx parameter in the generated a
tag. Try something like this: In your jsp you will have html:link
target=_blank action=SomeAction/. In your struts-config you will
have action path=SomeAction forward=/mypage.jsp/action

http://struts.apache.org/1.2.7/userGuide/struts-html.html#link
http://www.onjava.com/pub/a/onjava/2002/10/30/jakarta.html?page=3

-ed

On 12/5/06, Pierre Goupil [EMAIL PROTECTED] wrote:

Hello, Strusters !

My question is quite simple. As you should have guessed : is there a way, in
Struts / Tomcat to display a JSP, not in the main browser window but rather
in a pop-up window ?

This would but great for confirm requests, errors displaying and such.

Regards,


Pierre

--
L'une des raisons pour lesquelles la vie est complexe
C'est qu'elle a une partie réelle et une partie imaginaire.



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]