Combobox and setfieldactive issue.

Started by Ben R., October 11, 2013, 05:26:28 PM

Previous topic - Next topic

Ben R.

I have a particular application in which users enter a help request. After the add function, the IT staff comes in behind them and updates the request to take ownership of it, and eventually to enter resolution notes. I have the fields seperated into groups corresponding to the different user fields (end user and IT), and when entering update mode I would like to disable all the end-user fields. This works for the most part, but there are two comboboxes that allow for issue categorization. When setting those inactive, the fields are blanked out rather than retaining their values in display.

Here is the code that I'm using to disable the end user fields:

before input
            if menu_item = "update" then
              call dialog.setfieldactive("htk_description",0)
              call dialog.setfieldactive("htk_description2",0)
              call dialog.setfieldactive("htk_select2",0)
              call dialog.setfieldactive("htk_notes",0)
              call dialog.setfieldactive("htk_priority",0)
              call llh_display()
            end if

Attached is the result of this code, showing the before and after of entering update mode.
Also here:

So my question is this: Am I taking the correct approach in how to mark the fields above noentry? If I am, is there a way to then assign values back to the comboboxes in order to not lose the display of the data they should contain?

Additionally, is there an easy way to set an entire group inactive? From the documentation the setfieldactive seems to be the only way to do it; there's not a setelementactive function for some reason.


Reuben B.

Ben,

One of my local customers just reported a similar issue with combobox and inactive.  I couldn't reproduce but I have only looked at Windows so far.  What GDC version are you using and on what platform?

Reuben



Product Consultant (Asia Pacific)
Developer Relations Manager (Worldwide)
Author of https://4js.com/ask-reuben
Contributor to https://github.com/FourjsGenero

Ben R.

GDC 2.11 on Windows.

So by saying you can't reproduce, you mean the code I used didn't blank out the combobox for you?

Reuben B.

I certainly didn't test on 2.11, but testing using it doesn't reveal the issue.

I am using GDC=2.11.13, FGL=2.11.16.  When stating versions, you ought to give the full version, not part of the version.

This is the little example program I used.  Can you see if the issue occurs with this.  If it doesn't modify so that the issue does occur.  I can't tell much from your limited sample code but I would be curious what llh_display() does.

Code (genero) Select
MAIN
DEFINE field1, field2, field3 STRING
    CLOSE WINDOW SCREEN
    OPTIONS FIELD ORDER FORM
    OPTIONS INPUT WRAP
   
    OPEN WINDOW w WITH FORM "comboinactive"
    LET field1 = "Y"
    LET field2 = "Y"
    LET field3 = "Y"
    DISPLAY BY NAME field1, field2, field3
    MENU ""
        ON ACTION update
            INPUT BY NAME field1, field2, field3 ATTRIBUTES(WITHOUT DEFAULTS=TRUE)
                BEFORE INPUT
                    CALL DIALOG.setFieldActive("formonly.field2", FALSE)
                ON ACTION disable
                    CALL DIALOG.setFieldActive("formonly.field2", FALSE)
                ON ACTION enable
                    CALL DIALOG.setFieldActive("formonly.field2", TRUE)
            END INPUT
        ON ACTION close
            EXIT MENU
    END MENU
END MAIN


Code (per) Select
LAYOUT
GRID
{
[f01    ]
[f02    ]
[f03    ]
}
END
END
ATTRIBUTES
f01 = formonly.field1;
COMBOBOX f02 = formonly.field2, ITEMS=(("Y","Yes"),("N","No")), NOT NULL;
f03 = formonly.field3;


Product Consultant (Asia Pacific)
Developer Relations Manager (Worldwide)
Author of https://4js.com/ask-reuben
Contributor to https://github.com/FourjsGenero

Nuno G.

Just curious: did you examined the aui to check if the combobox items are there and wich is the cb value? This is what i mean:

Define dn om.domnode

Let dn = ui.interface.getRootNode()
Call dn.writeXml(`test.xml`)

And then examine the xml file.