Sync new BO record to form controls


Author
Message
Andria Jensen
Andria Jensen
Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)
Group: Forum Members
Posts: 336, Visits: 497
I have a form with a bunch of controls bound to my BO.  I want to be able to call a .Add and then sync the BO with the controls as they are on the form when the .Add is called.  Is there a way for me to do this currently?  Right now, it just sets everything to defaults when I call an Add.  In this case I want it to take on the values of the current bound control settings.
Replies
Andria Jensen
Andria Jensen
Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)
Group: Forum Members
Posts: 336, Visits: 497
Ok, picture this....I have a form with a bunch of controls bound to a BO.  I want to be able to create "templates" of that form which save different user settings.  So, I want the user to be able to basically get the controls set just as they want them and click save to save the template to a new record in the BO.  If I call the .Add this creates a new record for the template, but clears all the settings to defaults.  If I call a .NewRow this does the same thing.  I want to create a new row which will take all the user's current control settings and apply them to the new row.  Oh, I forgot to mention that I have IgnoreManageReadOnlyState set to True for all of these controls.  The user has to be able to use all of them without being in an edit/add state.  The only time I want the binding is for creating the settings template.
Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
If I were you I would just create a user control and drop the BOs on that user control and program your control to do whatever you want...your template.  Then drop this control on a form and just use the BOTranslations property to translate BO settings from one to another.  This way you have a reusable "template" that can be dropped on any form and all it needs to be updated is a BOTranslation.
Andria Jensen
Andria Jensen
Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)
Group: Forum Members
Posts: 336, Visits: 497

I'm still not sure that I explained myself very well.  I am not trying to make a BO template.  I have attached a screenshot of the form I'm working with.  This is a form which users will eventually use to do reports.  There will be many different values(controls) on the form which the user will be able to configure however they'd like for different reports.  What I want to do is save these control values(report settings) as a template.  I do this by saving the values as a record in a BO.  My problem here is that I don't know whether the user is in Add or Edit mode until they click the save button at which point I see if they have already created this template or if it's a new one.  What I'd really like is a way to have the following scenario:

User opens the form, clicks around and makes his/her changes to the form, possibly runs a report.  Then they type in a new name for the form template they are working with and click save.  This should retrieve all values from the form's controls and save them to the BO.  If they select a template from the list it should update the controls' values to that templates values. 

I guess my issue is that I don't know whether a BO should be in Add or Edit mode until the time of the Save operation.  What I need here is a way to call either of these methods, but keep the current values of the bound controls. 

I may still not make any sense to you...I will possibly just have to make this form unbound, but I hate to lose the SF binding functionalities.

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search