×

Discussion Board

Results 1 to 6 of 6

Thread: display refresh

  1. #1
    Regular Contributor
    Join Date
    Nov 2010
    Posts
    118

    display refresh

    hi everyone! is it possible to refresh a displayable? because i have icons for "UNREAD" and "READ" messages.... if i read a selected message from my inbox list and then press back, the "UNREAD" icon does not change to "READ". but if i return to my main menu and again go to my inbox list, that is the time the icon changes to "READ"....

    can i refresh the displayable?thanks

  2. #2
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: display refresh

    I'm assuming that you're using an lcdui.List component.

    How have you told the List that the image needs to change? Did you call set()?

    Graham.

  3. #3
    Regular Contributor
    Join Date
    Nov 2010
    Posts
    118

    Re: display refresh

    here is my code: Image icon = null;
    Code:
    try
            {
                parser.setInput(isr);
                document.parse(parser);
                el_root = document.getRootElement();
                for(int i = 1; i < el_root.getChildCount(); i++)
                {
                      temp_str = "";
                      el_sms = el_root.getElement(i);
                      if(el_sms.getAttributeValue("", "status").equals("read"))
                      {
                          icon = Image.createImage("/storage/read.png");
                      }
                      else
                      {
                          icon = Image.createImage("/storage/unread.png");
                      }
                      el_sms_content = el_sms.getElement(0);   //point to child of sms (number)
                      temp_str += el_sms_content.getText(0) + ": ";
                      el_sms_content = el_sms.getElement(1);   //point to child of sms (msg)
                      temp_str += el_sms_content.getText(0) + " ";
                      inbox_list.append(temp_str, icon);
                }
                fc.close();
                in.close();
                isr.close();
            }
            catch (Exception ioe)
            {
            }
    it does not update the image once el_sms.getAttributeValue("", "status") is equal to "read". anyway thanks
    but if i go out of the inbox list and then return to inbox list again, it updates the image

  4. #4
    Regular Contributor
    Join Date
    Nov 2010
    Posts
    118

    Re: display refresh

    where in my code should i put set()?

    public void set(int aIndex, String aText, Image aIcon)
    Sets the String and Image parts of the element referenced by elementNum, replacing the previous contents of the element.

    i dont have an array of strings instead i have to append temp_str which holds the sender's address and msg retrieved from my xml file... thanks
    Last edited by binsint; 2011-02-06 at 14:45.

  5. #5
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: display refresh

    The code you posts creates the entire list. I'd guess that it is not being called when going from the message back to the inbox. Or, it is being called before the message status changes.

    Graham.

  6. #6
    Regular Contributor
    Join Date
    Nov 2010
    Posts
    118

    Re: display refresh

    hi graham! I SOLVED THIS PROBLEM...
    Heres my code:

    Code:
     try
            {
                parser.setInput(isr);
                document.parse(parser);
                Element el_root = document.getRootElement();
                Element el_sms = el_root.getElement(index + 1);    // NOTE!! READER DOESN'T POINT TO SPECIFIC MSG
                el_sms.setAttribute("", "status", "read");
                Element el_sms_content = null;
                el_sms_content = el_sms.getElement(0);    // point to number
                reply_number = el_sms_content.getText(0);
                read_msg.append(" ");
                read_msg.append(el_sms_content.getText(0));
                read_msg.append("\n\n");
                el_sms_content = el_sms.getElement(1);    // point to msg
                read_msg.append(el_sms_content.getText(0));
                os = fc.openDataOutputStream();
                serializer.setOutput(os, "UTF-8");
                document.write(serializer);
                fc.close();
                in.close();
                isr.close();
                Image icon = Image.createImage("/storage/read.png");
                inbox_list.set(inbox_list.getSelectedIndex(),reply_number+": "+el_sms_content.getText(0), icon);
                // Samtang gapanaog ang current(gapili basahon nga msg) ga haboy man sa value nga isulod
                // sa el_root.getElement( DIRI )
            }
    it changes the icon perfectly...thanks!!!

Similar Threads

  1. Refresh listbox
    By siva_321 in forum Symbian
    Replies: 6
    Last Post: 2009-11-10, 06:58
  2. Refresh...
    By nandi1225 in forum Symbian
    Replies: 1
    Last Post: 2008-04-11, 10:20
  3. Refresh dialog
    By ninidotnet in forum Symbian User Interface
    Replies: 1
    Last Post: 2006-08-22, 09:57
  4. Refresh display ?
    By valentin_da_itiv in forum Symbian User Interface
    Replies: 0
    Last Post: 2003-10-27, 13:03

Posting Permissions

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