Messages by morgan

7 topics, 11 messages
Kuix technical support » Contextual menu

Hi,

I have a search text field, and just above, I have a list which contains the results of the search. I would like to be able to display a contextual menu according to the selected widget. If the text field is selected, I want my screenFirstMenu widget diplays 'Search'. And if an item from the result list is selected, I would like to display a popup menu which contains several choices.

Is it possible do to such a thing?

Thanks!

Kuix technical support » Dataprovider lost?

Hello,

I have a Frame A (whose the screen is associated to a Dataprovider dA) with which I call a Frame B by calling the Kuix.getFrameHandler().pushFrame(FrameB.instance) method. When I close the Frame B with Kuix.getFrameHandler().removeFrame(this) , the Frame B onRemoved() method is called, in which a do FrameA.instance.showScreen();

The Frame A is displayed, but it lost its dataprovider dA.

What am I doing wrong?

Thank you!

Kuix technical support » Size of a container

Hello,

According to this post (http://www.kalmeo.org/projects/kuix/snippets/show/8), I can display a picture generated with the javax.microedition.lcdui.Image class. I need to display a part of an existing image. For that, I use the static method createImage() (see http://java.sun.com/javame/reference/apis/jsr118/javax/microedition/lcdui/Image.html#createImage(javax.microedition.lcdui.Image,%20int,%20int,%20int,%20int,%20int)). As you can see in the previous link, the createImage needs several arguments, and more specially 'width' and 'height'. They represent the size of the trimmed image I want to display.

The problem is that I don't have those arguments because I want that the trimmed image fills the space I reserved for it.

Here is a sample of my XML file :

<screen style="layout:borderlayout" shortcuts="up=moveNorth|right=moveEast|down=moveSouth|left=moveWest" title="Plan">
    <container style="layout-data:bld(center)" id="plan">
        <picture><_image>@{plan}</_image></picture>
    </container>
    <container style="layout-data:bld(south)">Some information</container>

</screen>

The first container (id = "plan") is supposed to fill the space, do I would like to know how to get the size of the container (id = "plan").

 

Thanks!

Kuix technical support » How to get current System Time

Hi,

I think it's just a problem of time zone.

Try this:

c.setTimeZone(TimeZone.getDefault());

More information about TimeZone class : http://java.sun.com/javame/reference/apis/jsr139/java/util/TimeZone.html

If the time zone is still incorrect, try to change the time zone in your mobile phone.

Kuix technical support » How to display a "wait screen"?

Thank you for your replies.

I tried both solutions and both work great. But I would like to know which one I should use. Does it depends on something particulary? The first solution seems to be more readable. What is the advantage to choose the second solution knowing that I am waiting for data (I mean I am not processing data, I am just waiting for the server response).

Thank you!

Kuix technical support » How to display a "wait screen"?

Hello,

 

I would like to know if there is any way to display a message to show to the user that the phone is processing or waiting for data?

 

I tried the following code in my frame

public boolean onMessage(Object identifier, Object[] arguments) {
    if("search".equals(identifier)) {
        Kuix.alert("Please wait");
        String s = (String) arguments[0];
        productSearch.search(s);
        return false;
    }
    return true;
}

But it seems that Kuix waits the end of the onMessage function to change the screen.

 

Do I do something wrong?

Kuix technical support » Keep the selected item position in a list after an update

Finally, I solved my problem by using a checkbox

                <_renderer>
                <![CDATA[
                <checkbox style="layout:borderlayout;gap:5 0" onAction="switchInCart(this.dataprovider)">
                    <_selected>@{inCart}</_selected>
                    <text class="title" style="layout-data:bld(center); font-size: large; align: left;">${title}</text>
                    <text style="layout-data:bld(east)">${price}&#8364;</text>
                </checkbox>
                ]]>
                </_renderer>

instead of a list item

                <_renderer><![CDATA[
                <listitem style="layout:borderlayout;gap:5 0" onAction="switchInCart(this.dataprovider)">
                    <picture style="layout-data:bld(west);">${icon}</picture>
                    <text style="layout-data:bld(center); font-size: large; align: left;">${title}</text>
                    <text style="layout-data:bld(east)">${price}&#8364;</text>
                </listitem>
            ]]></_renderer>

 

Thanks

Kuix technical support » Keep the selected item position in a list after an update

Hello,

 

After having updated for example a text widget in a list with the dispatchpdateEvent method, the selected item goes back to the first item, and not to the updated item. What am I doing wrong?

 

Thanks!

Kuix technical support » Relative size in a widget with a table layout

Hello,

I would like to know whether it is possible to size a widget (with a table laylout) according to the parent container size ?

 

 

For instance, I would like to define the layout-data as following.

Example 1 :


popupbox {
    layout-data: sld(center,0.95,0.95);
}

 

Example 2 :


popupbox {
    layout-data: sld(center,0.75,0.75);
}

Thanks !

Kuix technical support » Slide transition and ScrollPane bug

I reported this bug here.

Kuix technical support » Slide transition and ScrollPane bug

Hi,

I don't know whether it's a bug or not, but when I use a slide transition, and I have a ScrollPane with an long text inside, the screen is truncated.

You will better understand with the following animation :

http://img508.imageshack.us/my.php?image=bugya7.gif

 

I have two XML files : form1.xml and form2.xml

----------------
=== form1.xml ===

<screen>
    <container style="layout:inlinelayout(false,fill); align: center">
        <text text="Hello World!" />
        <button onAction="next">Next</button>
    </container>
</screen>
----------------

----------------
=== form2.xml ===

<screen style="layout:borderlayout">
    <scrollPane usemarkers="false">
        <list>
            <listitem style="layout:borderlayout;gap:5 0">
                <text>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Mauris vestibulum, eros sit amet vulputate suscipit, nisi ectus accumsan orci, quis malesuada urna justo vel neque. </text>
            </listitem>
        </list>
    </scrollPane>
</screen>
----------------

form2.xml is called in a Frame class, with the onMessage method :
public boolean onMessage(Object identifier, Object[] arguments) {
    if("next".equals(identifier)){
        screen = Kuix.loadScreen("form2.xml", null);
        screen.setCurrent();
    }
    return true;
}

I use kuix 1.0.1 and kutil 1.0.2.

Any idea ?