Quantcast
Channel: SCN: Message List - SAPUI5 Developer Center
Viewing all articles
Browse latest Browse all 8124

Re: JQuery in sap ui5

$
0
0

Hi Arjun,

 

combining the answers above and explaining them a bit more:

1. When working with UI5 controls, you normally interact with them on JavaScript API level. So for your input you don't search it in the HTML and get the value from there, but you use input.getValue().

2. While you CAN use jQuery as you did to access the corresponding HTML elements, you have to keep in mind that at the time when you look for the HTML, it actually exists. I.e.: the input must be visible on the screen. This is usually the case when you e.g. search it in the "press" event handler of a Button.

3. There is something special about the IDs of controls in declarative Views (e.g. XMLViews): to avoid duplicate IDs when a View is displayed twice, the Control ID you give (in this case "ip") is prefixed with the View ID to make it unique. There's the method View.createId(), where you can pass in the plain ID and it returns the prefixed ID valid for this View. This ID could then be used with jQuery. In programmatic Views (JSView) there is no such automatic prefixing.

 

Regards

Andreas


Viewing all articles
Browse latest Browse all 8124

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>