Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Setting Default Value on New
Message
De
29/04/2013 10:49:15
 
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Divers
Thread ID:
01572104
Message ID:
01572161
Vues:
32
>Frank,
>
>>I have a Receipt BO which has code to set the default date of the BO to the current date. Works fine. The client has now asked me to default the Receipt date to the last Receipt date entered on my form.
>>
>>I've created a property of the window called lastDate and set it initially to the current date.
>>
>>Then in my New button's click method I:
>>
>>this.Receipt.Entity.rct_date = lastDate;
>>
>>In my window's HookPostSave I do this:
>>
>>lastDate = this.Receipt.Entity.rct_date;
>>
>>But whenever I add a new Receipt it still shows up as today's date.
>>
>>Any ideas where I am going wrong?
>
>I recommend setting a breakpoint on the entity property that triggers whenever the value has changed. Either the current date value is not getting set initially or you are overwriting the current date with today's date later on in the cycle.
>
>Best Regards,

Kevin,

I've just realised that I have this same problem in 3 other windows, all using the date picker. the date fields never seem to get the value of the selected date.

< update >

If I manually set the entity's date value in the datepicker's selected date changed code, then it works as expected (except of course that the framework thinks the data has been edited and prompts to save when I move to another record). Should this be normal? I thought the binding should work.
Frank.

Frank Cazabon
Samaan Systems Ltd.
www.samaansystems.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform