primefaces icon indicating copy to clipboard operation
primefaces copied to clipboard

Dialog Framework: Add dialogClose event

Open mallorygiles opened this issue 6 years ago • 8 comments

I would like to request a dialogClose event that can be set on the p:ajax of the commandButton/Link that opens a DialogFramework dialog. This event will fire if the user clicks the x at the top of the dialog. This will give the DialogFramework similar functionality as <p:ajax event="close"/> within a p:dialog

mallorygiles avatar Sep 07 '17 15:09 mallorygiles

I think the best solution would be to sponsor it or provide a perfect PR - i have no time for such features in my freetime ;)

tandraschko avatar Sep 11 '17 13:09 tandraschko

~~@tandraschko This issue is a duplicate of #1001~~

Correction: that one is for p:dialog, but this one is for dialogFramework. so they are not duplicate.

jxmai avatar Dec 19 '17 20:12 jxmai

Is this really a duplicate? #1001 reference the p:dialog. This is for a dialog opened using the dialog framework.

mallorygiles avatar Dec 19 '17 20:12 mallorygiles

I just corrected it. :+1:

jxmai avatar Dec 19 '17 20:12 jxmai

I'm the author of #1001 and this issue is a duplicate of mine. At end of my #1001 post I request the same thing for DialogFramework !

jxmai say: I just corrected it !

Well: but how can I use it in Primefaces 6.1.14 ?

Can somebody give us some lines of code ?

This is urgent because I have found a workaround to do the same thing ... but I hate workaround :-) If a well build solution exists, I prefer to use it.

schlebe avatar Feb 27 '18 18:02 schlebe

@schlebe The feature has NOT yet been implemented. @jxmai just corrected his previous comment. ;-)

cnsgithub avatar Feb 28 '18 06:02 cnsgithub

OK thanks for the information.

BUT, I have read the source and I think that this request is simple to implement !

Primefaces as already added 2 attributes/events that are onHide and onShow.

I think that where onHide is implemented, it is enough to add a new event that we can name onBeforeHiding() or onClosing !

The onHide event is called after DialogFramework has been closed or hidden.

The onBeforeHiding event must be called just before hidding dialog. If a user overwrite this event in his code, he must have the possiblity to indicate that the hidding process is aborted perhaps in returning false in Javascript or in changing a specific variable in event parameter passing to event function.

I can perhaps make a PullRequest :-)

But before making that, I need some information.

  1. if you agree with my solution, what can be the name of the attribute and event ? onBeforeHidîng ? onClosing ? I ask that because for previous PullRequest, Primefaces dosen't have accepted my names. So now, I finalize analyze before developping !

  2. Can somebody give me an example on event that abort execution of following code so that I can reuse it. Event onHide seem to have no event parameter so I cannot use it.

schlebe avatar Feb 28 '18 06:02 schlebe

This issue is marked as stale because there was no activity on it for the last 2 years. Remove stale label or comment or this will be closed in 30 days

github-actions[bot] avatar Feb 12 '21 01:02 github-actions[bot]