update the lookup of second field based on the changed value of first field

Hi

I have created two new fields in a table and i am using these fields in EP (through datasets)

I have a lookup filtering on the second field based on value in the first field.

I have written datset lookup method for the second field.

I have used these fields in a creation screen and the filtering is working properly

The same two fields are used in the edit screen.

But here when i change the value in first field, the lookup of second field is not getting updated based on the changed field. But it is getting the lookup based on the last time saved field.

In both cases the fields are from same table (but different datasets).

can anyone let me know what i am missing here ?
How can i update the lookup of second field based on the changed value of first field ?

Thanks in advance