Hi Noah,
I am glad you are trying to help on my issue. Sorry I have to use "myserver", "myworkspace" to replace our server and work space name in my code.
I had studied the sample you directed, also I have went through all esri JavaScript samples. But unfortunately I have not found a solution for my question. It would be really help if someone can read my code and have a solution.
I don't know why the code is not working. Same concept works in Silverlight API. Any thing I am missing or a bug from esri JavaScript API?