You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by PC Leung <pc...@gmail.com> on 2004/10/20 03:55:39 UTC

form tiles link from database?

  <definition name="erp.menu.home" path="/layout/menu.jsp" >
  <put name="title" value="Tiles" />
  <putList name="items" >
    <item value="xxxxx"            link="/yyyyy.jsp">
    <item value="ERP Home"     link="/index.jsp" />
                                               ^^^^^^^^^^^^^^^^^^^^
Could the link be read from database?

  </putList>
  </definition>

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


Re: form tiles link from database?

Posted by Vic Cekvenich <ce...@portalvu.com>.
I do not think there is any example code.

It esence you are going to put some values in scope (request?) in an action.
Then in a pages, you will use those values.
Very simple and lets you make very complex dynamic designs.
.V

PC Leung wrote:
> The following are defined in tiles-defs.xml
> <putList>
> <item value="xxxx" link="yyyy">
> 
> Can I change them to variables 
> <item value=${xxxx}  link=${yyyy} >
> 
> and modify values of variables in Action class or another?
> 
> I have read the links suggested.
> But I fail to find example code.
> 
> 
> On Tue, 19 Oct 2004 21:35:36 -0500, Vic Cekvenich
> <ce...@portalvu.com> wrote:
> 
>>Yes.
>>
>>I put in the List of tiles into scope.
>>.V
>>
>>
>>
>>PC Leung wrote:
>>
>>>  <definition name="erp.menu.home" path="/layout/menu.jsp" >
>>>  <put name="title" value="Tiles" />
>>>  <putList name="items" >
>>>    <item value="xxxxx"            link="/yyyyy.jsp">
>>>    <item value="ERP Home"     link="/index.jsp" />
>>>                                               ^^^^^^^^^^^^^^^^^^^^
>>>Could the link be read from database?
>>>
>>>  </putList>
>>>  </definition>
>>
>>---------------------------------------------------------------------
>>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


RE: form tiles link from database?

Posted by "David G. Friedman" <hu...@ix.netcom.com>.
In Tiles you have two other ways to do this.  You can have you Action extend
TilesAction, make your SQL call within your action, then put/copy the
results into the appropriate list of your tile.  See tiles definition and
Java code example in chapter 5.2.1 in the tilesAdvancedFeatures.pdf I
mentioned in a previous post.

In the Tiles definition itself, you can set a controller so some Java class
can perform your SQL call and push the data into your list for display into
the page.  See the tiles definition and JAva code example in chapter 7.3.2
in the tilesAdvancedFeatures.pdf I mentioned in a prevous post.

Regards,
David

-----Original Message-----
From: PC Leung [mailto:pc.leung@gmail.com]
Sent: Tuesday, October 19, 2004 11:51 PM
To: Struts Users Mailing List
Subject: Re: form tiles link from database?


The following are defined in tiles-defs.xml
<putList>
<item value="xxxx" link="yyyy">

Can I change them to variables
<item value=${xxxx}  link=${yyyy} >

and modify values of variables in Action class or another?

I have read the links suggested.
But I fail to find example code.


On Tue, 19 Oct 2004 21:35:36 -0500, Vic Cekvenich
<ce...@portalvu.com> wrote:
> Yes.
>
> I put in the List of tiles into scope.
> .V
>
>
>
> PC Leung wrote:
> >   <definition name="erp.menu.home" path="/layout/menu.jsp" >
> >   <put name="title" value="Tiles" />
> >   <putList name="items" >
> >     <item value="xxxxx"            link="/yyyyy.jsp">
> >     <item value="ERP Home"     link="/index.jsp" />
> >                                                ^^^^^^^^^^^^^^^^^^^^
> > Could the link be read from database?
> >
> >   </putList>
> >   </definition>
>
> ---------------------------------------------------------------------
> 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


Re: form tiles link from database?

Posted by PC Leung <pc...@gmail.com>.
The following are defined in tiles-defs.xml
<putList>
<item value="xxxx" link="yyyy">

Can I change them to variables 
<item value=${xxxx}  link=${yyyy} >

and modify values of variables in Action class or another?

I have read the links suggested.
But I fail to find example code.


On Tue, 19 Oct 2004 21:35:36 -0500, Vic Cekvenich
<ce...@portalvu.com> wrote:
> Yes.
> 
> I put in the List of tiles into scope.
> .V
> 
> 
> 
> PC Leung wrote:
> >   <definition name="erp.menu.home" path="/layout/menu.jsp" >
> >   <put name="title" value="Tiles" />
> >   <putList name="items" >
> >     <item value="xxxxx"            link="/yyyyy.jsp">
> >     <item value="ERP Home"     link="/index.jsp" />
> >                                                ^^^^^^^^^^^^^^^^^^^^
> > Could the link be read from database?
> >
> >   </putList>
> >   </definition>
> 
> ---------------------------------------------------------------------
> 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


Re: form tiles link from database?

Posted by Vic Cekvenich <ce...@portalvu.com>.
Yes.

I put in the List of tiles into scope.
.V

PC Leung wrote:
>   <definition name="erp.menu.home" path="/layout/menu.jsp" >
>   <put name="title" value="Tiles" />
>   <putList name="items" >
>     <item value="xxxxx"            link="/yyyyy.jsp">
>     <item value="ERP Home"     link="/index.jsp" />
>                                                ^^^^^^^^^^^^^^^^^^^^
> Could the link be read from database?
> 
>   </putList>
>   </definition>


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


RE: form tiles link from database?

Posted by "David G. Friedman" <hu...@ix.netcom.com>.
If you use a Tiles controller, there is no reason you couldn't do that from
Java.  Just not inside the tiles.xml configuration file. See the tiles
controller mentioned in http://struts.apache.org/userGuide/dev_tiles.html.
Another good reference is Tiles Advanced Features by Cedric Dumoulin (bottom
of the tiles userguide, direct url:
http://www.lifl.fr/~dumoulin/tiles/tilesAdvancedFeatures.pdf

Regards,
David

-----Original Message-----
From: PC Leung [mailto:pc.leung@gmail.com]
Sent: Tuesday, October 19, 2004 9:56 PM
To: Struts Users Mailing List
Subject: form tiles link from database?


  <definition name="erp.menu.home" path="/layout/menu.jsp" >
  <put name="title" value="Tiles" />
  <putList name="items" >
    <item value="xxxxx"            link="/yyyyy.jsp">
    <item value="ERP Home"     link="/index.jsp" />
                                               ^^^^^^^^^^^^^^^^^^^^
Could the link be read from database?

  </putList>
  </definition>

---------------------------------------------------------------------
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