Preethi Jha Preethi Jha - 8 months ago 25
jQuery Question

JQuery after using $.publish to load a select,want to select particular option in struts 2 select tag

I am using

to populate the dropdown (Struts 2 select tag) after that, I want the dropdown to be auto-selected to a value.

I tried the following:

//$('#selectedAttribute option[value="attributeId"]');

None worked.


No, after using $.publish() you can't auto select the drop down. The code to auto select dropdown should be inside the $.subscribe(). Some another event you should publish when loading is complete.

  $.subscribe('loadCompleteAttributeList', function(event, data) {