I believe that the issue here is that the bean:define  needs to be able to
resolve the reference "regions["<%= elementNo%>"].region_ent" at compile
time - not at run time.

I belive it literally gets a copy of the bean property that you are
specifying and creates a new bean from it that it attaches to the page
contect. This means that you then reference the copy of the Region in the
page context - not the offset into the array of Regions in the initial
bean.

Because of this behavior I believe it needs to be able to resolve the
location of the object it's going to create the bean from at compile time.
Not sure to be honest -

Check the DefineTag source code to be sure.  It's in the source tree at:
org\apache\struts\taglib\bean\DefineTag.java

FWIW -
Kevin






Sanjay Choudhary <[EMAIL PROTECTED]> on 04/17/2002 04:08:19 PM

Please respond to "Struts Users Mailing List"
      <[EMAIL PROTECTED]>

To:   Struts Users Mailing List <[EMAIL PROTECTED]>
cc:
Subject:  [Q] bean:define dynamically


Hi guys,

I wish to define a bean:id as
  <bean:define id="entitybean"  name="RegionForm"
property="regions["<%= elementNo%>"].region_ent"
type="java.util.ArrayList" scope="session"/>


I tried giving <%= elementNo%>
               <bean:write....>
but it didn't work.

Is there a way to do this?

FYI,
where RegionForm has attribute

java.util.ArrayList regions;
String elementNo;  // get populated on selection
default="0"

regions is a list of class type Region.

Region class has attribute
    java.util.ArrayList region_ent;



__________________________________________________
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/

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







---------------------------------------------------------------------------
This e-mail message (including attachments, if any) is intended for the use
of the individual or entity to which it is addressed and may contain
information that is privileged, proprietary , confidential and exempt from
disclosure.  If you are not the intended recipient, you are notified that
any dissemination, distribution or copying of this communication is
strictly prohibited.  If you have received this communication in error,
please notify the sender and erase this e-mail message immediately.
---------------------------------------------------------------------------


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

Reply via email to