ASP.net
Awesome
Learn
Forum
Buy
Demos
Sign In
☾
☀
Switch to
Dark
Light
Mode
this site works best with javascript enabled
Ask Question
ClosePopup and AddPopupEntity javascripts
Title:
B
I
{code}
?
In our code below when we fire "ClosePopup" and "AddPopupEntity" javascripts in .Button("Add", "AddPopupEntity") and .Button("Close", "ClosePopup"), we get a null value exception. What are we doing wrong here? @(Html.Awe().InitPopupForm() .Name("PopupParams") .Width(900) .Height(700) .Resizable(true) .Button("Add", "AddPopupEntity") .Button("Close", "ClosePopup") .UseDefaultButtons(false) .Url(Url.Action("PopupWithParameters", "PopupHost")) .Success("PopupSuccess") .Parent(Model.JobPositionID.ToString()) .Parameter("PopupType", "JobPositionLookup")) <button type="button" class="awe-btn" onclick="awe.open('PopupParams')">Select Job Position</button> function ClosePopup() { $(this).data('api').close(); \\ Throws null exception } function AddPopupEntity() { $(this).data('api').close();\\ Throws null exception }
Save Changes
Cancel
Deep
asked at 07 Mar 2016
well assuming you're using jQuery or bootstrap popup (unchanged), it works for us so maybe this is the problem : http://aspnetawesome.com/learn/mvc/CommonProblems#Popup-problems
at 07 Mar 2016
Omu
Answers
B
I
{code}
?
Thank you for the response but that did not work. I think our scenario is a slightly different scenario and that is what is causing this issue. So basically using your ASP.net MVC Awesome control we have designed a Grid. When we click on this Grid, we get a child popup in which we have another Grid. When we click on the Edit button that is associated with the Grid in the Child popup window, we get another popup that contains a Grid with check boxes. Now this "Grand Child" popup window is the one that has the close button and fires "$(this).data('api').close();" I believe in your scenario we open up a child window from the master page and when we click on the close button on the child window we get back to the master page and everything works fine. But in our case our close button is in the child pop-up that has been opened from another child pop-up window and so when we press the close button in this "Grand child" pop-up we don't get to the Master page but instead to the child window from which this grandchild window originated and that is what is probably causing the problem. Is there a way to resolve this?
Save Changes
Cancel
Deep
answered at 08 Mar 2016
create a mini demo as described here: http://aspnetawesome.com/learn/mvc/CommonProblems#Isolate-the-problem and I'll be happy to investigate it
at 08 Mar 2016
Omu
please
Sign In
to leave an answer
By accessing this site, you agree to store cookies on your device and disclose information in accordance with our
cookie policy
and
privacy policy
.
OK