is it possible to change the name/header/caption from a loaded child function in a tabdialog construct at runtime; e.g. via metacode?
thanks in advance.
Nachricht geändert durch Tobias Hammerschmidt
Hello, i can not see the reply in the forum. Therefore i reply to the email… I want to change the tab text. Normally (i suggest) the text of the plex object itself is be showwn: In plex: ****.EditSuite.TabDialog.Page1 So at runtime the text of the tab ist Page1
Best regards, Tobias
RE: How to bold a tab caption
"I did discover that I can control the text for the tab in the child function using the "Set panel caption" subroutine. The global property that is used for the text is "ChildName". If I change the code in the "Set panel caption" subroutine to use "ChildName" for the "GlobalProperty" name rather than "Caption" (which is inherited), I can control the text that way."
Plex already does what you are looking for , but with the following priority.
Tab text comes from one of the following in that order.
1. If the child function has name triple , then target of the name triple is used for Tab text.
2. UnScoped name of the child function.
You will find the Action Diagram that stores Tab text in Global Memory in "Sub Load Child Site" , which you can override with your own runtime values into the Global Memory.
Hope this helps
Hi and thanks a lot for both replies.
The reply from george works fine. i can set the caption of the tab at runtime according of how many rows are loaded in a grid (e.g. Caption=Open Orders, rows fetched=2; result in tab caption: Open Orders ). That's fine.
BUT if i now change filter criteria for the grid/for the data to load, the grid Displays the "new" data but the tab caption is still "Open Orders", because (i suggest) the parent doesnt initialize the Tabs and the childs aren't loaded and set up again.
so i think the change of the text/caption of the tab doesn't work if the childs are not initialized and loaded again.
i haven't tried the Workaround from AA yet...
best regards. Tobias
Earlier reply relates to initialization of the tabs.
At the end of reload grid , prepare the caption text and call "sub Set Panel Caption".
If the Grid is in parent function, Use Trigger Event to execute "sub Set Panel Caption" in the child function.
Hi, thats exactly what i did. i call the Sub set panel caption after Sub reload grid. but the tab text didn't Change.
the grid is located in the child function and the filter functionality also. so everything is happen&handled in the child function.
if i put a push button on the child an excute the code that is in Sub set Panel caption nothing happens, too.
best regards, tobias
I know you are learning to be a Plex Developer but you still need to read the code!
you need to read the action diagram and read help, it is all there.
You need to understand the function flow which will lead you to:
Sub TabStrip add tab
------- VB Script
Set Tab = TabStrip1.Tabs.Add(&(2:),,&(1:),CInt(&(4:)))
Tab.Tag = &(3:)
The solution offered is piggy backing on the the ADDING of tabs....during initialisation ...what you want is AFTER initialisation in some circumstances...so you will need to search for the VB Script to update text (if it exists which I dont think it does), or you could reload the whole parent which is where the tabs Text is located.
TabStrip ActiveX Control
.Caption : string
Get/Set the text displayed on the tab.
Some new vbscript off the top of my head and is untested for "Microsoft TabStrip Control 6.0 (SP4)":
TabStrip1.Tabs(CInt(&(1:))).Caption = "&(2:)"
Where &(1:) is the index of the tab and &(2:) is the caption.
Then you need to Refresh the tab to see the changes I am guessing using the supplied TabStrip.Scripts.TabStrip_Refresh
And remember this is all in the Parent. You can test this by having a button on your child to trigger an event on the parent.
thank you a lot.
i will try.
but how can i Trigger a parent Event when i push a button on a child?
is it a subroutine call in the child?
ok i figured out how to...
thanks in advance. bg tobias
SetLabel script is available for other variants.
Your scrip works with plex using TabStrip control 5.0
yes, i can confirm. this works great. thanks a lot.
now the last issue is to pass back data from the child (the number of loaded lines in the grid) to the parent.
i think i can/have to handle it over the shareddata.
thanks a lot for all ideas and solutions.