×

Discussion Board

Results 1 to 5 of 5

Thread: LWUIT FORM

  1. #1
    Registered User
    Join Date
    Jul 2012
    Location
    India
    Posts
    103

    LWUIT FORM

    Hi
    I have LWUIT Form1 which contains titles from Rss File,if the end user clicks on the title of Form1,it should navigate to a Form2 ,where i am displaying a Text area(Paragraphs of text with),if the end user scroll down the form2 and then the user get's navigate to form1 by clicking the Back Botton.After that the user clicks on another list item on form1,then it gets navigate to form2,but the problem is that time form2 is displayed at the end,i want to show my form2 to the user at the starting of my text area..?
    My Actual Requirement is Each time if end user clicks on any title on Form1 ,i should be able to show start of my form2(Textarea Begin,not in the middle or not at the end) so that the user starts reading the text.for that what is the method i need to use?

    thanks.....
    Last edited by pavanragi; 2012-10-09 at 11:17.

  2. #2
    Registered User
    Join Date
    Sep 2012
    Posts
    31

    Re: LWUIT FORM

    Quote Originally Posted by pavanragi View Post
    Hi
    I have LWUIT Form1 which contains titles from Rss File,if the end user clicks on the title of Form1,it should navigate to a Form2 ,where i am displaying a Text area(Paragraphs of text with),if the end user scroll down the form2 and then the user get's navigate to form1 by clicking the Back Botton.After that the user clicks on another list item on form1,then it gets navigate to form2,but the problem is that time form2 is displayed at the end,i want to show my form2 to the user at the starting of my text area..?
    My Actual Requirement is Each time if end user clicks on any title on Form1 ,i should be able to show start of my form2(Textarea Begin,not in the middle or not at the end) so that the user starts reading the text.for that what is the method i need to use?

    thanks.....
    Not able to understand you question completely . Can you be a bit precise and clear so that anyone can help out solve your problem
    Regards,
    Venkatesh

  3. #3
    Registered User
    Join Date
    Jul 2012
    Location
    India
    Posts
    103

    Re: LWUIT FORM

    I have a LWUIT form1 and form2 ,form1 is displayed with list of titles from Rss File,
    1)If the user clicks on any title on fom1,i am able to navigate to form2 ,where i am displaying a text area(Contains Paragraphs of text( Description) from Rss),if suppose the user keep on reading the text and user reached at the end of a line(Cursor remains at the end)(by scroll down) on form2. After that user clicks back button on form2,then user able to navigate to form1,
    2)Again user clicks on any title on form1,then user should be able to see the text area(he should be able to read the description) from starting but not in the middle or end on form2(Beacuse in Previous case user read all the description till end on form2.

    My Problem is: Each time user clicks on any title on form1,i am able to navigate form2,but the cursor should always point to start of my text area(To allow the user start reading the description from statring)But my code is not working
    How to reset form values each time it is displayed?

    Here my Code:
    private void displayCompleteNewsScreen(News detailNews) {
    //log.debug("displayCompleteNewsScreen");
    form2.removeAll();
    form2.repaint();
    form2.addCommand(m_backCommand);
    form2.addCommandListener(new ActionListener() {

    public void actionPerformed(ActionEvent ae) {
    form1.show();
    }
    });


    Label pubDate = new Label(detailNews.getPubDate().substring(0, 16));
    pubDate.getStyle().setFont(Font.createSystemFont(Font.FACE_SYSTEM, Font.STYLE_BOLD, Font.SIZE_SMALL));
    form2.addComponent(pubDate);
    textarea.setText(detailNews.getDescription());
    form2.addComponent(textarea);

    form2.show();
    }
    Last edited by pavanragi; 2012-10-10 at 06:13.

  4. #4
    Nokia Developer Champion
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    3,087

    Re: LWUIT FORM

    Replace this line - textarea.setText(detailNews.getDescription());

    by these:

    textarea=null;
    textarea= new textArea();
    textarea.setText(detailNews.getDescription());

    Also share the code of Form1, how are you calling Form2 from it ?
    thanks,
    ~Amitabh
    (Champion of the Month -Aug'13)
    Follow me on my blog for Innovative Mobile Apps

  5. #5
    Registered User
    Join Date
    Jul 2012
    Location
    India
    Posts
    103

    Re: LWUIT FORM

    HI amit,thanks for reply

    Here the code of form1:
    public void addSelectedTabNews(News news) {

    if (Condition.equals("TopNews")) {
    topstory.addElement(news);
    myNewsList.addActionListener(new ActionListener() {

    public void actionPerformed(ActionEvent ae) {
    List source = (List) ae.getSource();
    News selectedNewsItem = (News) source.getSelectedItem();
    if (selectedNewsItem != null) {
    displayCompleteNewsScreen(selectedNewsItem);
    }
    }
    });
    form1.show();
    }

    you can also check this link http://www.developer.nokia.com/Commu...bs-Click-Event further code
    thanks..


    Quote Originally Posted by im2amit View Post
    Replace this line - textarea.setText(detailNews.getDescription());

    by these:

    textarea=null;
    textarea= new textArea();
    textarea.setText(detailNews.getDescription());

    Also share the code of Form1, how are you calling Form2 from it ?

Similar Threads

  1. How to append LWUIT List screen to a LWUIT Form in j2me?
    By pavanragi in forum Mobile Java General
    Replies: 1
    Last Post: 2012-08-06, 07:01
  2. Translate from LCDUI form to LWUIT UI Form
    By debasish_cse05 in forum Mobile Java Tools & SDKs
    Replies: 1
    Last Post: 2011-02-02, 12:37
  3. pass Text field value from one form to another form in LWUIT.
    By debasish_cse05 in forum Mobile Java Tools & SDKs
    Replies: 1
    Last Post: 2011-01-13, 12:21
  4. problem in back and forth of LWUIT form and normal form in j2me
    By jugal.inani in forum Mobile Java General
    Replies: 8
    Last Post: 2010-06-09, 12:24
  5. need to put canvas in LWUIT Form
    By yatin.frankline in forum Mobile Java General
    Replies: 5
    Last Post: 2010-04-05, 13:23

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×