You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Darryl Culverwell <da...@bridge-pt.com> on 2007/04/18 13:44:07 UTC

runtime parameters for
Hi,

I am new to struts2 an am putting together a simple framework to inspect
user beans and display a generic edit screen based on the type of object
presented.


Is it possible to populate the various attributes of this tag at run
time depending on the field ?

the list obj.{#field.name} returns a list of beans, in my test case a
list of Car beans.

%{getText(#field.name+'.list.field')} returns a field name 'brand'
etc...


I have been playing with something like this (may not be exact as I have
been fiddling )  :

<s:select name="name" list="obj.[want name substitution from field]"
    headerKey="-1" headerValue=""
    listKey="%{getText(name+'.id.'+name')}"
    listValue="%{getText(name+'.list.'+name')}"
    label="%{getText(name)}">
</s:select>

but it doesn't seem to like the field.name bit, 
if I specify what obj.{#field.name} produces (in this case 'cars') 
as well as the other fields, it works as expected. 

In my previous project I found the jsp tag <%=blabla%> useful for this
sort of task.

Am I going about this the wrong way ?
	
-- 
-=Darryl Culverwell=-
Cell:  +27 82 494 1678
Phone: +21 21 448 1395




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