Problem with controls from array created with getChildrenOfWidget()
Hello.
I stumbled into a strange problem when using getChildrenOfWidget() to get the controls of a form.
(I didn't test all types yet, but I found 3 types where I can't get the value of the control)
I create 3 prompts of the following types: DzFloatSlider, DzIntSlider and DzColorWgt
When I access the objects direct it works as expected (although the class name is different):
ce_test_prompt_3: [object Object] (Class name: DsColorWgt) [x:216, y:250, w:560, h:24 || value.name: #256997] (Name: ce_test_prompt_3)
ne_test_prompt_4: [object Object] (Class name: DsIntSlider) [x:216, y:275, w:560, h:26 || min: -100, max: 100, value: 77 (Name: ne_test_prompt_4)
ne_test_prompt_5: [object Object] (Class name: DsFloatSlider) [x:216, y:305, w:560, h:26 || min: -1000, max: 1000, value: 12.34000015258789 (Name: ne_test_prompt_5)
But when I use getChildrenOfWidget() and pick the 3 controls from the array I get the following:
control: [object Object] (Class name: DzColorWgt)[<<<-Result of expression 'theVar.value' [undefined] is not an object.->>>] (Name: ce_test_prompt_3)
control: [object Object] (Class name: DzIntSlider) [x:216, y:275, w:560, h:26 || min: undefined, max: undefined, value: undefined (Name: ne_test_prompt_4)
control: [object Object] (Class name: DzFloatSlider) [x:216, y:305, w:560, h:26 || min: undefined, max: undefined, value: undefined (Name: ne_test_prompt_5)
The (e.g.) text property of a line edit control or the checked property of a checkbox show the correct value when picked from the array.
How can I access the values from the controls taken from the array?
Any hint is highly welcome.
With kind regards,
Ruediger Kabbasch
Comments
There really isn't enough context to offer anything
O.K., I thought I described all the details
Anyway, I created the most simple example to reproduce it:
An example output is attached as a screenshot
I don't have a solution but agree something is odd.
I have been trying to use a DzColorWgt and found that the object returned by the DzColorWgt constructor has a className of DsColorWgt and says it inherits from DsColorWgt. This has a property 'value' which is initialized as a Color object (255,255,255), and can be updated.
If you attempt to retrieve this widget using getWidget(), or [DzDialog].getChildrenOfWidget() you will get an object that has a className of DzColorWgt. More importantly, the object does not have the property 'value' now. I would not be surprised at all if the same is true of findChildOfWidget().