Hi Nina-Annick,

There was a custom tag written by Phase Web that can do what you need.






James Mitchell
Software Engineer\Struts Evangelist
Struts-Atlanta, the "Open Minded Developer Network"
http://www.open-tools.org/struts-atlanta




> -----Original Message-----
> From: Nina-Annick Stranzenbach [mailto:[EMAIL PROTECTED]]
> Sent: Monday, July 01, 2002 3:55 AM
> To: [EMAIL PROTECTED]
> Subject: getting link parameters from a bean
>
>
> Hi all,
> I posted this question before, but no one answered -
> Doesn't anyone understand my problem or
> Does no one know any answer???
> Here it is:
>
> Hi,
>
> I am trying to open a new window via javascript command that submits
> command to an action path. As this action path needs a request
> parameter, it's got to be submitted as well. When I tested the action, I
> did it like this:
>
> <html:link page="/details.do" paramId="ticketId" paramName="ticket"
> target="_blank"> </html:link>
>
> It work well, but I need to open a window without menues, so I would
> like to open a popup-window with javascript, but I've encountered
> problems with getting the request parameters into the link:
>
> <html:link page="" onclick="popup(340,300,'details','/details.do?
>         ')">
>
> Where the white spaces are, I would like to find the contents of the
> bean called 'ticket', like with <bean:write name="ticket"/>
> Does anyone have any idea how this could be done?
> I already tried to put a <bean:write> and a <html:rewrite> into it, but
> those did not seem to be any possible solutions to the problem.
>
> Help will be greatly appreciated,
> Thanks,
>
> Nina.
>
>
>
> --
> To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>

--- Begin Message ---
Hey all,

I submitted an enhancement to struts. Read the following and if it sounds
worth having in struts give me a vote on the developer's list or make some
noise for some of the gurus to see.

The code is at the following url in zip format:

Here is the info on the tag:
http://www.phase.ws/linktag/taglib.zip

I don't know if a similar solution has been provided, but, I tweaked the
Link Tag to support the writing of
'javascript:[function_name]([param1,param2,param3...])' to the href
attribute of the final output. Here is a summarization of it's
functionality:

I added the following attributes:

function - This is the name of the javascript function that will be called;

functionName - This is the name of the bean that will provide parameter
values from one of it's properties.

functionProperty - This is a property of a bean that will either provide a
String or an ArrayList to populate the parameters of the function

urlIndex - This allows you to include the url generated by href,forward or
page to be included at a specific place in the function's parameters.

There is another class that I wrote that does the actual processing and
preparation of the url. I named it EcmaUtil.  I modeled the computeURL and
computerParam methods of the RequestUtils class when I built the methods for
the EcmaUtil.

The LinkTag class that I wrote extends the BaseHandlerTag under the
org.apache.struts.taglib.html package of struts jar.

I know the code needs a bit of reworking to fit back in to the struts
framework. I stripped out the MessageReources for the most part and removed
some exception handling that will need to be included again.

Anyways, if nobody has done this in the nightly or if it sounds like it
might be of use. Let me know and I will post the code,the tld and an example
of it's usage.

EXAMPLE OF USAGE:

This tag works exactly like the struts html tag with expanded feature
outlined above:

<pwshtml:link forward="listings/detail/popup" function="popUpWin"
urlIndex="1" paramId="image" paramName="image">
<img src="image.jpg"> some text</pwshtml:link>

This code will produce the follwing html
<a
href="javascript:popUpWin('/do/listings/detail/popup?image=NWMT203336.jpg')"
><img src="image.jpg"></a>

Of course some of the elements are arbitrary to the values in your beans.
But you should be able to traverse the code and get the idea.

Thanks in advance.
Brandon Goodin
Phase Web and Multimedia
P(406)862-2245
F(406)862-0354
http://www.phase.ws
[EMAIL PROTECTED]


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


--- End Message ---
--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to