cancel
Showing results for 
Search instead for 
Did you mean: 

Simple query-To change value of UI if the value of other UI element changes

Former Member
0 Kudos

Hi Experts,

In the WD Screen. there are two fields called Start Date1 and Start Date2. User initally enters Start Date1. The value of Start Date2 get populated. It becomes same as Star Date1

The user enter other details and data is processed.It caters the basic requirement

We have another requirement here - The user may change the Start Date1 and if he does so Start Date2 should also get changed and should become same as modified Start Date1.

How we can do so?

Regards,

Gary

Accepted Solutions (1)

Accepted Solutions (1)

former_member40425
Contributor
0 Kudos

Hi,

If you created value attributes for your input fields suppose va_startDate1 and va_startDate2.

Then in the onenter of first startdate1 write the following code. it will populate the same date in the startdate2 i/p field.

Date startDate1 = wdContext.currentContextElement().getVa_startDate1();
    wdContext.currentContextElement().setVa_startDate2(startDate1);

Now as user will press enter on startdate1 then same value will be there in the second field.

I hope it helps.

Regards,

Rohit

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Gary,

So, the funtionality of StartDate 2 getting modified on entering StartDate 1 already exists?

you just need to find out where that funtionality is coded and then you can add your modified functionality. Basically both the date fields seem to be bound with same context attribute. so when one is changed other is changing with it.