Skip to Content

Input field or text field validation in SAPUI5 using XML view

Hi Experts,

I need to validate the input fields in SAPUI5. I know the JavaScript view. but I need to validate the input fields using XML code. I need to write the code in view.xml file using XML code. If any error occur, the input field become red color bordered.

Any possible solution would be accepted gratefully.

Thanks & Regards,

Arindam Samanta.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Feb 06, 2014 at 10:30 AM

    Hi Arindam,

    Try this:

    <TextField liveChange="validateFunction"/>


    And create validateFunction on your controller.

    Kind regards

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Feb 06, 2014 at 10:45 AM

    Hi Arindam,

    You cannot define any functions in XML Views. The editor itself provides a controller.js file whenever you try to create a view, whether it is XML, JavaScript or HTML view, because here the logic can be implemented in JS files only.

    You can a call specific function defined in your controller.js to your XML Views, Example already shared by Angel Puertas.

    Regards,

    Sharique

    Add comment
    10|10000 characters needed characters exceeded