Hi,
In the interest of others.. ,
One approach to get the widget which is currently focused and has the onMessage Event associated with it is to use FocuseManager
getFocusManager().getFocusedWidget(), Once you have widget, you could use getDataProvider() method of the widget to know the details of the dynamic data used to create the widget. In this case the name value used.
Second approach as communcated by as suresh argument[0] is always the dataprovider for the method call onMessage() call, so one could get the DataProvider directly casting argument[0] - Could kuix team verify this if this is always true.
3rd Approach is to assign the a district string to on action so that the value of the message you get is district string item.
Change the render to have a onaction value coming from the dataprovider
<_renderer>
<![CDATA[
<listitem onAction="${name}" style="gap:5 0">
<picture src="${img}"/>
<text>@{name}</text>
</listitem>
]]>
</_renderer>
so that the string value you get onMessage would be same as what is displayed as menu item.
Followup questions to kuix team:
1. Can we not get name from the ListItem Widget itself, rather than going though DataProvider like I can get Background details etc.
2. When we changed <listitem onAction="@{name}" style="gap:5 0">
<picture src="${img}"/>
<text>@{name}</text>
</listitem>
- Observe that onAction is taking @{name} instead of ${name}.. then onAction did not had the name replacement.. I am still unclear on where to use @ and where to use $. You inputs w.r.t this case would help.
3. Is there a document to show the list of default arguments one could expect against onMessage.
4. Could you point me to the syntax of dataprovider usage in xml which support custom arguments.. and what would be the impact of such custom arguments if there already some defaults are sent by kuix. - In the current context assume that name has been declared to have few custom arguments. in such case assuming argument[0] as DataProvider is reasonable
Regards,
Raja Nagendra Kumar,
C.T.O
www.tejasoft.com