I have a persistent bean with a "created time" property. I want to set it once at creation time then never touch it again.

In my handler for a form to edit the bean in question, I have the equivalent of this:

   bean = queryManager.restore(getInputInt("beanId"));
   fillSubmissionBean(bean);
   if (bean.validate()) {
      ... save it ...
   } else {
      generateForm(template, bean);
      print(template);
   }

When I try to call fillSubmissionBean() in a handler for a form that doesn't include a field for the creation time, RIFE nulls out the creation time rather than leaving it alone. That causes my validation to fail (the property has a notNull(true) constraint) and I get a "mandatory" message in my form's error section, not attached to any field.

I've tried fiddling with the likely-looking constraints on this property, though not exhaustively. A bunch of the properties in ConstrainedProperty aren't really documented in the Javadoc; is there a list somewhere of what all the constraints do? In particular, I thought "editable", "saved", and "persistent" might be relevant, but the Javadoc doesn't describe what any of them do. None of them appear to do the trick (though I didn't try them in combination.)

Bottom line: is there any way to get fillSubmissionBean() to leave a property alone? I really don't want to ship this property out to the user's web browser and back to the server. As a workaround I'm filling in the remaining properties one at a time in my code, which works fine but kind of defeats the purpose of having bean-based form submission.

-Steve
_______________________________________________
Rife-users mailing list
[email protected]
http://lists.uwyn.com/mailman/listinfo/rife-users

Reply via email to