devapp
Posts: 0
Joined: Mon Mar 23, 2015 3:12 pm

Label Reset

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

Alena Prykhodko
Posts: 0
Joined: Tue Apr 09, 2013 7:36 am

Label Reset

Hi,

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

devapp
Posts: 0
Joined: Mon Mar 23, 2015 3:12 pm

Label Reset

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

devapp
Posts: 0
Joined: Mon Mar 23, 2015 3:12 pm

Label Reset

No Suggestions???

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

Label Reset

Hello devapp,

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

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

Label Reset

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.

devapp
Posts: 0
Joined: Mon Mar 23, 2015 3:12 pm

Label Reset

Thank you Yurii Orishchuk

Return to “Issues”