New Posts New Posts RSS Feed: Read only Property
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Read only Property

 Post Reply Post Reply
Author
Matthew View Drop Down
Newbie
Newbie


Joined: 31-Jul-2007
Posts: 14
Post Options Post Options   Quote Matthew Quote  Post ReplyReply Direct Link To This Post Topic: Read only Property
    Posted: 31-Jul-2007 at 5:39pm
I'm having some trouble figuring out a few things about data binding and was hoping for some advice. 

Lets say I have two tabs, one to display the fields of my main object, and the other to display the fields of an object in a one-to-one relationship to my main object.  For example one tab for Customer info (name, address, etc) and another tab for Customer's boss info(name, title, etc)  exposed as Customer.Boss.

When I set this up with a ControlBindingManager, the Boss info is all Read-Only.  I would like to set this up so that I can edit the Boss info. 

Any suggestions as to where I should begin?


Back to Top
Matthew View Drop Down
Newbie
Newbie


Joined: 31-Jul-2007
Posts: 14
Post Options Post Options   Quote Matthew Quote  Post ReplyReply Direct Link To This Post Posted: 31-Jul-2007 at 9:27pm
Well, it appears that I really knew the answer to this, it was just well hidden under a few layers of frustration.  I used a couple of binding sources / managers to get the desired result.

Nothing to see here,
Matt
Back to Top
Linguinut View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14-Jun-2007
Location: United States
Posts: 394
Post Options Post Options   Quote Linguinut Quote  Post ReplyReply Direct Link To This Post Posted: 01-Aug-2007 at 9:23am
I know the frustration.
 
This is a good tech tip that relates to your situation: http://www.ideablade.com/techtip_Working_with_a_ReadOnlyEntityList.htm.
 
Have you read that one?
Bill
Back to Top
davidklitzke View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 14-Jun-2007
Posts: 715
Post Options Post Options   Quote davidklitzke Quote  Post ReplyReply Direct Link To This Post Posted: 01-Aug-2007 at 10:15am

I know that you say that you came up with a solution for this, but you might consider this advice, Ward gave to a customer long ago who ran into a similar problem:

This is a great question and one that developers new to DevForce often ask.
 
Your problem is that you are binding to properties of a related object.  It's true that you have done nothing to make these properties readonly, but DevForce makes access to these  properties readonly by default - for the good reason that it is unusual to want to change the value of a related object through an interface looking at the original object. Thus, while looking at an Employee, we could look at her address but we would typically change her address by popping up a dialog for that purpose or, perhaps, reserving real estate on the screen for that purpose. 
 
In addition, if you make a related  property editable, it can be confusing what the edit means.  For example, let us say that an employee's manager's name is "Nancy Davolio" and a user changes it to "Nancy Smith".  Does the employee have a new manager, or has Nancy's last name changed because she married Bob Smith.
 
If you really insist on editing a related poperty, you can set the editability of the control to "Optional".  This works, but before you go ahead and do this, ask yourself whether this is the best way to edit this related property.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down