How to set the visible property of a control in the page?
At first I thought It should be the same with the method in the classic. But when I continue, I found it wasn’t. We can not use this method: Currpage.“Page Control”.Visible := True. You will got the error:" You have specified an unkown variable. Visible". At last, I check the help documents and with a long long router, I got it. I want to share it with my friends. That’s all. Please check the solution underneath.
My steps:
Define a globe variable “IsVisible” and set its “IncludeInDataSet” property be “yes”.
Set the property visible of the control in the page be “IsVisible”
create a function SetVisible (var visible : Boolean) to set the value of the variable “IsVisible”
4.Before calling ListPage.RunModal = Action::LookupOk, I call that function first. Such as:
ListPage.SetVisible(Visible);//Visible is a local variable in the call page.
If ListPage.Runmodal = Action::LookupOk THEN BEGIN …bla.bla.bla…
It seems that we can not use this method after the initialize of the page cotrol is finished. We must use it before the initialize of the control. In my artical I assign the value for the globe variable before I call the ListPage.Runmodal.
I have the same problem. The solution is not works for List pages.
But the other solution could a convenience method, to integrate every field, what depends from a visible condition into a group. The group could use this IsVisible condition correctly, but the individual field is not. Strange. [8-)]