1. ChetGo's Avatar
    I'm stuck. I can't get my qml to run properly. Nothing happens when clicking the button Convert.

    App is basically to convert Fahrenheit to Celsius. Text field to accept values, button to convert, label to display celsius.

    Below is my main.qml. Pls help.

    // Default empty project template
    import bb.cascades 1.0
    // creates one page with a label
    Page {
    Container {
    id: root
    function convertToCelsius(degreesF) {
    degressF = parseInt(degreesF, 10);
    return ((degreesF - 32) * 5) / 9;
    }

    TextField {
    id: fahrenheit
    hintText: "Fahrenheit Input"
    onTextChanging: {
    celsius.text = root.convertToCelsius(fahrenheit.text);
    }
    }

    Label {
    id: celsius
    text: "Chet's World"
    textStyle.base: SystemDefaults.TextStyles.BigText
    }

    Button {
    text: "Convert"
    onClicked: {
    celsius.text = root.convertToCelsius(fahrenheit.text);
    }
    }
    }
    }
    07-30-13 01:50 AM
  2. olaf_d's Avatar
    Try removing 'root.' from your function call and it should fire, do you get any errors when you compile?
    07-30-13 10:23 PM
  3. Brian Scheirer's Avatar
    Remove "root." from your function calls.

    Posted via CB10
    07-30-13 10:23 PM

Similar Threads

  1. z10 battery problem, , help...
    By Nicholas Arbent in forum BlackBerry Z10
    Replies: 4
    Last Post: 08-05-13, 01:01 PM
  2. Love my new Z10 - but need some help
    By sjwpenney in forum BlackBerry Z10
    Replies: 14
    Last Post: 07-31-13, 08:41 AM
  3. Please help me out Q10 SQN100-3, Vodafone India
    By r14uall in forum BlackBerry 10 OS
    Replies: 10
    Last Post: 07-30-13, 08:59 PM
  4. Help! Problems with latest update from Rogers
    By scienceboy in forum BlackBerry Z10
    Replies: 1
    Last Post: 07-29-13, 08:15 PM
  5. Explain? help? why?
    By lTatis in forum BlackBerry Z10
    Replies: 6
    Last Post: 07-29-13, 06:45 PM
LINK TO POST COPIED TO CLIPBOARD