Weblocks - Reactive web

Hello,

I have created a weblock in the core module with two dropdowns. When the user selects a value from the dropdown. Based on the mapping, the value in the second dropdown should be refreshed. I am able to achieve this based on trigger events. I have done this on the on chnage of first dropdown. But the issue is, when the event is triggered, the value in the first dropdown is getting refreshed. Can someone please help me with this?


TIA

Hi Priya Khade,

Are you using both two drop-downs in the same web-block? In that case try to not use an event trigger, because that will notify the parent of the web-block (and maybe to reload this last). Let me know if this helps. 

Cheers!

Marco Arede wrote:

Hi Priya Khade,

Are you using both two drop-downs in the same web-block? In that case try to not use an event trigger, because that will notify the parent of the web-block (and maybe to reload this last). Let me know if this helps. 

Cheers!


Yes, both the drop downs are in the same weblock. the thing i am not doing any data fetching in webblock. thats why i used trigger event

Priya Khade,

As far I understand, you are feeding all data of drop-downs via parent web block. And the value of the first drop-down changes because of the content refresh. 

See if any of these ideas help:

1) Hold and pass (in/out) the selected value control this outside the web block.

2) Separate the two drop-down out of same web block.

3) Have the drop-downs in the parent of the web block itself.

Cheers!

Marco Arede wrote:

Priya Khade,

As far I understand, you are feeding all data of drop-downs via parent web block. And the value of the first drop-down changes because of the content refresh. 

See if any of these ideas help:

1) Hold and pass (in/out) the selected value control this outside the web block.

2) Separate the two drop-down out of same web block.

3) Have the drop-downs in the parent of the web block itself.

Cheers!

Marco Arede,

your understanding regarding my implementation is absolutely right. thanks for solution as well.

is there any other way to the get desired result?

Because further, in the same web block there are many such cases as above mentioned. 


TIA


Hi Priya,

May I know why you want to fetch the data in parent instead of webblock.

I would suggest to fetch the data inside the webblock, this way you will have good level of abstraction.