cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X

SOLVED dlgitem_set() and subsequent queries of set controls?

naglists
1-Newbie

SOLVED dlgitem_set() and subsequent queries of set controls?

Ok, this makes me happy.

I do not agree that this is correct behavior, BUT I now believe I have a
reliable method for dlgitem_sets and _gets. And by that I mean, I don't use
_sets with checkboxes. Because they don't work correctly. In my opinion. (I
am not sure yet whether this is true of other types of controls.)

The following code samples half work. They update the visual display of the
XUI dialog but do not fully set the VALUE attribute of the item so that
subsequent _gets find the box checked:

dlgitem_set($xuiwin, 'production_current', 'VALUE', 1)

dlgitem_set_value($xuiwin, 'production_current', 1)

To be clear, if you look at the XUI checkbox id="production_current" with
your eyes, you will see a check. If you programmatically _get that item
with either dlgitem_get or dlgitem_get_value, you will find it is not
checked.

The following _set code will, however, TRULY set the check box:

junkarrs = oid_find_child_attrs(oid_root($xuidoc), junkarr, "id",
"production_current")

junk = oid_modify_attr($junkarr[1], "checked", 'true');
Now if you programmatically _get that item using either dlgitem_get or
dlgitem_get_value, you will find it IS checked.

WTF.

I would love someone to validate or refute this or isolate cases where it
is true. Fully open to some subtlety I'm not seeing, but I have been
beating on a patch of code proving this, at least in my XUI and ACL (maybe
a Windows reboot will screw it all up 😉

I'm currently working in 6.0 m010.

0 REPLIES 0
Announcements

Top Tags