Hubert Rabago wrote:
Well, since you asked.
<grin/>
The current FormDef dev build supports defining dynamic forms that
have nested properties.
https://formdef.dev.java.net/servlets/ReadMsg?list=users&msgNo=116
Awsome, I clearly need to check this out :-)
I have an article to illustrate how the new feature is used:
http://www.rabago.net/struts/formdef/dev/nested.htm
Looks good; I have a bunch of code for converting between forms and POJOs.
Looks like FormDef can replace most of it. A couple of questions based on
the article:
1) Given that FormDef is using DynaBeans / DynaForms under the covers, am I
right in assuming that form properties would need to be accessed with
expressings like ${EmployeeForm.map['address'].map['city']} outside of
Struts tags and similar BeanUtils aware contexts?
2) My usage of Struts and form beans may not be compatible with FormDef's
nested property support, based on this paragraph:
It is important to note that when using this technique,
the form bean should be prepopulated and placed in session
scope (the default setting in Struts). This allows Struts
to reuse the form definition that was initialized before
the form was created, with the employee field containing
the correct dyna properties.
The problem is, I don't do pre-population of forms: I rely on Struts to
instantiate the form bean an put it in scope (which I'm pretty sure is
request, not session, scope). I then fill the form in using a JSP tag if
necessary (i.e. the first time the form is displayed, I call a tag to
populate it).
So will the techniques described in the article work with this scheme?
FormDef can also support a collection of nested form beans, though I
haven't had the time to write up an article for that. Some
explanation for it has been provided in the FormDef user list though:
https://formdef.dev.java.net/servlets/BrowseList?list=users&by=thread&from=230908
Again based on the article, am I right in thinking that I have to write
code to use this feature (i.e. it's not purely form definition based)?
At any rate, I'll take a closer look.
Thanks,
L.
--
Laurie, Open Source advocate, Java geek and novice blogger:
http://www.holoweb.net/laurie
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]