1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

  2. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

How to target a child widget that is contained within multiple parent widgets in order to...

Discussão em 'StackOverflow' iniciado por fdantas, Novembro 25, 2020.

  1. fdantas

    fdantas Administrator Moderador

    A client needs the application to have colour inserted into the application for specific instances, so the fields will only be populated with colour when necessary, I'm doing this with a right-click context menu.

    I created an example application that uses this code and pulls the widget names from a JSON file.

    DEFINE VARIABLE hHandle AS HANDLE NO-UNDO.
    DEFINE VARIABLE widgetName AS CHARACTER NO-UNDO.
    DEFINE VARIABLE colourNumber AS INTEGER NO-UNDO.

    FOR EACH Resultst-WidgetList:
    ASSIGN
    widgetName = Results-WidgetList.tt-widName /* these assignments are just getting the info */
    colourNumber = INT(Results-WidgetList.tt-colour
    .
    hHandle = SESSION:FIRST-CHILD.
    DO WHILE VALID-HANDLE(hHandle):
    IF hHandle:TYPE = "FIELD-GROUP" THEN LEAVE.
    hHandle = hHandle:FIRST-CHILD.
    END.

    hHandle = hHandle:FIRST-CHILD.
    DO WHILE VALID-HANDLE(hHandle):
    IF hHandle:TYPE = "FILL-IN" AND hHandle:NAME = widgetName THEN LEAVE.
    hHandle = hHandle:NEXT-SIBLING.
    END.

    ASSIGN
    hHandle:BGCOLOR = colourNumber.

    END.




    This worked perfectly fine in my example application, but once I try implement it in the main application it can't see the specific widgets because it is looping through the topmost parent container and going no further.

    Is there a way to get to the elements that are contained within?

    Continue reading...

Compartilhe esta Página