Skip to main content

About Calendar

4 replies [Last post]
Anonymous

Hi,

Just a litle question about the way to use Calendar in forms. I couldn't
find the calendar in the dev guide.

What I was expecting when I created my two calendar fields this morning was
a field that the user could focus on and then press on the soft button to be
taken to the calendar view to select his date.
Instead the entire calendar widget got drawn in my form which is not very
user friendly in my opinion.

Should I create a some sort of dialog / popup containing a calendar that
appears when the user clicks on a button. And then when the date is chosen,
return back to my main form and change a Label to the date the user just
selected ?

How do you guys do it (generally speaking) when you want a user to be able
to select a date in a form ?

Thanks for your feedback :)

Cheers,

Alex
[att1.html]

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
chen

Hi,
Set the form to setScrollable(false), since what you really want is to
preform the scroll on the list and not on the form.
In addition, it would make more sense to put the List in the center of
the Form, simply set the Form layout to BorderLayout and then add the
List to the center.

form = new Form("List");
form.setLayout(new BorderLayout());
_list = new List(model);
form.setScrollable(false);
form.addComponent(BorderLayout.CENTER, _list);

Regards,
Chen

Penyihir Kecil wrote:
> hi, i'm a new user of LWUITS
>
> i have a problem that might had been discussed in this mailist.
> but still can't find the solution.
>
> here's my question, i want to display using List but the problem that
> i found here is when i press DOWN, the form didn't perform
> scrollable...i have 20 item to display but i can only see 10 when i
> try to went DOWN the selected item was choosen but the form didn't
> scroll so i can't see the selected item.
>
> does anyone know how to solve this problem.
>
>
> here's my code :
>
> public class MainList extends MIDlet{
> private Form form;
> private ListModel model;
> private List _list;
> private String[] content = {"Jack", "Kate", "Sawyer",
> "Sayid", "Hurley", "Jin", "Sun", "Charlie",
> "Claire", "Aaron",
> "Michael", "Walt", "Boone", "Shannon",
> "Locke", "Mr. Eko",
> "Ana-Lucia", "Libby", "Desmond", "Benjamin
> Linus", "Juliet Burke" };
> public void startApp() {
> Display.init(this);
>
> model = new DefaultListModel(content);
>
> form = new Form("List");
> _list = new List(model);
> form.setScrollable(true);
> form.addComponent(_list);
>
> form.show();
> }
>
> public void pauseApp() {
> }
>
> public void destroyApp(boolean unconditional) {
> }
>
>
>
> }
>
> thnx u
>
> Dwi Ardi Irawan
>
> ~ ...and the story goes ~
> Blog : http://dwiardiirawan.blogspot.com
>
>

[att1.html]

chen

Hi Alex,

az lists wrote:
> Hi,
>
> Just a litle question about the way to use Calendar in forms. I
> couldn't find the calendar in the dev guide.
>
> What I was expecting when I created my two calendar fields this
> morning was a field that the user could focus on and then press on the
> soft button to be taken to the calendar view to select his date.
> Instead the entire calendar widget got drawn in my form which is not
> very user friendly in my opinion.
>
> Should I create a some sort of dialog / popup containing a calendar
> that appears when the user clicks on a button. And then when the date
> is chosen, return back to my main form and change a Label to the date
> the user just selected ?
Yes, that's the idea.

Chen

>
> How do you guys do it (generally speaking) when you want a user to be
> able to select a date in a form ?
>
> Thanks for your feedback :)
>
> Cheers,
>
> Alex

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@lwuit.dev.java.net
For additional commands, e-mail: users-help@lwuit.dev.java.net

Penyihir Kecil

hi, i'm a new user of LWUITS

i have a problem that might had been discussed in this mailist.
but still can't find the solution.

here's my question, i want to display using List but the problem that i found here is when i press DOWN, the form didn't perform scrollable...i have 20 item to display but i can only see 10 when i try to went DOWN the selected item was choosen but the form didn't scroll so i can't see the selected item.

does anyone know how to solve this problem.

here's my code :

public class MainList extends MIDlet{
    private Form form;
    private ListModel model;
    private List _list;
    private String[] content = {"Jack", "Kate", "Sawyer",
                           "Sayid", "Hurley", "Jin", "Sun", "Charlie", "Claire", "Aaron",
                           "Michael", "Walt", "Boone", "Shannon", "Locke", "Mr. Eko",
                           "Ana-Lucia", "Libby", "Desmond", "Benjamin Linus", "Juliet Burke" };
    public void startApp() {
        Display.init(this);
       
        model = new DefaultListModel(content);
       
        form = new Form("List");
        _list = new List(model);
        form.setScrollable(true);
        form.addComponent(_list);
       
        form.show();
    }

    public void pauseApp() {
    }

    public void destroyApp(boolean unconditional) {
    }

   

}

thnx u

Dwi Ardi Irawan

~  ...and the story goes ~
Blog : http://dwiardiirawan.blogspot.com

[att1.html]

Francis De Brabandere

I'm not sure this will help but I'm always doing this:
(seen it in the demo app)

form.setScrollable(false);
// the list will scroll

On Thu, Jun 26, 2008 at 1:40 PM, Penyihir Kecil
wrote:
> hi, i'm a new user of LWUITS
>
> i have a problem that might had been discussed in this mailist.
> but still can't find the solution.
>
> here's my question, i want to display using List but the problem that i
> found here is when i press DOWN, the form didn't perform scrollable...i have
> 20 item to display but i can only see 10 when i try to went DOWN the
> selected item was choosen but the form didn't scroll so i can't see the
> selected item.
>
> does anyone know how to solve this problem.
>
>
> here's my code :
>
> public class MainList extends MIDlet{
> private Form form;
> private ListModel model;
> private List _list;
> private String[] content = {"Jack", "Kate", "Sawyer",
> "Sayid", "Hurley", "Jin", "Sun", "Charlie",
> "Claire", "Aaron",
> "Michael", "Walt", "Boone", "Shannon", "Locke",
> "Mr. Eko",
> "Ana-Lucia", "Libby", "Desmond", "Benjamin
> Linus", "Juliet Burke" };
> public void startApp() {
> Display.init(this);
>
> model = new DefaultListModel(content);
>
> form = new Form("List");
> _list = new List(model);
> form.setScrollable(true);
> form.addComponent(_list);
>
> form.show();
> }
>
> public void pauseApp() {
> }
>
> public void destroyApp(boolean unconditional) {
> }
>
>
>
> }
>
> thnx u
>
> Dwi Ardi Irawan
>
> ~ ...and the story goes ~
> Blog : http://dwiardiirawan.blogspot.com
>
>
>

--
http://www.somatik.be
Microsoft gives you windows, Linux gives you the whole house.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@lwuit.dev.java.net
For additional commands, e-mail: users-help@lwuit.dev.java.net