×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Jul 2012
    Location
    India
    Posts
    103

    Issue with LWUIT Tabs Click Event

    Hi
    I've created LWUIT tabs ,when the user clicks on any tab ,i want to read an Rss File and i want to display titles with images.
    Here i am able to load lists related to specific tab individually whenever user clicks on any tab,But the problem comes when the user initially clicks on first tab ,then the titles related to that tab are gets loading,In the middle if the end user clicks on second tab then the titles from tab 1 are getting mix with titles from tab2 and are displayed on tab2..

    Here my code:
    In the Constructor:
    Code:
    cinemanews = new Vector();
            gossipnews=new Vector();
    cinemaNewsList = new List(cinemanews);
    cinemaNewsList.setScrollVisible(false);
    cinemaNewsList.setRenderer(new NewsListCellRenderer());
    gossipNewsList = new List(gossipnews);
    gossipNewsList.setScrollVisible(false);
    gossipNewsList.setRenderer(new NewsListCellRenderer());   
     Button b1=new Button("CinemaNews");
     Button b2=new Button("GossipNews");
     tabs.addTab(b1, cinemaNewsList);
    tabs.addTab(b2,gossipNewsList );
     b2.addActionListener(new ActionListener() {
    
                    public void actionPerformed(ActionEvent ae) {
                        if (cinemanewsList .size() == 0) {
                            process("xyz.rss");
                            Condition = tabs.getTabTitle(1);
                        }
                    }
                });
                b3.addActionListener(new ActionListener() {
    
                    public void actionPerformed(ActionEvent ae) {
                        if (gossipNewsList.size() == 0) {
    
                            process("xyz.rss");
                            Condition = tabs.getTabTitle(2);
                        }
                    }
                });
                 
                form1.addComponent(BorderLayout.CENTER, tabs);

    Here my Condition:
    if (Condition.equals("CinemaNews")) {
    cinemanews.addElement(news);
    form1.show();
    }
    if (Condition.equals("GossipNews")) {
    gossipnews.addElement(news);
    form1.show();
    }

    Can any one pls.. help me ?Is this Correct way to identify LWUIT Tabs Click Event?
    Last edited by pavanragi; 2012-10-08 at 10:16.

  2. #2
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,748

    Re: Issue with LWUIT Tabs Click Event

    Think it over again. Assuming that the second piece of code appends one item ('news' variable) to a list at a time, it is normal that content gets mixed. The parsing code should not care about what the user is looking at, it should only care about what it parses. When you are parsing cinema news, they should be stored in the cinema news list regardless of what is on the display.

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

    Re: Issue with LWUIT Tabs Click Event

    Is there any way to control? so that contents will not get mixed?How the Contents are get mixing up.If you observe my second piece of code ,there i am checking the condition?so that contents will not get mixed up?




    Quote Originally Posted by wizard_hu_ View Post
    Think it over again. Assuming that the second piece of code appends one item ('news' variable) to a list at a time, it is normal that content gets mixed. The parsing code should not care about what the user is looking at, it should only care about what it parses. When you are parsing cinema news, they should be stored in the cinema news list regardless of what is on the display.
    Last edited by pavanragi; 2012-10-08 at 10:18.

Similar Threads

  1. LWUIT Tabs
    By pavanragi in forum Mobile Java General
    Replies: 5
    Last Post: 2012-10-03, 09:33
  2. How to work with LWUIT TABs click events
    By pavanragi in forum Mobile Java General
    Replies: 3
    Last Post: 2012-08-30, 12:22
  3. LWUIT NUMBER OF TABS
    By pavanragi in forum Mobile Java General
    Replies: 1
    Last Post: 2012-08-22, 08:56
  4. LWUIT Tabs creation
    By pavanragi in forum Mobile Java General
    Replies: 4
    Last Post: 2012-08-18, 08:09
  5. Nokia 5230 Browser can not click on some links or tabs in website.
    By pak_amar in forum General Development Questions
    Replies: 1
    Last Post: 2010-03-14, 15:16

Posting Permissions

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