You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Keith Sader <ks...@gmail.com> on 2005/11/16 20:42:18 UTC

Tiles/Action design question

I've got a form that will be included in one of three pages. 
Essentially this form captures the same data at different levels in an
inventory of rolling stock.  The grouping is as follows:

1.) Inventory Defaults - applies to all inventory
2.) Fleet level defaults  - applies to a group of inventory items
3.) Equipment defaults - applies to one piece of rolling stock.

The order of precedence is 3, 2, 1 i.e. attribute data at the
equipment level over-rides defaults set at the fleet level, defaults
set at the fleet level over-ride inventory defaults.

I've got a tile defined that captures the common data, and I was
wondering if it was advisable to pass in the action to call on submit
as a tile parameter?  What I'd like ideally is polymorphism off of a
submit.  Is there an object friendly-way to do this?

Can anyone point me in the right direction?

thanks,
--
Keith Sader
ksader@gmail.com
http://www.saderfamily.org/roller/page/ksader
http://www.jroller.com/page/certifieddanger

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


Re: Tiles/Action design question

Posted by Keith Sader <ks...@gmail.com>.
On 11/16/05, Laurie Harper <la...@holoweb.net> wrote:
> Keith Sader wrote:

> I'm not sure exactly what you meant by 'polymorphism off of a submit' so
> this might be completely off-base but... Passing the action into the
> tile definition may be one option, depending on how your tiles and
> actions are set up. Another option may be to wait for the Struts 1.3
> release that's coming up. 1.3 lets you have 'extends' relationships
> between various configuration elements. I'm not sure, but I think this
> includes tiles definitions, in which case you can have a tile for each
> of your 'precedence levels' with each extending the higer-level one.
>
> If that doesn't sound like it might be useful, I probably haven't
> understood what you want to achieve properly.

Thanks for your input, but (as usual) I've found out what my real
issue is.  I was defining the <form> element inside of the tile when
the containing page needs to contain the form instead of the tile. 
I'm going to refactor the tile to be just the html elements and inputs
that are common to all these pages and put the form in the containing
page.

What I was working on at first was
<other inputs>
<tile form>

but this wouldn't have worked on a submit so what I'll put in now is:

<form>
<other inputs>
<tile inputs>
</form>

Now I just need to eliminate some action duplication.

thanks,
--
Keith Sader
ksader@gmail.com
http://www.saderfamily.org/roller/page/ksader
http://www.jroller.com/page/certifieddanger

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


Re: Tiles/Action design question

Posted by Laurie Harper <la...@holoweb.net>.
Greg Reddin wrote:
> On Nov 16, 2005, at 4:31 PM, Laurie Harper wrote:
>> I'm not sure exactly what you meant by 'polymorphism off of a  submit' 
>> so this might be completely off-base but... Passing the  action into 
>> the tile definition may be one option, depending on how  your tiles 
>> and actions are set up. Another option may be to wait  for the Struts 
>> 1.3 release that's coming up. 1.3 lets you have  'extends' 
>> relationships between various configuration elements. I'm  not sure, 
>> but I think this includes tiles definitions, in which  case you can 
>> have a tile for each of your 'precedence levels' with  each extending 
>> the higer-level one.
> 
> Tiles definitions are already extendable in this manner in 1.2.x if I  
> understand what you are saying correctly.

I think you're right; I was thinking about validations and got my wires 
crossed. Plus I tend to get confused about exactly which 'dimensions' 
the Tiles extends mechanism works across ;-)

L.


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


Re: Tiles/Action design question

Posted by Greg Reddin <gr...@apache.org>.
On Nov 16, 2005, at 4:31 PM, Laurie Harper wrote:

> I'm not sure exactly what you meant by 'polymorphism off of a  
> submit' so this might be completely off-base but... Passing the  
> action into the tile definition may be one option, depending on how  
> your tiles and actions are set up. Another option may be to wait  
> for the Struts 1.3 release that's coming up. 1.3 lets you have  
> 'extends' relationships between various configuration elements. I'm  
> not sure, but I think this includes tiles definitions, in which  
> case you can have a tile for each of your 'precedence levels' with  
> each extending the higer-level one.

Tiles definitions are already extendable in this manner in 1.2.x if I  
understand what you are saying correctly.

Greg


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


Re: Tiles/Action design question

Posted by Laurie Harper <la...@holoweb.net>.
Keith Sader wrote:
> I've got a form that will be included in one of three pages. 
> Essentially this form captures the same data at different levels in an
> inventory of rolling stock.  The grouping is as follows:
> 
> 1.) Inventory Defaults - applies to all inventory
> 2.) Fleet level defaults  - applies to a group of inventory items
> 3.) Equipment defaults - applies to one piece of rolling stock.
> 
> The order of precedence is 3, 2, 1 i.e. attribute data at the
> equipment level over-rides defaults set at the fleet level, defaults
> set at the fleet level over-ride inventory defaults.
> 
> I've got a tile defined that captures the common data, and I was
> wondering if it was advisable to pass in the action to call on submit
> as a tile parameter?  What I'd like ideally is polymorphism off of a
> submit.  Is there an object friendly-way to do this?

I'm not sure exactly what you meant by 'polymorphism off of a submit' so 
this might be completely off-base but... Passing the action into the 
tile definition may be one option, depending on how your tiles and 
actions are set up. Another option may be to wait for the Struts 1.3 
release that's coming up. 1.3 lets you have 'extends' relationships 
between various configuration elements. I'm not sure, but I think this 
includes tiles definitions, in which case you can have a tile for each 
of your 'precedence levels' with each extending the higer-level one.

If that doesn't sound like it might be useful, I probably haven't 
understood what you want to achieve properly.

L.


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