Manipulating the Business Object's DataTable


Author
Message
Keith Harvey
Keith Harvey
StrataFrame Beginner (22 reputation)StrataFrame Beginner (22 reputation)StrataFrame Beginner (22 reputation)StrataFrame Beginner (22 reputation)StrataFrame Beginner (22 reputation)StrataFrame Beginner (22 reputation)StrataFrame Beginner (22 reputation)StrataFrame Beginner (22 reputation)StrataFrame Beginner (22 reputation)
Group: Forum Members
Posts: 18, Visits: 75
In my web application - as an alternate binding technique - I can easily access the SF business object's DataTable and manually bind my various UI controls to it.

Once the user edits the data in the UI and the page posts back - how can I get those changes back into the SF business object's DataTable in an efficient way?  Once the changes are back into the object's DataTable, will SF then do its magic when I call the Save() method?

Cheers!

Keith

Keith Chisarik
Keith Chisarik
StrataFrame VIP (1.6K reputation)StrataFrame VIP (1.6K reputation)StrataFrame VIP (1.6K reputation)StrataFrame VIP (1.6K reputation)StrataFrame VIP (1.6K reputation)StrataFrame VIP (1.6K reputation)StrataFrame VIP (1.6K reputation)StrataFrame VIP (1.6K reputation)StrataFrame VIP (1.6K reputation)
Group: StrataFrame Users
Posts: 939, Visits: 40K
Good question. I was doing exactly the opposite today in a Winform, I didn't want the changes in the datatable to make it back to the BO so I used the datatable's copy() method to create a new unique instance of the datatable for each UI element that could then function independently.



I had to go through that because changes to the BO's datatable always caused databound events to fire that I didn't want.



I will be interested how this works through postback in a web app.








Keith Chisarik
Greg McGuffey
Greg McGuffey
Strategic Support Team Member (3.5K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
Hmmm... I'm guessing that this would work. I know that the BO determines if it's dirty by looking at the underlying datatable and if any row is changed, it is dirty. I also know that typically, the Save() updates the UI. But I've not done any web stuff, so I don't know if the web version of the save is different. I'm curious now too! Hehe
StrataFrame Team
S
StrataFrame Developer (4.6K reputation)StrataFrame Developer (4.6K reputation)StrataFrame Developer (4.6K reputation)StrataFrame Developer (4.6K reputation)StrataFrame Developer (4.6K reputation)StrataFrame Developer (4.6K reputation)StrataFrame Developer (4.6K reputation)StrataFrame Developer (4.6K reputation)StrataFrame Developer (4.6K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
If you manually bind to a DataTable, I think the page will try to place the data table into the page's ViewState and recreate it when the page posts back.  So, when the page posts back, you might end up with the bound DataTable being a different instance than the DataTable within the BO that is saved off in a session somewhere.  You also might consider using an ObjectDataSource to bind the business object if you don't want to use the SF data binding.
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