Ok Geert,

For instance I have a radio button set in the template like:

[code]
                <div class="form_field">
                        <div><h3>What is your <strong>sex</strong>?</h3></div>
                <h4></h4>
                        <div [!V 'MARK:sex'][!/V]>
                                <!--V 'ERRORS:sex' /-->
                                <!--V 'FORM:RADIO:sex'-->id="sex" 
style="vertical-align: middle;"<!--/V-->
                                
                                <!--B 'FORM:LABEL:sex:M'-->
                                <a href="javascript:doVoid();"
onclick="profile.elements['sex'][0].click();return true;">Male</a>
                                <!--/B-->
                                <!--B 'FORM:LABEL:sex:F'-->
                                <a href="javascript:doVoid();"
onclick="profile.elements['sex'][1].click();return true;">Female</a>
                                <!--/B-->
                                <!--B 'FORM:LABEL:sex:X'-->
                                <a href="javascript:doVoid();"
onclick="profile.elements['sex'][2].click();return true;">None</a>
                                <!--/B-->
                        </div>
                </div>
[/code]

and the corresponding java code in processElement is:

[code]
tt.getBeanHandler().getFormBuilder().generateField(tt,
                                new ConstrainedProperty("sex").inList(new 
String[] {"M", "F",
"X"}), null, "");
[/code]

This works when the page/form is first loaded as I explained in the
earlier mail.

However, after a submission, I want to do

[code]
                if (bean.validate()) {
                        //do stuff
                } else {
                        generateForm(tt, bean);
                }
[/code]

How can I do this, and get the collections (radio/select) fields to be
generated again.... as it stands it returns a blank field for the
collections.

I tried a forced processElement call, both *before* and *after* the
generateForm call, but that does not seem to help either.

Thanks,
Emmanuel


On 11/7/05, Geert Bevin <[EMAIL PROTECTED]> wrote:
> Hi Emmanuel,
>
> can you give some code excerpts of the things that you're doing? That
> makes it easier to talk about.
>
> Best regards,
>
> Geert
>
> On 7-nov-05, at 17:43, Emmanuel Okyere wrote:
>
> > Geert,
> >
> > Could you give an example of how best to use 'generateForm' and
> > Collection fields?
> >
> > I have a form that has a radio button set, and a couple of select
> > lists that are being generated with no problem when the page/form is
> > loaded, however after a submission, when I call
> >
> > [code]
> > generateForm(template, bean)
> > [/code]
> >
> > the new form does not print the Collection fields.
> >
> > I have tried making the
> >
> > [code]
> > generateField(template, constrainedProperty)
> > [/code]
> >
> > call on the collection fields (which is what I do initially, to get
> > them generated), both before and after generateForm call with no
> > results.
> >
> > Any pointers?
> >
> > Thanks,
> > Emmanuel
> > _______________________________________________
> > Rife-users mailing list
> > Rife-users@uwyn.com
> > http://www.uwyn.com/mailman/listinfo/rife-users
> >
>
> --
> 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
> Rife-users@uwyn.com
> http://www.uwyn.com/mailman/listinfo/rife-users
>
_______________________________________________
Rife-users mailing list
Rife-users@uwyn.com
http://www.uwyn.com/mailman/listinfo/rife-users

Reply via email to