Re: PropertySelection populated from database

2006-12-30 Thread galpi06

Oh right ... I get it. Thanks a lot. I'll use the ISO codes.

Happy new year guys,

galpi


 There is a standard ISO code for countries.  I'd use that.


 On 12/30/06, RonPiterman [EMAIL PROTECTED] wrote:
 yes, this is the case if you use list index as value in your model. This
 should only be done if you know the list will not change across
 requests. If it does, use a databse primary key, and reload the entry
 from the database on the translate method in the model.
 Cheers and happy new year,
 Ron



 [EMAIL PROTECTED] wrote:
  Hi folks,
 
  I'm fetching a list of countries from a mysql database to populate a
  PropertySelection inside a form. So let's say you have:
 
  option 0 : Canada
  option 1 : US
 
  If the list of countries in the database changes before the user
 submits
  the form, the wrong selection may get submitted ! For example, if the
 user
  selected 'US', Mexico gets added, and user submits the form, 'Mexico',
 not
  'US' gets submitted. The reason is that when the form submits the
 property
  selection gets re-populated with :
 
  option 0 : Canada
  option 1 : Mexico
  option 2 : US
 
  So option 1 got submitted on an updated list and the wrong country
 is
  submitted. Is there a workaround to this ?
 
  Many thanks,
 
  galpi
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



PropertySelection populated from database

2006-12-29 Thread galpi06
Hi folks,

I'm fetching a list of countries from a mysql database to populate a
PropertySelection inside a form. So let's say you have:

option 0 : Canada
option 1 : US

If the list of countries in the database changes before the user submits
the form, the wrong selection may get submitted ! For example, if the user
selected 'US', Mexico gets added, and user submits the form, 'Mexico', not
'US' gets submitted. The reason is that when the form submits the property
selection gets re-populated with :

option 0 : Canada
option 1 : Mexico
option 2 : US

So option 1 got submitted on an updated list and the wrong country is
submitted. Is there a workaround to this ?

Many thanks,

galpi


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]