On Sep 7, 2009, at 6:41 AM, Jacek Kałucki wrote:

>>      If you mean that a value must meet any other criteria, then that's a
>> business rule.
>
> No, I have dropdown list and related radio list that depend each  
> other,
> none of them is dependent any element of database, except the
> presentation layer.
> I think, that form mediation in validating business objects is very  
> god
> move, but there is not enough flexibility.


        I think what you are calling 'validation' is instead more like  
updating the form's state. Would something like this work?

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
[form code]
dropdown = dabo.ui.dDropdownList(self, ..., RegID="myDD",
        OnValueChanged=self.evalState)
radio = dabo.ui.dRadioList(self, RegID="myRadio")
...

def evalState(self, evt):
        self.myRadio.Enabled = (self.myDD.Value == "some condition")

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

        I would suggest disabling the control is preferable to having it  
remain normal-looking, but not allow the user to change the value  
programmatically. If it's disabled, the user knows it can't be  
changed; otherwise, they'll be frustrated clicking on things while  
your program prevents a change.
        

-- Ed Leafe





_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: 
http://leafe.com/archives/byMID/[email protected]

Reply via email to