Tab Enabling /Disabling by Enum value

Hi everyone,

I have an issue like having a enum ‘Myenum’ with A,B values. In my form having 3 tabs. i.e., Overview Tab, A Tab, B Tab.

In Overview tab field Myenum When i select enum Value as " A" ,then Tab ‘A’ should be enabled and Tab ‘B’ is Disabled. Vice versa. Can give the idea to process.

thanks

If you want to hide a tab completely, you can simply set its property “Visible” to No.

If you want to see the tab but disable its content, place the content to a group and set the group’s property “Enabled” to No.

Hello Jhosap,

Is the ‘Myenum’ a field in your table which is being used as a datasource in the Overview tabpage? If yes then to enable/disable the tabpages ‘A’ and ‘B’ according to the value of the ‘Myenum’ you’ll have to:

  1. Change the AutoDeclaration property of the tabpages ‘A’ and ‘B’ to Yes.

  2. Write the following code:

if(Table1.MyEnum == MyEnum ::A)

{

A.enabled(true);

B.enabled(false);

}

else

{

A.enabled(false);

B.enabled(true);

}

in the ‘active’ method of the datasource Table1

and

in the modified method of the field ‘Myenum’ of the datasource Table1 i.e. under the DataSources > Table1 > Fields > Myenum > Methods > modified.

By this the tabpages ‘A’ and ‘B’ will be enabled/disabled on the basis of value of the field ‘Myenum’ in the currently active record. Also when the value of the field ‘Myenum’ will be modified in the ‘Overview’ tabpage the tabpages ‘A’ and ‘B’ will be enabled/disabled.

If you disable a tabpage then you can see the tabpage contents but cannot edit them.