Issue 367: data from popup
Status:  Fixed
Owner: ----
Closed:  Nov 2009
Reported by xaxi...@gmail.com, Oct 29, 2009
Hi guys,

how could I pass data from popup back to the application? 

thanks for answer
Oct 29, 2009
Project Member #1 nyro...@gmail.com
You need to write some javascript function to do that.
The best place to add your event binding might be the endShowContent callback.
As you could do many different thing, I can't help you more with that.
Oct 30, 2009
#2 xaxi...@gmail.com
Thank you for your quick answer, I see what you mean but maybe i didn't express
myself good enough. 
Here is the situation. Let's say the popup let the user to enter some data into
textbox and this data will be work with in the original website from where the popup
was initiated. Aparently in the popup you have access to "mother-website" elements so
i could set some hidden value, but this would make the popup dependent on the
"mother-website". If i put this logic into endShowContent callback i would have to
write a new javascript function everytime i use popup, which is a lot of time in the
application. What I am looking for is a similar thing what window.showModalDialog() does.
Sorry if i didn't make myself clear, I am new to javascript
Thanks for help
Nov 4, 2009
Project Member #3 nyro...@gmail.com
I don't see the problem regarding the place where are placed the logic.
and you can create only one function that you'll use for every endShowContent
callback. I don't see any solution to not execute this callback everytime a new modal
is shown to create your bind action.

Have you a problem to do it or is it just a wondering on how to do it best ?
Nov 11, 2009
#4 xaxi...@gmail.com
is there a way to pass parameter to the bind action expect storing it somewhere in
pop up and accessing it through elts object?
Nov 11, 2009
Project Member #5 nyro...@gmail.com
yes you can do that. But I never thought about it actually.

Basically, you can pass anything you want in the nyroModal parameters.
Then you'll be able to retrieve it from any callback in the 'settings' parameters.

Did it help?
Nov 12, 2009
#6 xaxi...@gmail.com
yes yes this could definitely help, how could i then add, let's say, field "result"
into "settings" parameters?
Nov 12, 2009
Project Member #7 nyro...@gmail.com
$('.nyroModal').nyroModal(results: 'What you want here');

OR

$.nyroModalSettings({results: 'What you want here'});

OR

you could also add anything you want/need inany callback.
Status: Fixed