Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Developer
jasoncheung
Posts: 67
Registered: ‎09-01-2012
My Device: Dev Alpha
My Carrier: Bell

Re: Saving App Settings

Hmmm...I'm not seeing how you are trying to change the values for Mix.QML files?

Please use plain text.
Contributor
ThomasD
Posts: 26
Registered: ‎01-04-2013
My Device: Playbook
My Carrier: Telus

Re: Saving App Settings

What I was trying was alias 2 variables in main.qml - that the setVariables function would change when a radio button was selected. The separate mix.qml files - used these 2 variables in their text fields and calculate functions.

Was testing a global variable idea.
Please use plain text.
Contributor
ThomasD
Posts: 26
Registered: ‎01-04-2013
My Device: Playbook
My Carrier: Telus

Re: Saving App Settings

Is it possible - in the a Container to call a javascript function. Not in a signal or anything but say after the id: <text> of the Container?
Please use plain text.
Developer
jasoncheung
Posts: 67
Registered: ‎09-01-2012
My Device: Dev Alpha
My Carrier: Bell

Re: Saving App Settings

So, for testing purposes, lets deal with the two properties you created in main.

Since you are using TabbedPane I was thinking that can get rid of all that "if" code in your settings.qml and bring that all to the top.....more thinking of something like this in the main:

onActiveTabChanged: {
  var checkedSystem = app.getValueFor("imperial", "true")
  var checkedWater = app.getValueFor("water", "true")
  if ((checkedSystem == "tue") && (checkedWater == "true")) {
      mainTab.MeasureVAL = 0
mainTab.MeasureEnd = 0 } else if ((checkedSystem == "true") && (checkedWater == "false")) {       mainTab.MeasureVAL = 0
      mainTab.MeasureEnd = 1
  } else if ((checkedSystem == "false") && (checkedWater == "true")) {       mainTab.MeasureVAL = 1
      mainTab.MeasureEnd = 0
  } else {       mainTab.MeasureVAL = 1
      mainTab.MeasureEnd = 1
 

 

Please use plain text.
Contributor
ThomasD
Posts: 26
Registered: ‎01-04-2013
My Device: Playbook
My Carrier: Telus

Re: Saving App Settings

I removed the jumble of if conditionals from SettingsPage.qml and tested the above in main.qml.

I set a textfield.text in one of my calc pages to MeasureVAL. When I build and run and go to the page - the textfield is set correctly. I then go to settings, select the other radio button and return to cal page. Nothing has changed. If I close the app and start it again, settings are back at default.

Might give more insight to code:

main.qml --> tabbed
tab1 --> s_cal.qml (NavigationPane + Buttons)
Button --> calPage.qml
Please use plain text.