Connection Information

To perform the requested action, WordPress needs to access your web server. Please enter your FTP credentials to proceed. If you do not remember your credentials, you should contact your web host.

Connection Type

Creating tab pages only when needed – PB Docs 2021 – PowerBuilder Library

Creating tab pages only when needed – PB Docs 2021

Creating tab pages only when
needed

The user might never look at all the tab pages in your Tab
control. You can avoid the overhead of creating graphical
representations of the controls on all the tab pages by checking Create
on Demand on the Tab control’s General property page or setting the
CreateOnDemand property to TRUE.

The controls on all the tab pages in a Tab control are always
instantiated when the Tab control is created. However, when Create on
Demand is checked, the Constructor event for controls on tab pages is
not triggered and graphical representations of the controls are not
created until the user views the tab page.

Constructor events on the selected tab page

Constructor events for controls on the selected tab page are
always triggered when the Tab control is created.

Tradeoffs for Create on
Demand

A window will open more quickly if the creation of graphical
representations is delayed for tab pages with many controls. However,
scripts cannot refer to a control on a tab page until the control’s
Constructor event has run and a graphical representation of the control
has been created. When Create on Demand is checked, scripts cannot
reference controls on tab pages that the user has not viewed.

Whether a tab page has been
created

You can check whether a tab page has been created with the
PageCreated function. Then, if it has not been created, you can trigger
the constructor event for the tab page using the CreatePage
function:

You can check whether a control on a tab page has been created by
checking whether the control’s handle is nonzero. If so, the control has
been created.

Changing CreateOnDemand during
execution

If you change the CreateOnDemand property to FALSE in a script,
graphical representations of any tab pages that have not been created
are created immediately.

It does not do any good to change CreateOnDemand to TRUE during
execution, because graphical representations of all the tab pages have
already been created.

Creating tab pages
dynamically

If CreateOnDemand is FALSE, you can set the label for a
dynamically created tab page in its Constructor event, using the
argument to OpenTabWithParm that is passed to the Message object. If
CreateOnDemand is TRUE, you need to set the label when the tab page is
instantiated, because the Constructor event is not triggered until the
tab is selected. The following script in a user event that is posted
from a window’s open event opens five tab pages and sets the label for
each tab as it is instantiated:


Document get from Powerbuilder help
Thank you for watching.
Was this article helpful?
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x