Dropdown change event not called

Hi All,

I have dropdown in webblock . This web block is used in page but dropdown event is not getting fired. 


here is code snippet : 

Web block :

Hi, 

Why do you say the event is not called?

The only reasons to the OnChange event to not being called is if you are not change the selected item or if you had a JavaScript error before it. 

What was you expecting to happen in the OnChange event? 

Cheers

Eduardo Jauch wrote:

Hi, 

Why do you say the event is not called?

The only reasons to the OnChange event to not being called is if you are not change the selected item or if you had a JavaScript error before it. 

What was you expecting to happen in the OnChange event? 

Cheers

Why do you say the event is not called?

--> On change of dropdown function mentioned in Onchange event of dropdown should be called. 

The only reasons to the OnChange event to not being called is if you are not change the selected item or if you had a JavaScript error before it. 

 --> there is only one dropdown change event and no other custom javascript written. I see in console there are no javascript errors. 

What was you expecting to happen in the OnChange event?  There is some business logic needs to be executed to refresh certain variables


Hello

Can you try to debug that onchange action and change something on the combo to see if it executes or press f12 and console tab to check if you have any script errors.


Carlos Diogo Lima Gonçalves wrote:

Hello

Can you try to debug that onchange action and change something on the combo to see if it executes or press f12 and console tab to check if you have any script errors.


problem is that onchange event is not getting fired. On F12 there is nothing logged .



Nilesh Rokade wrote:

Carlos Diogo Lima Gonçalves wrote:

Hello

Can you try to debug that onchange action and change something on the combo to see if it executes or press f12 and console tab to check if you have any script errors.


problem is that onchange event is not getting fired. On F12 there is nothing logged .



ok then can you please provide a oml of this problem? 


Thank you


Hi Nilesh,

I'll ask differently:

1. Did you change the selected item in the combo box, with debugger ON and a breakpoint at the beginning of the action it was supposed to run? 

If this is the case (the routine is not really being called) and there are no JavaScript errors in the Console, I can't help without being able to see the code and test it.

You may try to reproduce the problem in a small module and attach it here.

Cheers

Eduardo Jauch wrote:

Hi Nilesh,

I'll ask differently:

1. Did you change the selected item in the combo box, with debugger ON and a breakpoint at the beginning of the action it was supposed to run? 

If this is the case (the routine is not really being called) and there are no JavaScript errors in the Console, I can't help without being able to see the code and test it.

You may try to reproduce the problem in a small module and attach it here.

Cheers

1. I tried to change the dropdown while debugger is ON 

2. I will try to provide sample OML as current one is enterprise property and cannot be shared. Will post it shortly .Unfortunately personal environment is of platform 11 and my studio is of 10 ,not sure if there is way to change platform version to 10 for personal environment 


Hi Nilesh,

No is not. You need to install the service studio 11 on your machine and use it to do anything on personal environment. 

Anyway you can do a simple example in your enterprise environment and upload it here. when you do that the property is removed.

Regards,

Marcelo

Solution

Marcelo Ferreira wrote:

Hi Nilesh,

No is not. You need to install the service studio 11 on your machine and use it to do anything on personal environment. 

Anyway you can do a simple example in your enterprise environment and upload it here. when you do that the property is removed.

Regards,

Marcelo


Hi Marcelo


Thanks for your reply. I figured out issue . 

We were populating data in this drop down from API.  API was sending same id or key ,which is causing this issue.


e.g. 

ID =10 , ItemText= 'Demo1'

ID =10 , ItemText= 'Demo2'

After initialising dropdown with these duplicate ID ,change event was not firing. 

For now added temporary number to ID so that it does not repeat same ID.





Solution

Hi Nilesh,

This is interesting.
I did mark your answer as the solution, as you found the issue.

Thanks for sharing.

Cheers