Hmmm... Group doesn't seem to be defined as a element type for the Submission .. but it is on the bean element,

<bean classname="com.zeitgeist.nela.model.Account" group="ContactInfo"/>
which works.  Thanks!

So the rundown (so others can find it in the list, and I'll add it to the wiki later) is as follows:

To work with a bean whose data will be filled in by several different forms:

1) Define different constraint groups (either in your model bean or in a separate MetaData class) for each collection of member
           variables that will be processed by the different forms.

2) Define the constraint group in the submission portion of your form's element as part of the submission's bean declaration, e.g.:

<element id="ContactInfo" implementation="path.to.FormHandlerClass" >
            <submission name="update" >
<bean classname="path.to.your.model.Account" group="ContactInfo"/>
            </submission>
        </element>

which narrows the submission's scope down to fields validated by this one group of constraints

3) In the class that processes the form, set the focus of the validation onto the constraint group you declared in the element declaration, and use the version of fillSubmissionBean that takes a submission name param which will tell RIFE which parameters from the form are of interest and to be filled in to the bean instance while leaving any others unchanged.
        E.g.:

        public void doUpdate() {
            account.focusGroup("ContactInfo");
            fillSubmissionBean("update", account);
            if (account.validateGroup("ContactInfo")) { // good!
                account.setModification_dt(new java.util.Date());
                int result = accountQM.update(account);
                template.clear();
                account.resetValidation();
                print(template);
            } else { // bad.  if at first you don't succeeed...
                processElement();
                }
    }


I think that should be reasonably complete...

_David

On Apr 21, 2007, at 8:58 AM, Geert Bevin wrote:

Give it the submission name:
http://rifers.org/docs/api/com/uwyn/rife/engine/ ElementSupport.html#fillSubmissionBean(java.lang.String,% 20java.lang.Object)

and add the group to the submission declaration:

<submission name="blah" group="grp">

Hope this helps,

Geert

On 21 Apr 2007, at 14:50, David HM Spector wrote:


Hi Geert,

My constraint groups were indeed checking the values properly, the form was getting marked up correctly, the only difference was the use of the focusgroup() method, which didn't seem to make a difference ... when fillSumbmissionBean() executes, it still takes out the existing data...

http://rifers.org/paste/show/4434

Obviously I am not grokking something...


David

On Apr 21, 2007, at 3:20 AM, Geert Bevin wrote:

Hi David,

You need to use constraint groups:
http://rifers.org/wiki/display/RIFE/Validation#Validation-3

Then, when you setup the submission, you can provide the name of the group. Only the data in that group will be filled in and/or blanked.

Hope this helps,

Geert

On 21 Apr 2007, at 05:47, David HM Spector wrote:

Ran into an interesting problem this evening, not sure how to get around it:

As part of my registration process users have to give me a certain set of information, such as email address, a password, and their full name,

Given these pieces of info, they can register and access the system. However there is a lot more in my "Account" bean that isn't necessary to register, but might be useful for them to fill in later for use in larger aspects of the system (address, phone #, billing info for enhanced services, etc)

The validation is done in two different validation groups, one for the info required at registration time, the other to handle the user profile member variables.

when I made a form (the "user profile") to deal with setting the rest of the data, I can read the Account bean back in and all the data originally set there when the user registered is there; however, once the user fills in the User Profile form (address, etc) the existing data in the bean gets wiped after the fillSubmissionBean()
call and only the "new" data is in the bean.

is there something that needs to be set to keep the existing data in the bean...?

David
------------------------------------------------------------------- ------------------------
                                          David HM Spector
spector (at) zeitgeist.com http://www.zeitgeist.com/
                                                    ~ ~ ~
"New and stirring things are belittled because if they are not belittled, the humiliating question arises, 'Why then are you not taking part in them?'" --H. G. Wells

_______________________________________________
Rife-users mailing list
Rife-users@uwyn.com
http://lists.uwyn.com/mailman/listinfo/rife-users

--
Geert Bevin
Terracotta - http://www.terracotta.org
Uwyn "Use what you need" - http://uwyn.com
RIFE Java application framework - http://rifers.org
Music and words - http://gbevin.com


_______________________________________________
Rife-users mailing list
Rife-users@uwyn.com
http://lists.uwyn.com/mailman/listinfo/rife-users

--------------------------------------------------------------------- ----------------------
                                          David HM Spector
spector (at) zeitgeist.com http://www.zeitgeist.com/ voice: +1 631.261.5013 fax: +1 212.656.1443
                                                    ~ ~ ~
"New and stirring things are belittled because if they are not belittled, the humiliating question arises, 'Why then are you not taking part in them?'" --H. G. Wells

_______________________________________________
Rife-users mailing list
Rife-users@uwyn.com
http://lists.uwyn.com/mailman/listinfo/rife-users


--
Geert Bevin
Terracotta - http://www.terracotta.org
Uwyn "Use what you need" - http://uwyn.com
RIFE Java application framework - http://rifers.org
Music and words - http://gbevin.com


_______________________________________________
Rife-users mailing list
Rife-users@uwyn.com
http://lists.uwyn.com/mailman/listinfo/rife-users

------------------------------------------------------------------------ -------------------
                                          David HM Spector
spector (at) zeitgeist.com http://www.zeitgeist.com/ voice: +1 631.261.5013 fax: +1 212.656.1443
                                                    ~ ~ ~
"New and stirring things are belittled because if they are not belittled, the humiliating question arises, 'Why then are you not taking part in them?'" --H. G. Wells

_______________________________________________
Rife-users mailing list
Rife-users@uwyn.com
http://lists.uwyn.com/mailman/listinfo/rife-users

Reply via email to