Skip to Content
avatar image
Former Member

input field type date

Hello All,

I have two questions regarding an input field bound to a value attribute of type date.

When I check for null on the input field using messages and i set message type as error , i cannot enter another date in the input field. However if I set the message type as standard it allows me.How can i fix this?

Also how do I perform action after a date is chosen? I created an action ONENTER but the code within the method does not run

Thanks

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

2 Answers

  • Sep 24, 2005 at 03:55 AM

    Hi Vijay,

    The ONENTER event is fired when you press the ENTER key at your keyboard.

    There is no event fired when a control looses focus. This is what you would need. This is probably not fired because it would dramatically slow down the performance of your application if with every loose focus a server roundtrip would be triggered.

    In regular J2EE applications this is done by JavaScript but this is not possible in Web Dynpro.

    You can emulate such a behavior by using the wdDoBeforeNavigation method of your component controller. This method is called with each server roundtrip. In this method you can compare the new date with the old date (if stored anywhere in the context) and react in any way to the change.

    Regards

    Helmut

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Helmut,

      Thanks for the reply. So if I have to display a date in a text view on the same view as soon as I set the date in the input field how would I be able to do it?

      Thanks

  • avatar image
    Former Member
    Sep 26, 2005 at 08:18 AM

    Hi Vijay,

    1) I have no help to offer for your first problem. Even I am very much interested to know why that happens.

    2) Regarding your second question, In webdynpro we cannot define our own listeners for a UI element. Instead we have to use only those events given by SAP itself. For input field, only one such event is already provided - 'onEnter'. So If you want to capture the date entered through an input field and show it in a text view, you either have to force the user to press Enter or make use of a button or LinkToAction for that. Using DateNavigator instead of InputField would provide few more events like 'onStartDateChange' for this purpose.

    Hope this helps,

    Best Regards,

    Nibu.

    Add comment
    10|10000 characters needed characters exceeded