You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Raghuram Kanadam <Su...@infosys.com> on 2004/07/27 16:30:12 UTC
Accessing JavaScript functions in other windows
Seems that there is a way after all :) Please ignore this if you guys already know this or feel that this shud be on a HTML users list.
We could use the fact that properties could be added to a class at runtime, so heres the code
document.customFunction = myCustomFunction;
function myCustomFunction (arg1, arg2, ...)
{
//my dumb code
}
somewhere in eternity...
window.open ('...', 'win2');
again in win2 somewhere close to eternity...
var parent = window.opener; //this wud be window1, use your own manipulations to get to this window, the parent
parent.document.customFunction (arg1_1, arg2_1, ...);
Works in IE6+ and NS6+. Don't have a previous release.
Waitin' for the brickbats,
:)
-----Original Message-----
From: kkamholz@moog.com [mailto:kkamholz@moog.com]
Sent: Tuesday, July 27, 2004 7:47 PM
To: Struts Users Mailing List
Subject: Re: html:link with params
In the application I'm working on, I actually don't create the map in the
JSP or the action, I use a getter method in my form bean that constructs
the map and returns it. It's very nice and easy, just create the getter
method, specify the bean name and property in the link tag, and there ya
go. I'm sure there are some cases where this wouldn't be the ideal
solution, but for what I've done, it works wonderfully.
Does this sound like a good way of doing this to everybody else?
Keith Kamholz
IT - Programming and Architecture
Moog Inc.
Nathan Maves <Na...@Sun.COM>
07/26/2004 07:28 PM
Please respond to
Struts Users Mailing List <us...@struts.apache.org>
To
Struts Users Mailing List <us...@struts.apache.org>
cc
Subject
Re: html:link with params
Think of a case where you have a List of people and you wanted to
create a link for each person. I would have to create n# of Maps in
the Action. If it was done in something like a forEach loop this could
be done all at once. Not sure how good of an example this is :)
Nathan
On Jul 26, 2004, at 5:16 PM, Wendy Smoak wrote:
> From: "Nathan Maves" <Na...@Sun.COM>
>> I know that we can use a Map to achieve this but I hate creating them
>> in a jsp.
>
> I'm puzzled... why would you create in the JSP instead of in the
> Action,
> where presumably it wouldn't bother you as much?
>
> Not that that answers your question, but that part jumped out at me.
>
> --
> Wendy Smoak
>
>
> ---------------------------------------------------------------------
> 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
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org