Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
When Setall('enabled',.t.) doesn't
Message
From
15/04/2003 14:59:14
 
 
To
15/04/2003 14:53:41
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Miscellaneous
Thread ID:
00769937
Message ID:
00777945
Views:
10
If, when you set all the fields enabled, they are bound to fields in a table, and the table is not sitting on a real record, nothing will enable.

Before setting enabled, add a blank record to the table (APPEND BLANK). Then call your SetMode(.T.). You won't need to set default values for the controls since they will be set by the new blank record.

I'm guessing here that this is what you are seeing.

Alan

The form initializes and sets all fields to NOT enabled using a function called SETMODE. SETMODE uses one parameter, a logical value, which tells it whether to set enabled on or off. actually code within setmode is
>
>lparameters lMode
> thisform.setall("ENABLED",lmode)
>
>Screen is displayed with all fields turned off and Action buttons turned on. Click on edit button and
> 1) A flag for edit mode is turned to true (thisform.ledit = .t.)
> 2) setmode is called with a .T. parameter (thisform.setmode(.t.))
> 3) Action buttons are turned off and Save/Undo buttons turned on.
> 4) the focus is set to the first non-key field
>As soon as the setall line is performed, the screen displays the fields as editable!
>
>Let's close the screen and call it fresh. Screen is displayed with all fields turned off and Action buttons turned on. Click on the ADD button and:
> 1) A flag for ADD mode is turned to true (thisform.ladd = .t.)
> 2) Fields are set to empty or default values.
> 3) Setmode is called with a .T. parameter (thisform.setmode(.t.))
> 4) Action buttons are turned off and Save/Undo buttons are turned on.
> 5) The focus is set to the first non-key field.
>When the setall line is performed, nothing happens.
>
>There are NO lockscreens anywhere in the code. Both buttons use the exact same function to set the fields on. The only difference is that one function is using the current record in the table and the other is using default values. Why won't the fields turn "ON" when we move through the setall line? The line IS being hit in both instances.
>
>As I said, this does not make any sense. Any help would be appreciated.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform