Discussion Board

Results 1 to 3 of 3

Hybrid View

  1. #1
    Registered User
    Join Date
    May 2012

    Binding 2 QML pages


    I'd like to know how to bind A.qml to B.qml, so that B returns a value to A.

    The context :
    A.qml is my main page, and both A and B are Page based (I'm using pageStack to push B)
    B.qml is a filebrowser, and I would like it to return the filename when the file is selected.

    The PageStack Element documentation specifies that binding pages should be privilegied to use of parameters. Here, my issue is not passing a parameter from A to B, but, B being pushed by A, from B back to A, before popping B.

    Signal could be a solution, but it doesn't sound "high-level" enough for my QML approach.

    I've tried to create a property in A.qml, but it isn't seen by B.

    How should I handle this information transfer from a page to another issue?


  2. #2
    Nokia Developer Champion
    Join Date
    Feb 2008
    Ahmedabad, Gujarat, India

    Re: Binding 2 QML pages

    my solution for this would not be great but it works for me

    What you can do is :

    1. Make two global propertie in main.qml say bState and selectedFileName.
    2. Handle the onStatusChanged signal in page A, and if your page's status is 2 , that means page is activated so check for that status inside onStatusChanged.
    3. when you pop page B set the global property bState to true and assign selectedFileName with the actual Filename selected in Page B.
    4. Lastly just use bState and selectedFileName in Page A.

    Sample Code on Page A:

    if(status == 2 && bState){
    use selectedFileName here
    I hope you understood what i want to say, again this is not a perfect solution but a workaround

  3. #3
    Registered User
    Join Date
    May 2012

    Re: Binding 2 QML pages

    Thanks, I've found another way

    1. In Main Window, I define a importer item, based on Importer.qml
    2. Importer.qml has a filename property, and an importFile function
    3. My B.qml (the filebrowser) calls importer.importFile
    4. in A.qml, I get the filename in importer.filename

    I don't need to use any global function, that way

Similar Threads

  1. Binding modified key in Canvas
    By foosion in forum Symbian
    Replies: 2
    Last Post: 2009-10-20, 03:23
  2. binding for sent items
    By mheland in forum Symbian
    Replies: 1
    Last Post: 2008-01-04, 06:16
  3. binding problem
    By ewawong in forum General Messaging
    Replies: 0
    Last Post: 2006-12-20, 03:51
  4. Nokia Key Binding
    By Xen0n in forum Symbian
    Replies: 1
    Last Post: 2005-09-19, 08:39
  5. how to retrieve saved pages (.wml pages)
    By karen_cat in forum Browsing and Mark-ups
    Replies: 0
    Last Post: 2005-01-30, 22: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