Hi Emmanuel,
I think I have a feeling that I know where the misunderstanding lies.
What I have noted is, as this is the same set of Constraints I was
placing on it initially, the problem seems to be with the dynamically
generated resources attached to the template..
so that while the following code in the implementation
[code]
tt.getBeanHandler().getFormBuilder().generateField(tt,
new ConstrainedProperty("sex").inList(new String[] {"M", "F",
"X"}), null, "");
[/code]
This code explicitly generates that particular field at a given time.
It does add the constraint to the bean instance.
worked when the page loaded, but failed to generate the collection
after a submission (with generateForm), the following in the bean
I suspect that is the reason why it doesn't work after you generate
the form from the bean instance. As far as the bean is concerned,
this is a regular property without a collection, so the form field is
generated in that fashion.
[code]
addConstraint(new CmfProperty(SEX).inList(new String[] {"M", "F",
"X"}));
[/code]
I suggest that you simply do:
bean.addConstraint(new CmfProperty(SEX).inList(new String[] {"M",
"F", "X"}));
in processElement() instead of generating the field explicitly. That
should give you the dynamic behavior, but with it being tied to the
bean instance.
works perfectly both on page load and after submission. Can you
comment on the difference?
Also, on the same form, I have a date dropdown list that I am
generating dynamically, and using the following code
[code]
template.addResourceBundle(new ListResourceBundle() { blah
[/code]
to add to the template, in the implementation. That *still* doesn't
work; that is, it generates the dropdown on page load, but fails to do
so after a submission... and this comes back to the dynamic (in
implementation) versus static (in bean class) scenario I mentioned
earlier.
I suspect that this is the same reason.
Tell me if that did it.
Best regards,
Geert
--
Geert Bevin Uwyn bvba
"Use what you need" Avenue de Scailmont 34
http://www.uwyn.com 7170 Manage, Belgium
gbevin[remove] at uwyn dot com Tel +32 64 84 80 03
PGP Fingerprint : 4E21 6399 CD9E A384 6619 719A C8F4 D40D 309F D6A9
Public PGP key : available at servers pgp.mit.edu, wwwkeys.pgp.net
_______________________________________________
Rife-users mailing list
[email protected]
http://www.uwyn.com/mailman/listinfo/rife-users