enter image description hereI have write a javascript method on SelectList Option

<apex:selectList id="IdSelectedMembers" value="{!selectedMemberIds}" multiselect="true" size="8" style="width: 200px;" ondblclick="OpenEvent(this.id);">
<apex:selectOptions value="{!selectedMemberOption}"/>                                                    </apex:selectList>
//-----JavaScript Method ----
function OpenEvent(sVal){    
    var sValue = document.getElementById(sVal).value;   
    var newwindow = window.showModalDialog("/apex/EventCalendar?id="+sValue, 'open page','_blank','scrollbars=yes,toolbar=no,status=no');

I got alert msg but new window not opening. can you help me.

  • 2
    this is a deprecated method. Why don't you just use window.open() – Tushar Sharma Oct 12 '16 at 9:22
  • Which one window.showModalDialog or window.open() – Tushar Sharma Oct 12 '16 at 10:00
  • @TusharSharma: please put your answer into answer, and not into comments – Patlatus Oct 12 '16 at 10:32
  • @Patlatus not sure if OP goes with my suggestion or change his approach. Anyway my answer is added. Thanks. – Tushar Sharma Oct 12 '16 at 11:14
  • 1
    Hi @TusharSharma I have used window.open(). – GmDeepakChounan21 Oct 12 '16 at 11:26

This is a deprecated method. You should use window.open() with same set of parameters

window.open("/apex/EventCalendar?id="+sValue, 'open page','_blank','scrollbars=yes,toolbar=no,status=no');
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.