StrataFrame Forum
Home      Members   Calendar   Who's On
Welcome Guest ( Login | Register )
      



Populating a DropDownList with a Business...Expand / Collapse
Author
Message
Posted 09/10/2007 11:34:55 AM
StrataFrame Novice

StrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame Novice

Group: StrataFrame Users
Last Login: 03/03/2008 1:40:52 PM
Posts: 72, Visits: 235
I'm having some trouble getting a DropDownList to populate from a business object. I can get the page to load, but nothing shows in the object.

The business object is getting populated with the four records from the database to indicate a type, but these same four records aren't being transferred into the DropDownList.

1) PopulationType = "BusinessObject"
2) I've tried setting the "Method to Execute" option for PopulationDataSourceSettings to "Add()" and "Refresh()"
3) I've tried various combinations of settings for "PopulateOnPostBack" and "BindingDirection"
4) The same DropDownList is bound to a second business object where the unique key from the child business object is put into the foreign key field.

The binding piece doesn't seem to be a problem, but it keeps showing a blank drop down list. Is there something I'm missing? Something in my code to kick off populating the list?

Thanks for any help!

Peter
Post #11404
Posted 09/10/2007 1:20:50 PM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: 09/26/2008 8:30:36 AM
Posts: 2,685, Visits: 1,886
Yep, the root of the problem is the MethodToExecute.  When you use the SF list population, we create a new business object of the specified type behind the scenes and call the MethodToExecute on it to populate it; the list is then populated from this business object.  So, try changing your method to execute to a Fill method or a CopyDataFrom method to get the data into the business object we create behind the scenes.  And if you need to pass any parameters to the method, check out the ListPopulating event and pass the values into the collection on the event args.


www.bungie.net
Post #11406
Posted 09/11/2007 7:42:33 AM
StrataFrame Novice

StrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame Novice

Group: StrataFrame Users
Last Login: 03/03/2008 1:40:52 PM
Posts: 72, Visits: 235
Ben Chase (09/10/2007)
Yep, the root of the problem is the MethodToExecute. When you use the SF list population, we create a new business object of the specified type behind the scenes and call the MethodToExecute on it to populate it; the list is then populated from this business object. So, try changing your method to execute to a Fill method or a CopyDataFrom method to get the data into the business object we create behind the scenes. And if you need to pass any parameters to the method, check out the ListPopulating event and pass the values into the collection on the event args.


Hmm.. Well, not how I ended up going about it, but I guess there's more than one way to skin a cat.

I ended up tweaking my BusinessLogicLayerManager (BLLM) dictionary to filterthe business object better and then looped through it to add the items to the list. It probably wasn't the cleanest way, but it worked and I'm getting the result I wanted. I'll have to figure your method out when I'm not under a time crunch.

Thanks for the info!

Peter
Post #11416
Posted 09/11/2007 1:19:41 PM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: 09/26/2008 8:30:36 AM
Posts: 2,685, Visits: 1,886
You can also use the DataSource, DataTextField, DataValueField, and DataBind() members.  You would then get a business object the way you want it, set the CurrentDataTable or the CurrentView as the DataSource, set the column name for the DisplayTextField and DataValueField properties and call DataBind().  That's the basic way to bind a list to the data source in the .NET web controls.


www.bungie.net
Post #11433
« Prev Topic | Next Topic »


Reading This TopicExpand / Collapse
Active Users: 0 (0 guests, 0 members, 0 anonymous members)
No members currently viewing this topic.
Forum Moderators: Ben Chase, Trent L. Taylor, Steve L. Taylor

PermissionsExpand / Collapse

All times are GMT -6:00, Time now is 10:34pm

Powered by InstantForum.NET v4.1.4 © 2008
Execution: 0.125. 10 queries. Compression Enabled.
Site Map - Home - My Account - Forum - About Us - Contact Us - Try It - Buy It

Microsoft, Visual Studio, and the Visual Studio logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries.