130 views
in GUI Development by

Hello,

I'm asking help or some reference in the wiki.

I implemented a item of type "SettingItem".

When the item is tapped a Numeric pad is presented, i passed the "SettingItem" reffered with "this" and in the numpad i can acces the values of that item.

The problem is when i dismiss the numeric Num Pad, to pass back the modified value to the original item that invoqued the Num Pad.

How do i refer and store the modified values in the SettingItem that called the numpad?

1 Answer

0 votes
by
 
Best answer

Hello Riccardo,

The problem is when i dismiss the numeric Num Pad, to pass back the modified value to the original item that invoqued the Num Pad.

I'm not sure whether I understood the problem. Do you have a difficulty to access the value within the item? Or after storing the value, the item is not updated?

How do i refer and store the modified values in the SettingItem that called the numpad?

If you passed this (of SettingItem) to the NumPad component, the component could store this value in an own variable. Then via this variable it can access the members of this and modify them shortly before the NumPad is dismissed. Alternatively, instead of dismissing the NumPad by itself, let the NumPad send a signal to a slot method implemented in SettingItem. The SetingItem can thereupon react to it, query the current value from the NumPad and dismiss the NumPad.

Is SettingItem displayed within a list (e.g. Vertical List)? If yes, please remember that the items (the views) are not intended to store the data. They act as views only. In such case ensure that the modification made by NumPad is stored directly in the data of the respective item. Then force the list to reload the item.

I hope it helps you further.

Best regards

Paul Banach

by

Hi Paul, i solved with this : 

If you passed this (of SettingItem) to the NumPad component, the component could store this value in an own variable. Then via this variable it can access the members of this and modify them shortly before the NumPad is dismissed.

In reference to the list, when i tap on the numeric setting to show the numpad, the sistem halts.

 

 

by

Hello Riccardo,

I suppose, you have implemented following code directly in the SettingItem component:

Owner.PresentDialog( ... );

In such situation, the item will try to present the dialog in context of its owner, which is the list. The list, in turn, is restricted to deal with items inly. It is not intended to present dialogs. I would recommend to present the dialog in context of the root object (the Application component):

GetRoot().PresentDialog( ... );

or if you are working with EW 12 or newer:

rootthis.PresentDialog( ... );

I hope it helps you further.

Best regards

Paul Banach

by
Thanks, that was very helpful.
by

Hello Paul, my further implementation evolved in a way that my "data provider" is an Array of property references. For Example :

to the item " Setting ITem", that takes care of the presentation of the tipe of setting, i'm passing the reference of the array item and display the value, in this case a string.

Then the string itself gets modified by a keyboard etc... i'm able on the onSetMethod of the property Application::Device.CH9121_LOCAL_IP to see it changing its value correctly.

The problem is, when i dismiss the keyboard. the vertical list in the owner dialog that calls the keyboard, does not update the show of the string property of the SettingItem.

It gets updated when i switch to another dialog via SwitchDialog, beacuse the list reloads the views of the items in it.

I tried to attach a property observer in the SettingItem to the string reference property i pass  in the initializazion. But it doesn get invoked.

I tried to invalidate the state view of the owner of the keyboard dialog. but not working.

I want to achieve that when a property like Application::Device.CH9121_LOCAL_IP gets updated the setting item and eventually the vertical list  gets all updated in their view.

 

by

Hello Riccardo,

probably, you would need to force the list to reload its content using its InvalidateItems() method.

I hope it helps you further.

Best regards

Paul

Ask Embedded Wizard

Welcome to the question and answer site for Embedded Wizard users and UI developers.

Ask your question and receive answers from the Embedded Wizard support team or from other members of the community!

Embedded Wizard Website | Privacy Policy | Imprint

...