I'm puzzled by the CSOM documentation, and am not sure what method/properties I should be using. I'd like to use a webdialogwindow to display client side messages (as a better formatted version of Confirm/Alert). I can populate its contents server side easily enough, but I'd like the option of filling it on the client end too.
I don't want to give it a URL, I want to edit the content of an existing control within the content pane (labels or asp:Literal or suchlike).
I am doing something similar. I have a userControl with a label inside the WebDialogWindow content pane template. Then I use jQuery to manipulate the content. My javascript "Alert" function is:
function wjDlgMsg_show(sCaption, sMsg, sHeight){ // get the dialog var dialog = $find("ctlDlgMsg_dlgIMsg"); // use jQuery to set the caption $("#ctlDlgMsg_dlgIMsg .igdw_wgOfficeBlueHeaderCaption").text(sCaption);
// use jQuery to set the label content (as html) $("#ctlDlgMsg_dlgIMsg .lblPopMsg").html(sMsg);
// show the dialog dialog.show();
// set dialog height. Could not figure out how to calculate it automatically // NOTE: docs say parameters are height, width, ... // actual parameters are: width, height, ... if (sHeight != "") dialog.setSize(null, sHeight, null); // Can also set the caption here (must be done after dialog is shown) //dialog.get_header().setCaptionText(sCaption);}
Thanks. I eventually came up wqith something similar, though not as elegant (I'm not that familiar with JQuery yet). But I did get what I wanted.
I"m assuming the JQuery lines are literals created using $find('<%=dlgMessage.ClientID%>') style syntax - an you show me the original source lines please?