Quantcast
Channel: SCN : All Content - All Communities
Viewing all articles
Browse latest Browse all 8150

jQuery for DateTimeInput

$
0
0

Hi Experts,

 

I have created datetime input using XML code in SAPUI5. The code is below:

 

<Page title="Date Time Validation" showNavButton="true" >

         <content>

         <Label  id="l1" text="Enter Date" visible="true" design="Bold" required="true" labelFor="dtTime"></Label>

         <DateTimeInput id="dtTime" type="Date" displayFormat="dd/mm/yyyy"></DateTimeInput>

         </content>

         <footer>

          <Bar>

                <contentRight>

                        <Button

                            id="b1"

                            icon="sap-icon://bed"

                            press="Click"

                            />

          </Bar>

        </footer>

</Page>

Now I want to show the date value as a message when click the button. This code I have written controller.js file. The code is below:

Click: function(oEvent)

    {

        alert("Today is:" + $("#dtTime").val()  );

       

    },

 

But output is coming as undefined. Below is screen shot in debug mode:

      

       

Why it is undefined? Kindly provide the solution. It will be very helpful for me.       

   

   I tried this code also:

         //var shell = oEvent.oSource;

        //var x = sap.ui.getCore();

        //var dt = x.byId("dtTime").getValue();

This is also not working.

 

Thanks & Regards,

Arindam Samanta.


Viewing all articles
Browse latest Browse all 8150

Trending Articles



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