Forums: [SOLVED] Detecting Edit Mode in Popup - Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

[SOLVED] Detecting Edit Mode in Popup Rate Topic: -----

#1 User is offline   Eric_ 

  • Member
  • PipPip
  • Group: Members
  • Posts: 24
  • Joined: 20-April 17

Posted 10 June 2019 - 08:32 PM

Reference to this: Open Javascript Popup Window then automatically close it after saving

Placing the following code in after record added" will close a popup and reload the calling page.

//Save popup and refresh window!
var message2 = "<script type=\'text/javascript\'> window.parent.location.reload(false); self.close(); </script>";
MVCFunctions.EchoToOutput(message2);


The problem with this is that it reloads the calling page even if that page is in EDIT mode. The edit mode is cancelled and the page reloads without saving any data.
Any tips or tricks to possibly detect edit mode in the calling page. Or maybe even programmatically press save on the calling page from the popup?

Looking if any of you have come across this and what best practice you have used.

Thanks,
Eric
0

#2 User is offline   admin 

  • Administrator
  • PipPipPip
  • Group: Admin
  • Posts: 16435
  • Joined: 03-February 03
  • Gender:Male

Posted 11 June 2019 - 01:24 PM

I don't think I follow. Are you trying to open a popup from the page that is already in the popup? Can you provide the whole picture?
Best regards,
Sergey Kornilov
0

#3 User is offline   Eric_ 

  • Member
  • PipPip
  • Group: Members
  • Posts: 24
  • Joined: 20-April 17

Posted 11 June 2019 - 06:23 PM

View Postadmin, on 11 June 2019 - 08:24 AM, said:

I don't think I follow. Are you trying to open a popup from the page that is already in the popup? Can you provide the whole picture?




I have a normal List page with a button on it. The button opens the add page of another table in a pop up. After I close the pop up I would like to refresh the list page BUT the problem is if the list page is in edit mode
when I press the button and open the popup then you lose some data when you reload.

Maybe a better way to show my issue is the following steps.
1. List page.
2. Put List page in Edit mode.
3. Edit some data without pressing save.
4. Click a button which opens the add page of another table in a pop up.
5. I would like to save the list page if it is in edit more before I reload it after the pop up is closed.
0

#4 User is offline   admin 

  • Administrator
  • PipPipPip
  • Group: Admin
  • Posts: 16435
  • Joined: 03-February 03
  • Gender:Male

Posted 11 June 2019 - 09:02 PM

What does it mean "List page in Edit mode"?
Best regards,
Sergey Kornilov
0

#5 User is offline   Eric_ 

  • Member
  • PipPip
  • Group: Members
  • Posts: 24
  • Joined: 20-April 17

Posted 13 June 2019 - 05:31 AM

View Postadmin, on 11 June 2019 - 04:02 PM, said:

What does it mean "List page in Edit mode"?


Inline edit.
0

#6 User is offline   admin 

  • Administrator
  • PipPipPip
  • Group: Admin
  • Posts: 16435
  • Joined: 03-February 03
  • Gender:Male

Posted 13 June 2019 - 02:12 PM

I see what you saying. Technically speaking you can do something like this but it looks like a bad design.

You can use jQuery to find and click all Save buttons/icons on that page before reloading the page. The problem is that you need to wait till all records get actually saved before refreshing the page. If you refresh it too soon some changes won't be saved. This is why I call it a bad design.
Best regards,
Sergey Kornilov
0

#7 User is offline   Eric_ 

  • Member
  • PipPip
  • Group: Members
  • Posts: 24
  • Joined: 20-April 17

Posted 13 June 2019 - 04:18 PM

View Postadmin, on 13 June 2019 - 09:12 AM, said:

I see what you saying. Technically speaking you can do something like this but it looks like a bad design.

You can use jQuery to find and click all Save buttons/icons on that page before reloading the page. The problem is that you need to wait till all records get actually saved before refreshing the page. If you refresh it too soon some changes won't be saved. This is why I call it a bad design.



Okay thank you. I'll steer away from that.
0

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users