About me
I live in Lund and work, well, at probably the best company in the world
Tag Cloud
Active Directory
AD
ajax
Android
api
app
Apps
ASP.NET
azure
C#
CAML
Chuvash
Client Object Model
codeplex
console
csom
csr
css
css3
database
devtools
extension
git
github
google chrome
html
html5
javascript
jQuery
jQuery tmpl
js
jslink
jsom
json
keyboard
keyboard layout
LINQ
linux
localization
log
masterpage
ModalDialog
monitoring
office365
onet.xml
Performance
Powershel
PowerShell
raspberrypi
REST
rättigheter
script
Serverinstallation
Sharepoint
SharePoint 2010
sharepoint 2013
sharepoint2013
sharepoint apps
sharepoint online
SP.js
spapp
SPField
SPList
SPListItem
spo
SPWeb
subversion
tips
ubuntu
VHD
Visual Studio
webpart
webparts
windows
xml
Top posts
Certiffications


Blog Stats
- 601,615 hits
Recent Comments
Blogs I Follow
- Daniel Chronlund Cloud Tech Blog
- Вула Чăвашла
- Discovering SharePoint
- Bram de Jager - Architect, Speaker, Author
- SharePoint Dev Lab
- GUID(E) To SharePoint
- SharePoint Dragons
- Mai Omar Desouki
- Cameron Dwyer
- paul.tavares
- Share SharePoint Points !
- Simple Stuffs
- Jimmy Janlén "Den Scrummande Konsulten"
- Aryan Nava
- SPJoel
- SharePointRyan
- SharePoint 2020
- Aharoni in Unicode
- ... And All That JS
- blksthl
How do I get the args object I assigned to the ModalDialog BACK? Basically I have a modal dialog box which I create with an args object attached to it. I want to pass those arguments into the modal dialog box (already done) and, if the user does not select something on the Modal Dialog box, I need to RETURN the same values that I passed in. How do I reference the args object from inside of a JavaScript “cancel” or “close window” method OF THE MODAL DIALOG ITSELF?
function cancelForm() {
var dialogResult = SP.UI.DialogResult.OK;
var args = SP.UI.ModalDialog.get_childDialog().get_args();
var returnValue = Array();
returnValue[0] = SP.UI.ModalDialog.get_childDialog().get_args(“SupervisorCn”);
returnValue[1] = SP.UI.ModalDialog.get_childDialog().get_args(“Supervisor”);
SP.UI.ModalDialog.commonModalDialogClose(dialogResult, returnValue);
}
I’m getting “undefined” when I check the value of returnValue[0] after this assignment takes place. Also “args” is “undefined” after the call to “get_args()” as well. Any feedback you can offer is appreciated.
Hi, Jess. I can’t test it now, but I think, you should get the args first, and then get your properties:
I would even use the same names for properties, like:
Hello Anatoly and thank you for your rapid response. I am off work and offsite until Monday so cannot try this but will do so when I return first thing Monday morning. I appreciate your help. Have a good weekend.
You’re welcome! I am actually off work, too. On Monday I am at work so I can test it and try it, too.
Hey Anatoly, I tried doing the same thing you have done here, but instead of the input value I keep getting the [object Object] as a result… I tried attaching a .toString() the property, but that didn’t work either, have you seen this before or do you have any ideas?
Hi! How do you output this property? running alert of an object would result in [object Object]. But it doesn’t mean you get “[object Object]”. Maybe it works fine. Try console.log in a web browser (but not in IE 🙂 ).