Plex 2E

Expand all | Collapse all

Tabs in Java & dynamically name of the tab

Jump to Best Answer
  • 1.  Tabs in Java & dynamically name of the tab

    Posted 12-17-2018 12:14 PM

    Hello everybody,

     

    we are using the standard tab construct offered by plex in the java variant.

     

    this works fine.

     

    is it possible to change the name of the tab dynamically?

     

    thank you for any tips.

     

    best wishes, tobias



  • 2.  Re: Tabs in Java & dynamically name of the tab
    Best Answer

    Posted 12-27-2018 02:47 AM

    TabStrip.Scripts

     

    TabStrip.Scripts

    Receives a Tab number and a TabText and sets the label on that Tab.

    • FIELDS/Tab – tab identifier

    • FIELDS/TabText – selected tab text

    Tab_SetLabel
    PVTab_SetLabel

     

    {
    pv.awt.PVTab tab=(pv.awt.PVTab)ObUserAPI.getComponentFromName(getFunction(), new ObCharFld("*Current"), &(1:).toString());
    tab.setLabelAt(&(3:).toString(), &(2:).getValue()-1);
    }



  • 3.  Re: Tabs in Java & dynamically name of the tab

    Posted 12-28-2018 02:59 AM

    Thank you.

     

    We got it, too.

     

    We have to change the FIELDS/TabText and then remove the tab and add the tab.

     

    Only with removing the tab and adding it again the caption changed...

     

    best wishes, tobias



  • 4.  Re: Tabs in Java & dynamically name of the tab

    Posted 12-30-2018 12:58 PM

    like in winc variant I think you need to 'repaint' the window..it works for you nw because part of adding a tab is the repainting



  • 5.  Re: Tabs in Java & dynamically name of the tab

    Posted 12-30-2018 01:01 PM

    probably