Geert Bevin <gbevin <at> uwyn.com> writes:

> 
> Did you try the "defaultValue" constraint?
>

Using defaultValue is straightforward for *setting* the value, but how to I 
*get* the data from a field of the associated class?  In pojo terms, I'd like 
to the have roughly:

new rx = new Perscription();
//Set up associations
rx.setDosage(mDrug.getDossage());

Actually, I think I just figured out that you can't do this.  The CRUD screen 
for the new Perscription mas dropdowns for the associated Drug and Patient, so 
we don't know those when the screen is rendered.  I'll have to look more into 
CRUD customization, this sounds like a job for a little javascript in the page, 
so that when the list changes, the defaults are set.

Thanks.

 - JT

> On 27 May 2006, at 19:40, John T wrote:
> 
> > Hello all.  I am hoping that there is an easy way to configre CRUD  
> > to use a
> > value from an associated table for the default of a new record.   
> > For example, a
> > Percription table that maps a relationship between a Patient and a  
> > Drug.  The
> > Drug would have data for typical dosage, which the Perscription  
> > would use by
> > default.
> >
> > Patient---*-Perscription-*---Drug
> >              - dosage          - typicalDosage
> >
> > So far, I am using CRUD for all data entry, and would like to keep  
> > it that way
> > for a while.
> >
> > Thanks in advance,
> >
> >  - John
> >
> > _______________________________________________
> > Rife-users mailing list
> > Rife-users <at> uwyn.com
> > http://lists.uwyn.com/mailman/listinfo/rife-users
> >
> 
> --
> Geert Bevin             Uwyn bvba               GTalk: gbevin <at> gmail.com
> "Use what you need"     Avenue de Scailmont 34  Skype: gbevin
> http://www.uwyn.com     7170 Manage, Belgium      AIM: geertbevin
> gbevin at uwyn dot com  Tel: +32 64 84 80 03   Mobile: +32 477 302 599
> 
> 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://lists.uwyn.com/mailman/listinfo/rife-users

Reply via email to