Plex 2E

Expand all | Collapse all

Dynamic TabDialog-Child Name, Change TabChild caption at Runtime

  • 1.  Dynamic TabDialog-Child Name, Change TabChild caption at Runtime

    Posted Feb 16, 2016 09:57 AM

    Hello all,

     

    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.

     

    Tobias H.

     

    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



  • 2.  Re: Dynamic TabDialog-Child Name, Change TabChild caption at Runtime

    Posted Feb 16, 2016 01:02 PM

    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."



  • 3.  Re: Dynamic TabDialog-Child Name, Change TabChild caption at Runtime

    Posted Feb 16, 2016 02:42 PM

    Hello,

     

    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

    Regards

    AA



  • 4.  Re: Dynamic TabDialog-Child Name, Change TabChild caption at Runtime

    Posted Feb 16, 2016 03:27 PM

    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[2] ). 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[2]", 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.

     

    any ideas?

     

     

    i haven't tried the Workaround from AA yet...

     

    best regards. Tobias



  • 5.  Re: Dynamic TabDialog-Child Name, Change TabChild caption at Runtime

    Posted Feb 16, 2016 03:52 PM

    Hi,

     

    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.

     

    Regards

    AA



  • 6.  Re: Dynamic TabDialog-Child Name, Change TabChild caption at Runtime

    Posted Feb 16, 2016 04:42 PM

    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



  • 7.  Re: Dynamic TabDialog-Child Name, Change TabChild caption at Runtime

    Posted Feb 17, 2016 02:36 AM

    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.



  • 8.  Re: Dynamic TabDialog-Child Name, Change TabChild caption at Runtime

    Posted Feb 17, 2016 02:52 AM

    TabStrip ActiveX Control

     

    .Tabs Properties:

    .Caption : string

    Get/Set the text displayed on the tab.



  • 9.  Re: Dynamic TabDialog-Child Name, Change TabChild caption at Runtime
    Best Answer

    Posted Feb 17, 2016 02:57 AM

    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.



  • 10.  Re: Dynamic TabDialog-Child Name, Change TabChild caption at Runtime

    Posted Feb 17, 2016 03:20 AM

    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



  • 11.  Re: Dynamic TabDialog-Child Name, Change TabChild caption at Runtime

    Posted Feb 17, 2016 05:27 AM

    SetLabel script is available for other variants.



  • 12.  Re: Dynamic TabDialog-Child Name, Change TabChild caption at Runtime

    Posted Feb 17, 2016 05:40 AM

    Hey George,

     

    Your scrip works with plex using TabStrip control 5.0

     

     

    Regards

    AA



  • 13.  Re: Dynamic TabDialog-Child Name, Change TabChild caption at Runtime

    Posted Feb 17, 2016 02:16 PM

    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.

     

    best regards, tobias