set entityfield to readonly

Posts   
 
    
zaad
User
Posts: 19
Joined: 13-Sep-2005
# Posted on: 06-Mar-2006 21:12:32   

Hi,

Is there a simple way of disabling a bound control via the bound entity? For instance, I want to disable editing of a certain entityfield NOT by setting the readonly property of the bound control to true in the UI-layer, but by setting something in the Business-Layer which also affects all the bound controls in the UI-layer.confused

Greetz,

Zaad

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39930
Joined: 17-Aug-2003
# Posted on: 06-Mar-2006 21:32:43   

You want to switch it to readonly, based on some rule? You can build that into the Validator object set in the Entity, which is called when a field is set. You can there return false if you don't want the field to be set.

But I'm not sure in which context you want to use this, so if you could elaborate on that abit, it would be great simple_smile

Frans Bouma | Lead developer LLBLGen Pro
zaad
User
Posts: 19
Joined: 13-Sep-2005
# Posted on: 06-Mar-2006 21:48:46   

You want to switch it to readonly, based on some rule? You can build that into the Validator object set in the Entity, which is called when a field is set. You can there return false if you don't want the field to be set.

I know. But I would like the bound control to have its read-only property set to true, so users cannot attempt to set the field.

Isn't there a way to do that through the object bound to the controlconfused

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39930
Joined: 17-Aug-2003
# Posted on: 06-Mar-2006 22:42:42   

If the validator returns false (the <entityname>Validator class that is), the value is rejected and not set.

Frans Bouma | Lead developer LLBLGen Pro