Skip to Content

How to display alert message in xml view.

Hi,

I did some calculations in controller and am displaying the result in alert. my question is how to display this alert message in Text control which is defined in xml view.

Please find the below code.

In Controller..

TextChange:function(){

var Maxlength=this.getView().byId("mytextarea").getMaxLength();

var Text_lenght=this.getView().byId("mytextarea").getValue().length;

var textRemaining=Maxlength-Text_lenght;

alert(textRemaining + ' characters remaining');

},

In View...

<Text text="" />

Thank you

Manju

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Posted on Apr 28, 2016 at 05:32 AM

    HI

    Try this sample.

    var text="SAPUI5";

    alert("i am learning"+text);.

    Try this for your Max length text_length . to see the value. and you can check the value by putting breakpoints also while inspecting.

    Thanks,

    Regards

    JK

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Apr 28, 2016 at 06:05 AM

    Hi Manjunatha

    Will this help?

    JS Bin - Collaborative JavaScript Debugging

    Thanks

    -D

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.