Page 1 of 1

Label Reset

Posted: Sat Mar 28, 2015 12:42 pm
by devapp

I'm tying to reset the "label" after I navigate to the page from another page. I'm able to successfully reset the "input" but not the "label" part. Need help immediately! Image
Image
Image


Label Reset

Posted: Sat Mar 28, 2015 1:01 pm
by Alena Prykhodko

Hi,

Do you mean change label text?
Then use code:
pre
Apperyio('labelNAme').text('some New text');/pre


Label Reset

Posted: Sat Mar 28, 2015 1:33 pm
by devapp

Thank you Alena, that did the work. However there is one more thing I need to sort out.
I created the translator app from your tutorials, but when I hit the translate button without entering any text, it gives me an error "NO QUERY SPECIFIED. EXAMPLE REQUEST: GET?Q=HELLO&LANGPAIR=EN|IT".
I need to show the user via a JavaScript alert that the input field is empty. How can I achieve this?
Also, how can I display "NO QUERY SPECIFIED. EXAMPLE REQUEST: GET?Q=HELLO&LANGPAIR=EN|IT" with another text of my choice on the "label" part? Image


Label Reset

Posted: Mon Mar 30, 2015 11:44 am
by devapp

No Suggestions???


Label Reset

Posted: Mon Mar 30, 2015 5:20 pm
by Evgene Karachevtsev

Hello devapp,

Sorry for delay, we are working on it and will get back to you with the update.


Label Reset

Posted: Tue Mar 31, 2015 2:34 am
by Yurii Orishchuk

Hello,

Here is a brief plan to implement this logic:

  1. Delete current "translate" button click event handler.

  2. On "translate" button click add new event handler with action "Run javascript".

  3. Populate it with following JS code:

    pre

    //Where "inputName" is your input component name.
    var input = Apperyio("inputName");
    var inputValue = input.val();

    if(inputValue.trim() == ""){
    alert("Input has empty value");
    }
    else{
    //Where "serviceName" is your service datasource name that you need to invoke if input value is not empty.
    serviceName.execute();
    };

    /pre

    Regards.


Label Reset

Posted: Tue Mar 31, 2015 4:51 pm
by devapp

Thank you Yurii Orishchuk