Hi Archana,
Your code is fine. When are you opening the dialog, I mean on which control event?
Check this sample, where the table select dialog opens on button press event, I have used the same code: JS Bin - Collaborative JavaScript Debugging
Regards,
Sai Vellanki.