cancel
Showing results for 
Search instead for 
Did you mean: 

how to end change event triggered of input field?

Former Member
0 Kudos

Hi All,

I have input field in a view 2 and validation for the same has been written in the change event.So lets say user inputs some wrong input and then without clicking enter or leaving focus he click another button to move to view 1.so now the view 1 is displayed and popup for the validation is also is displayed which is odd.

so how to stop or end any kind of process happening in view 2 and then proceed to view 1 ? in this case the change event functionality.

Accepted Solutions (0)

Answers (6)

Answers (6)

Former Member
0 Kudos

@ robin @ santhosh @maksim Thats is the right way to validate  but the end user is not ok with it.His point of view its like in view 2 he entered some value by mistake and now he wants to move to view 1 but he sees the "no data found" popup in view 1 which is strange for him.

I tired the detachchange too its not working ..

is there any other solution possible for this

former_member182372
Active Contributor
0 Kudos

post your code

Private_Member_15166
Active Contributor
0 Kudos

How you are using detachChange??

Paste here a little bit of code what you have done till now.

Qualiture
Active Contributor
0 Kudos

If he want's it like that, then there should be a 'reset' button or something, changing everything back to the original state.

Navigating to another view without validating wrong input is just plain wrong. It might maybe help this particular user, but other users will be confused as to why their data is not being saved when navigating to another view

former_member182372
Active Contributor
0 Kudos

there is a clearlly issue with navigation condition, it should not happen if validation fails

Qualiture
Active Contributor
0 Kudos

I believe the user should not go to view 1 in the first place; if he entered something wrong, then the navigation should be cancelled and the validation popup should be shown.

Why do you want to allow users to navigate away from the screen if they entered invalid input?

former_member182862
Active Contributor
0 Kudos

Precisely. if we do it right. We should stop where the error happens. Otherwise, user is going to be confused

JS Bin - Collaborative JavaScript Debugging

Former Member
0 Kudos

Hi Thivi,

There is a property "valueLiveUpdate" for sap.m.Input.


Definition - Indicates when the value gets updated with the user changes: At each keystroke (true) or first when the user presses enter or tabs out (false).


Try to user it


Hope this will help.


Regards,

Abhijeet

santhu_gowdaz
Active Contributor
0 Kudos

call validation method. and the validation is fine then do navigation.

Private_Member_15166
Active Contributor
0 Kudos

Use detachChange event before processing that view.

JsDoc Report - SAP UI development Toolkit for HTML5 - API Reference - sap.m.InputBase

On press event of that button through which you are navigating to another view, get the ID of that input field and after that write this.

oInput.detachChange();