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.