Plex 2E

Expand all | Collapse all

JAVA - dynamically load combo box

Jump to Best Answer
  • 1.  JAVA - dynamically load combo box

    Posted 09-07-2017 01:24 PM

    Hi, i tried out the following:

     

    JAVA Dynamic combo box 

     

    but i have no success with the source codes. it seems that the result of the following statement is null:

     

    myCombo = (ObRun.ObPanel.ObCtrlGui.ObComboGui)ObUserAPI.getControlByName(this.getCaller(), new ObCharFld("*Current"), &(1:).toString());         if (myCombo != null)

     

    myCombo is null because the program runs into else of this if.

     

    does anyone has an idea?

     

    environment is plex 7.2.1 with java 8.

    i named the control at panel design and submitted this value via paramter mapping into the source code.

     

    thanks in advance and best regards.

    Tobias



  • 2.  Re: JAVA - dynamically load combo box

    Posted 09-11-2017 02:48 AM

    It still does not work. i tried all Options of the function "getFunctionPanel" which is called by "getControlByName". the Options i tried are

    *Active, *Current, *Main, *Caller, *Parent, *FirstFunctionWithPanel

     

     

    Does anyone has an idea?

     

    best regards, Tobias



  • 3.  Re: JAVA - dynamically load combo box

    Posted 09-08-2017 09:18 AM

    Update:

     

    it works if i call the function from within ca plex as stand-alone call of the function (right context menu and oprion RUN)

     

    it does not work if i call the function outside of plex within my regular menushell construct: double click the .bat of my menu program and within this one menu point is the function and then it does not work.

     

    best regards, tobias



  • 4.  Re: JAVA - dynamically load combo box
    Best Answer

    Posted 09-11-2017 04:30 AM

    Now it works.

    we changed the following Statement

     

    myCombo = (ObRun.ObPanel.ObCtrlGui.ObComboGui)ObUserAPI.getControlByName(this.getCaller(), new ObCharFld("*Current"), &(1:).getValue());

     

    to

     

    myCombo = (ObRun.ObPanel.ObCtrlGui.ObComboGui)ObUserAPI.getControlByName(this, new ObCharFld("*Current"), &(1:).getValue());

     

     

    best regards, tobias