It seems that after performing an ajax refresh of a link, the Widget_Click server action doesn't seems to be working as it is anymore. As the link has a input parameter, I need to refresh the link so that I am able to pass the updated input parameter to the next destination. However, it doesn't seems to work.
Hi Jianlong,
I'm not sure, but I think the Ajax will happen only at the END of the action, and at this point, the Click already as bind to the old link id.
If that is the case (I would have to test this, but will not have time until next year ;) rs), a possible (ugly) workaround would use a specific class (for example), and run a JavaScript instead of the Click, something like this: "$('.myclass').click();".
This would avoid the problem of the changed ID.
Cheers.
Eduardo Jauch wrote:
Hi Eduardo,
Thanks for your advice. It worked.
Hi Lin,
If you don't have ajax refresh then it is working for you or not?
Thanks
Rajat
Rajat Agrawal wrote:
Previously, without the ajax refresh it is working fine.
It means if you remove ajax refresh it is working fine for you. Please can you send your OML may be you are doing small mistake.
Thanks,
Rajat Agrawal
I found out that the id of the link will be changed after ajax refresh which may be causing the problem. However, for Widget_Click, it should be getting the new widget id. If it's not, how can I get the updated widget id to be the input parameter for Widget_Click?
Jianlong Lin wrote:
Hi Jian,
We never use ID because ID generated new everytime. You need to give class instead of id when we use javascript. Do one thing just give name to your link like Rajat and then call link name.id like Rajat.Id in the click widget it will work.
Hi Rajat,
Attached is the oml file.
@Rajat,
When you use widget.id you are using the ID of the widget...
@Eduardo - Yups correct.. They are refreshing the link so new ID generating everytime.