Messages by Bo

23 topics, 337 messages
Kuix technical support » A bug in RadioGroup ?

For RadioGroup sue, the value need to be set on the RadioButtons.

Example :

<container>

    <radioGroup id="myRadioGroup">

        <radioButton value="${foo1}">Choice 1</RadioButton>

        <radioButton value="${foo2}">Choice 2</RadioButton>

    </radioGroup>

    <button onAction="processChoice(myRadioGroup.value)"/>

</container>

 

In this example, the value is set on each radio button by calling the data provider at parse time. By default the value of the radio group is null and automaticaly set to the selected radio button value.

In this case you can invoke your own action (processChoice on the button in this example) by forwarding the radio group value.

A radio group could give its value by calling myRadioGroupInstance.getValue() or myRadioGroupInstance.getAttribute("value").

getAttribute("attributeName") permit to extract a String value from a widget directly in xml (like myRadioGroup.value in this example). Check the javadoc to see what widget can give what attribute. (For example all AbstractTextWidget return the text value ...)

 

Kuix technical support » Creating custom widgets

To be sure to understand properties and DataProvider, look at Kaprice source code.

Kuix technical support » Creating custom widgets

%I18N_KEY% will be replace by it's i18n corresponding value in /i18n/message.properties or /i18n/message.XX.properties

${myProperty} and @{myProperty} do basicly the same thing : extract a value from a DataProvider given while calling loadScreen or loadXml methods by invoking myDataProvider.getValue("myProperty"). The main difference reside in the life time of the linkage between the widget where to put the value and the DataProvider.

${propertyName} is converted to its value only at parse time. No linkage between the Widget and the DataProvider is kept.

@{propertyName} is converted to its value at parse time and a the widget is binded to the DataProvider if not nul. The main goal of this feature is to be able to change the value directly in the DataProvider and it generate automaticaly the update on all binded widgets. THe concept go forward because you can mix more than one property in an attribute definition.

For exemple :

<text>

<_text>${prop1} any text @{prop2} any text @{prop3}</_text>

</text>

In this example prop1 was converted at parse time. And the Text widget is binded to the DataProvider on prop2 and prop3. Then if one of the two properties change the text is updated.

Kuix technical support » Creating custom widgets
With 0.9.1 there's two way to use your own widgets.
  • Override the KuixConverter and override the convertWidgetTag() method as you did. And in your widget class override the setAttribute() method to catch your special attributes.
  • Simply add the custom widget name (case sensitive) in the xml like that : In this case the class org.mypackage.TestWidget will be automaticaly created. And like the way 1 override the setAttribute() method to catch yout own attributes.

CAUTION : parsed properties like @{...}, ${...}, %...% are ignored while use this syntax : You need to use this syntax : <widget>
<_myAttribute>@{value}</_myAttribute>
</widget>
Kutil » Worker and WorkerTasks
Hi, Actualy, all tasks are removed when the worker is stopped. It's right it is not necessary the best way because KuixMIDlet already stop and resume the worker if the app is paused. In the next kutil release this will be fix by adding a new method removeAllTasks() to the worker and kept the tasks list while invoking the stop method.
Kuix technical support » Possible memory leak ?
Today the a new release of Kuix (0.9.1) is out. It is not decribe in change log, but it fix a bug with sub menu that can produce memory leaks.
Kuix bug report » Desktop bg-color not right
Hi, in the demo, the background color is realy light. Maybe the color is not visible on your E51 or not in the color palette of your phone. Does the problem persist if you change the bg-color by red ?