Almost.
NeXt is only working off of Bean properties, and as with all beans, it 
doesn't care as to what goes on behind those method definitions. The 
constructor is one of those details it cares not about.

So as long as the simper beans have bean property conformity (eg: 
getMyProperty, setMyProperty) then the beans are ready to go with NeXt 
as they are wihout mods. I'd be very surprised if it needed mods, 
really. You can use Castor types straight up because the properties are 
valid bean properties.

A nested bean is simply one object that is returned by the method of 
another. As each property getter method has "get" on the front of it, 
we're laughin'. At the point of changing a property, you'll need that 
"set" on the front of it, naturally. For example, to get the nesting 
level deeper in my Monkey examples, I had a "fake" nested property that 
returned "this".

eg:
public MonkeyBean getOtherMonkey() { return this; }

To the internals of BeanUtils (the part of Struts that makes it all 
happen), it's treated as an entirely different object. It makes no other 
assumptions, rightly so. The system is that explicit.

Just give it a bash. Run a simper model through the NeXt tags. I lay my 
money on it working as-is.

Arron.


John Menke wrote:

> I'm working through the Simper examples and the NeXt examples and 
> trying to
> understand how I can use both together. Here is what I have so far:
>
>
> In the NeXt you associate nested beans with a parent and children
> relationship by inserting a private member variable to the parent bean 
> the
> will create a new child bean:
>
> ie.
>
> <snip - from MonkeyStruts Tutorial>
>
> private BunchBean bunchBean = new BunchBean();
>
>
> This will give us a new instance of the BunchBean when this MonkeyBean is
> created. Just what we want. Now we need to provide the getter method 
> to the
> bean under the property name "pickedBunch". This will create a getter 
> which
> will look something like this example...
>
> Example...
>    public BunchBean getPickedBunch() {
>      return this.bunchBean;
>
> </snip>
>
> This enables you to make forms like this:
>
> <snip - from MonkeyStruts Tutorial>
>
> <html:form action="/action-tutorial.do">
>    Monkey Name: <nested:text property="monkeyName" /><br>
>    Monkey Age: <nested:text property="monkeyAge" /><br>
>    <br>
>    <nested:nest property="pickedBunch">
>      Bunch Size: <nested:text property="bunchSize" /><br>
>      Bunch Weight: <nested:text property="bunchWeight" /><br>
>      Bunch Price: <nested:text property="bunchPrice" /><br>
>    </nested:nest>
>
>    <br>
>    <html:submit>Submit Form</html:submit>
>  </html:form>
>
> </snip>
>
> In order to use the NeXt with Simper it looks like the SimperBeans 
> will need
> to include methods like those above in order to establish the 
> relationship.
>
> Is this correct? If so, Simper will not work with the NeXt in it's 
> current
> form.
>
> I think if this can be coded Simper should be able to dynamically 
> update the
> contents of a database since the nested beans have their Set methods 
> called
> automatically since they are nested within the ActionForm bean?  
> (Aaron is
> this correct?)
>
> Inserts into the database will require creation of a new bean and can be
> handled by logic in the Action that will create a SimperBean with
> information obtained from the ActionForm.
>
> It says in the Simper source code comments that deletes happen
> automatically.  I'm not sure at the moment how this is going to work.  I
> think you could call the Simper delete method from an Action but not sure
> how the automatic part effects this.  Does the automatic feature of 
> deletes
> in Simper just mean that you don't have to call the writechanges() 
> method in
> Simper?
>
>
> Any comments and additions will be appreciated.  In my opinion, the
> integration of these two struts additions could be extremely useful.
>
> Bryan, (If we have to) do you think it's worth adding some code to 
> Simper to
> integrate with the NeXt?
>
> -john 




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

Reply via email to