cancel
Showing results for 
Search instead for 
Did you mean: 

Regd InputField(s) of type Date

Former Member
0 Kudos

hi all,

i've two inputfields of type Date. the first one user selects a date using the date icon after the input field. i want to set the second date(addition to selected date) immediately after selecting the first date..! is it possible? if yes how?

tnx,

-JB

Accepted Solutions (1)

Accepted Solutions (1)

siarhei_pisarenka3
Active Contributor
0 Kudos

Hi

It's possible with Date Navigator. Check this thread: .

BR, Sergei

Answers (2)

Answers (2)

former_member40425
Contributor
0 Kudos

Hi,

As there is no action correspoding to date icon which is coming by using date type with input field. You can not populate date automatically by just selecting date through date icon as there is no event handler associated to that. You have only one option to code in the onEnter event hander of input field, this will give you date in the another i/p field after pressing enter on first i/p field.

Regards,

Rohit

Former Member
0 Kudos

hi rohit,

thanks a lot for your inputs. i've already implemented the onEnter but still looking for any better solutions for onClick on date.

anyways let me go thru either of the option post to discussion with user.

tnx, JB

pravesh_verma
Active Contributor
0 Kudos

Hi JB,

You have a prperty named firstSelectedDate with the Date Navigator. Bind the context attribute of type date to the firstSelectedDate property of the datenavigator UI element.

Let say the context attribute to which you have bound the UI element has the name date and the second attribute name is endDate. Your requirement is to set the end Date as soon as the date is slected in the first inout field. Now create an action for the event onDaySelect. Write the following code in the event handler


public void onActionselectdate(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
  {
    //@@begin onActionselectdate(ServerEvent)
    // Take the value of the selected date.
    Date date = wdContext.current<NODE_NAME>element.getDate();
  
  // Set the second date equal to selected Date.
  wdContext.current<NODE_NAME>element.setEndDate(date);

    //@@end
  }

I hope this will solve youri ssue. Please revert back in case you need any further assistance on this.

Thanks and Regards

Pravesh

Former Member
0 Kudos

Hi Both,

both of you gave me good option to choose datenavigation ui element, which i was not aware to use because of wrong assumption tht it is used only for date range. thankful to both of you.

but when run my appln it shows the date ui element directly, but i want something like my previous case. where on click of date icon (next to inputfield), the date ui should be visible to select the date. so is there any way to use this date navigator on click on date icon?? is it possible?? or popup window is the last option?

tnx,

-JB