struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Friedman" <hum...@ix.netcom.com>
Subject RE: tiles:insert page action with form - problem?
Date Fri, 21 Nov 2003 18:03:22 GMT
Fred,

Try checking out a org.apache.struts.tiles.actions.TilesAction as your
action type.  That gives you direct access to the tiles layout so you can
add/set tiles information to your choice of values.

Regards,
David

-----Original Message-----
From: Fred Bloggs [mailto:nmr7up@yahoo.com]
Sent: Friday, November 21, 2003 7:38 AM
To: Struts Users Mailing List
Subject: Re: tiles:insert page action with form - problem?


Dear All

I have been struggling with this for a while now and
seemed to have got part of the way but now I seem to
have hit a brick wall.

I would like to insert a tile (into a jsp page) which
is actually the result of action.  The action takes as
input form parameters.

I have tried the following:

<tiles:insert
page="/getnewsdo?categoryid=167&topicid=234"/>

This works and populates the associate form correctly,
but how do I do it programmatically in my jsp page if
I have the two variable available, i.e. categorid and
topicid  using (Exepression Lanaguage) EL in the jsp?

Ideally I would like to do the following:

<tiles:insert
page="/getnewsdo?categoryid=${categoriyid}&topicid=${topicid}"/>

But this does not work.  I cannot figure out how to
make it work.  I have scanned the web and found a
reference that suggests that EL may not work in
certain tags if the tag has tagdependant set.

Is there another  better way of doing this with the
tiles:insert or tiles:put tags?

I am using Struts 1.1 with Tomcat 4.1.28

I would be grateful for any pointers.


--- Fred Bloggs <nmr7up@yahoo.com> wrote:
> Dear All
>
> I am relatively new to using struts tiles and I am
> having a problem trying to figure out how to do the
> following:
>
> I have an action that returns the news where the
> users
> submits a form specifying the subject category and
> date.  The action finds the relevant news and then
> forwards it to a view page to be displayed for the
> user.  This works.
>
> Now I would like to re-use the action but this time
> I
> know in advance what subject category and date need
> to
> be displayed.  I want to insert the tile into
> another
> page.
>
> I have tried the following but it does not work:
>
> <tiles:insert page="/getnews">
> 	<tiles:put name="category"  value="${val.category}"
> />
> 	<tiles:put name="bean" beanName="GetnewsForm"/>
> </tiles:insert>
> This just makes the bean available to the tile for
> use
> inside the that jsp.
>
> However the above does not cause the "form" to be be
> populated, infact no form is passed to  the action
> i.e. It is  null.
>
> How would I insert the results of an action into a
> jsp
> which uses parameters harvested from that jsp which
> are used to populate the form?  I.e. How do I
> programmatically cause a form to be created that is
> passed to the action from a tiles:insert (or
> similar)?
>
> I thought about having a separate jsp page that has
> <html:form action= with html:hidden parameters made
> available to it by the tiles:put from the original
> insert. But I could not figure out how to
> automatically make that page execute the submission
> without waiting for the user to press the submit
> button.
>
> Any help will be greatly appreciated.
>
> Thanks in advance.
>
> __________________________________
> Do you Yahoo!?
> Protect your identity with Yahoo! Mail AddressGuard
> http://antispam.yahoo.com/whatsnewfree
>
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> struts-user-help@jakarta.apache.org
>


__________________________________
Do you Yahoo!?
Free Pop-Up Blocker - Get it now
http://companion.yahoo.com/

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


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


Mime
View raw message