×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Oct 2004
    Posts
    28

    Question Accessing controls b/w different views(containers)

    Hi,

    I am working on app having multiple views and their containers.
    2 views are tabbed and rest 2 are not tabbed.
    Now I have a CAknDoubleLargeStyleListBox in one container(tabbed one) and from here on selecting a list item I go to another view(untabbed) which is having a label.
    Now I want to set the labels text as the heading text of the selected list item...

    How to access text of the currently selected list item and set the label's text on the other view?

    One more thing, can I have multiple containers in the same view (using Carbide C++ UI Designer)?

    Pls help...

    Thanx
    RT

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

    Re: Accessing controls b/w different views(containers)

    Though it is just a matter of design, the default approach with views is usually creating the container in DoActivateL and deleting it in DoDeactivate. Thus the control (and it contents) does not exist when the view is not active, and this probably applies to code generated with the UI Designer.

  3. #3
    Registered User
    Join Date
    May 2008
    Posts
    8

    Re: Accessing controls b/w different views(containers)

    Yup n thats the reason I m not able to access the selected items text from the other container...(I had asked about it in anoter post)...

    Could u suggest me some approach to achieve the functionality(mentioned in first post in this thread)..?


    Thanx...

  4. #4
    Regular Contributor
    Join Date
    Oct 2007
    Posts
    92

    Re: Accessing controls b/w different views(containers)

    First of all take Value form listbox using

    Code:
    TInt current = SelectedItem();
    CDesCArray* itemArray = static_cast<CDesCArray*>(iListBox->Model()->ItemTextArray());
    
    TBuf<128> Selected_Val;
    Selected_Val.Append((*itemArray)[current]);
    Now pass this value into your view,
    Like iSelected_Val = Selected_Val

    Now Activate your another container (Label)
    And Pass iSelected_Val in to your ConstructL function
    Now U can use this value as Label text.
    iLabel.SetTextL ( iSelected_Val);

Similar Threads

  1. Custom controls or extend existing controls?
    By mayur_24 in forum Symbian User Interface
    Replies: 2
    Last Post: 2007-10-05, 16:16
  2. Changing default size of controls
    By Anzi in forum Symbian User Interface
    Replies: 2
    Last Post: 2006-12-22, 13:26
  3. Accessing form control's
    By shafali gupta in forum Symbian User Interface
    Replies: 1
    Last Post: 2005-01-19, 04:50
  4. Repositioning controls in CEikDialog::PreLayoutDynInitL()
    By gpalvia in forum Symbian User Interface
    Replies: 3
    Last Post: 2004-03-11, 02:37
  5. drawing composite controls within CListItemDrawer::DrawActual Item
    By joshd29 in forum Symbian User Interface
    Replies: 1
    Last Post: 2003-08-09, 00:41

Posting Permissions

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