Refresh parent page when child-page is closed?

The recommended method of customizing your AppGini-generated application is through hooks. But sometimes you might need to add functionality not accessible through hooks. You can discuss this here.
Post Reply
udayvatturi
AppGini Super Hero
AppGini Super Hero
Posts: 85
Joined: 2014-06-14 03:08
Location: India
Contact:

Refresh parent page when child-page is closed?

Post by udayvatturi » 2014-07-29 12:35

Is there a way that i can refresh the page automatically when the child Model Dialog is closes?

I tried the following ways .
1. I couldn't find unique ID for modal dialog , so i am unable to add on hide listener.
2. Few magics hooks code even they are not working.

any suggestions are welcome .

Thanks
Uday

csr21
Posts: 5
Joined: 2014-08-25 11:07

Re: Refresh parent page when child-page is closed?

Post by csr21 » 2014-08-26 09:20

Hi Uday,

Please share your problem is solved.
If not yet, please elaborate it a little bit. I mean which appgini files you are talking about.
I have already done this.

I just want to be sure that ur reqment is same as I understood.

udayvatturi
AppGini Super Hero
AppGini Super Hero
Posts: 85
Joined: 2014-06-14 03:08
Location: India
Contact:

Re: Refresh parent page when child-page is closed?

Post by udayvatturi » 2014-08-26 14:26

Hi,
My issue is resolved, Thanks

csr21
Posts: 5
Joined: 2014-08-25 11:07

Re: Refresh parent page when child-page is closed?

Post by csr21 » 2014-08-27 09:47

Uday,

can you share the solution for this problem..

Stevo2112
Posts: 10
Joined: 2015-01-14 15:05

Re: Refresh parent page when child-page is closed?

Post by Stevo2112 » 2015-01-24 05:23

udayvatturi wrote:Hi,
My issue is resolved, Thanks
I would also like to see the solution to this problem, Thanks in Advance.

User avatar
a.gneady
Site Admin
Posts: 1281
Joined: 2012-09-27 14:46
Contact:

Re: Refresh parent page when child-page is closed?

Post by a.gneady » 2020-08-09 13:32

For anyway looking for a way to add an event listener on closing a modal window:

Code: Select all

$j('.modal').on('hidden.bs.modal', function(){
	alert('modal closed!');
})
You should place the above code somewhere that would be executed after the modal is opened. For more on modal events: https://getbootstrap.com/docs/3.4/javas ... als-events
:idea: AppGini plugins to add more power to your apps:
  • DataTalk is an innovative AppGini plugin based on ChatGPT that allows you to interact with your AppGini database using natural language questions, without writing any SQL. Check the demo video
  • Mass Update plugin: Update multiple records at once and improve your workflow efficiency.
  • Check our other plugins and get a generous discount of up to 30% when buying 2 or more plugins.

User avatar
zibrahim
Veteran Member
Posts: 137
Joined: 2020-01-28 18:30
Location: Malaysia

Re: Refresh parent page when child-page is closed?

Post by zibrahim » 2020-11-02 14:10

Hi Ahmed,
I am sorry but I tried to look for the solution for this issue but I could not find it because of the lack of my knowledge.
I sincerely hope that you can help me and others who need some help with this issue.
Perhaps others who have solved this puzzle can also contribute.
Thanking you in advance. Stay safe and healthy.
Zala.
Appgini 24.10.1579, MacOS 14.3.1 Windows 11 on Parallels.

pbottcher
AppGini Super Hero
AppGini Super Hero
Posts: 1635
Joined: 2018-04-01 10:12

Re: Refresh parent page when child-page is closed?

Post by pbottcher » 2020-11-02 14:49

Try

Code: Select all

$j(function () {
  $j('.modal').on('hidden.bs.modal', function(){
	location.reload();
  })
})
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.

User avatar
zibrahim
Veteran Member
Posts: 137
Joined: 2020-01-28 18:30
Location: Malaysia

Re: Refresh parent page when child-page is closed?

Post by zibrahim » 2020-11-03 00:38

Hi Pascal,
Thank you for your attention and suggestion.
I tried putting the code in PARENT-TABLE-dv.js but no success.
Then I put the same code in CHILD-TABLE-dv.js as well but with no success.
Am I missing something ? Thanks again.
Zala.
Appgini 24.10.1579, MacOS 14.3.1 Windows 11 on Parallels.

pbottcher
AppGini Super Hero
AppGini Super Hero
Posts: 1635
Joined: 2018-04-01 10:12

Re: Refresh parent page when child-page is closed?

Post by pbottcher » 2020-11-03 11:54

Hi,
as a quick solution you can try

Code: Select all

$j(function () {
  $j(document).on('hidden.bs.modal', function(){
	location.reload();
  })
})
if you want to have it clean you should catch the event and check which modal was closed to differentiate which action shall be taken.
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.

User avatar
zibrahim
Veteran Member
Posts: 137
Joined: 2020-01-28 18:30
Location: Malaysia

Re: Refresh parent page when child-page is closed?

Post by zibrahim » 2020-11-06 10:27

Hello Pascal,
Thanks for the code. It works but I need to click "resend" (reload) in Firefox for reconfirmation while the confirmation window did not appear in Chrome.
Having said that, I found a strange "good" result just by having a dummy "Calculated Field" in the child table which will automatically refresh the parent table value (which also a calculated field derived from the sum of some value in the child table) without applying any additional code, after I close the child modal window. Strange but it works for me.
But again, thank you for the code as I can use it somewhere else that may need it.
Zala.
Appgini 24.10.1579, MacOS 14.3.1 Windows 11 on Parallels.

Post Reply