Author |
Share Topic Topic Search Topic Options
|
antalakas
Newbie
Joined: 25-Jun-2007
Location: Greece
Posts: 28
|
Post Options
Quote Reply
Topic: DataForm Lookup Fields Posted: 05-Apr-2009 at 4:31pm |
Is it possible to use a Dataform with Devforce SL and create look-up comboboxes in the dataform?
I need a similar functionality like the one described here:
Thank you
Edited by antalakas - 05-Apr-2009 at 4:33pm
|
Andreas Ntalakas
|
|
BenHayat
Groupie
Joined: 06-Jan-2009
Location: Estero, FL USA
Posts: 86
|
Post Options
Quote Reply
Posted: 06-Apr-2009 at 7:13am |
I'll add my vote to add some sample how to populate combobox at runtime with DevForce! Thanks!
|
|
|
ting
IdeaBlade
Joined: 27-Mar-2009
Location: San Francisco
Posts: 427
|
Post Options
Quote Reply
Posted: 08-Apr-2009 at 12:24pm |
It's on our list now. Thanks!
|
|
BenHayat
Groupie
Joined: 06-Jan-2009
Location: Estero, FL USA
Posts: 86
|
Post Options
Quote Reply
Posted: 08-Apr-2009 at 1:14pm |
Thank you Sir!
|
|
|
bigfish
Newbie
Joined: 20-Mar-2009
Location: Australia
Posts: 36
|
Post Options
Quote Reply
Posted: 06-Aug-2009 at 5:58pm |
I'm also looking for a clear example on how to do this please.
|
|
WardBell
IdeaBlade
Joined: 31-Mar-2009
Location: Emeryville, CA,
Posts: 338
|
Post Options
Quote Reply
Posted: 24-Aug-2009 at 2:52pm |
It's coming. It's not a DevForce problem per se; more of a Silverlight WTF. But we'll be giving some guidance.
Meanwhile, for inspiration look at Explorer.FormViewModelHolder in ModelExplorer and PrismExplorer. It addresses the same problem of needing access to the ViewModel of an outer control when you're inside a nested control and something changed the DataContext on the way through those control layers.
The next version of FormViewModelHolder will inherit from Dan's DataContextProxy, eliminating some of my hook up code.
|
|
antalakas
Newbie
Joined: 25-Jun-2007
Location: Greece
Posts: 28
|
Post Options
Quote Reply
Posted: 25-Aug-2009 at 1:39am |
Ward, thank you for your attention. I noticed this article last night after returning for vacation and i think it would be great to include DataContextProxy class in PRISM explorer.
A
|
Andreas Ntalakas
|
|
WardBell
IdeaBlade
Joined: 31-Mar-2009
Location: Emeryville, CA,
Posts: 338
|
Post Options
Quote Reply
Posted: 25-Aug-2009 at 2:32am |
@antalakas - Agreed. It will be in the next release of ME and PE (PrismExplorer) ... which will coincide with our DevForce 5.2.2 release coming up next week.
|
|
pholloway
Newbie
Joined: 13-Sep-2009
Posts: 4
|
Post Options
Quote Reply
Posted: 18-Sep-2009 at 3:08pm |
Not using a dataform --
What is the best quick way to make a Silverlight combo box do something actually useful - like display items from a lookup table, set the selected item to be the value associated with a customer record, and save the selected item's value back to the DB, for example?
Surely there is an easy way to do this?
Thanks.
|
|
GregD
IdeaBlade
Joined: 09-May-2007
Posts: 374
|
Post Options
Quote Reply
Posted: 25-Sep-2009 at 1:52pm |
I wired up a ComboBox in the DataGrid in MainFormIntermediate in the solution for the FourSimpleSteps tutorial. It's bound to an Order's Customer, and displays the complete list of Customers to choose from.
The ComboBox there is just an ordinary one, used inside a DataEditingTemplate within the DataGrid column, so I believe the wiring would be similar used in a DataForm, or stand-alone.
|
|
pholloway
Newbie
Joined: 13-Sep-2009
Posts: 4
|
Post Options
Quote Reply
Posted: 29-Sep-2009 at 10:43am |
Thanks Greg, this is helpful. I see that you are loading Customer records into an ObservableCollection of Customers and binding that to the combobox. Now if you wanted to persist a changed Order record, is it a simple matter of calling Save against the entity manager -- in other words, is the FK relationship with Customer handled automagically, or do we need to do some extra stuff first?
Thanks again.
|
|
GregD
IdeaBlade
Joined: 09-May-2007
Posts: 374
|
Post Options
Quote Reply
Posted: 29-Sep-2009 at 12:54pm |
Originally posted by pholloway
if you wanted to persist a changed Order record, is it a simple matter of calling Save against the entity manager -- in other words, is the FK relationship with Customer handled automagically, or do we need to do some extra stuff first?
|
That's all under your control. The safest -- and easiest -- thing to do is always to save all changes in your cache (orders, order line items, customers, products, everything) at the same time. That way, you don't accidentally save just part of a conceptual entity that spans more than one entity type (like an Order and its line items) and thus get data integrity issues. On the other hand, there are use cases for saving only part of the cache, from a single entity on up, and you have the mechanisms to control exactly what gets submitted for a save. Under those circumstances, you have to take responsibility yourself to ensure that you don't create data integrity problems.
|
|
pholloway
Newbie
Joined: 13-Sep-2009
Posts: 4
|
Post Options
Quote Reply
Posted: 29-Sep-2009 at 1:10pm |
Greg, yeah, I'm definitely looking for "safest and easiest" at this point. Coming from a background of using stored procedures to do the heavy lifting, that model makes the most conceptual sense to me. Thanks!
|
|