Hi Muni,
Please find the solution in the link below:
Declarative Support - User Interface Add-On for SAP NetWeaver - SAP Library
The following example shows the concept by combining a sap.ui.commons.TextField with asap.ui.commons.Button control. When you click the button, the value of the text field is displayed in an alert box:
<!Doctype HTML> <html> <title>Declarative Programming for SAPUI5 - sample01</title> <script id="sap-ui-bootstrap" type="text/javascript" src="resources/sap-ui-core.js" data-sap-ui-theme="sap_bluecrystal" data-sap-ui-libs="sap.ui.commons" data-sap-ui-modules="sap.ui.core.plugin.DeclarativeSupport" > </script> </head> <body class="sapUiBody"> <div data-sap-ui-type="sap.ui.commons.TextField" id="message" class="my-button" data-value="Hello World"></div> <div data-sap-ui-type="sap.ui.commons.Button" data-text="Click me!" data-press="handlePress"></div> </body> </html>
Regards,
Ashvin