Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New ConfirmDialog Component #901

Closed
cagataycivici opened this issue Sep 14, 2016 · 14 comments
Closed

New ConfirmDialog Component #901

cagataycivici opened this issue Sep 14, 2016 · 14 comments
Assignees
Labels
Type: New Feature Issue contains a new feature or new component request
Milestone

Comments

@cagataycivici
Copy link
Member

cagataycivici commented Sep 14, 2016

Subset of Dialog to make it easier to create a confirm dialog with backed by a confirm service for reuse so could be fired from any action.

import {ConfirmDialogModule,ConfirmationService} from 'primeng/primeng';
<p-confirmDialog header="Confirmation" icon="fa fa-question-circle" width="425"></p-confirmDialog>

<button type="text" (click)="confirm()" pButton icon="fa-check" label="Confirm"></button>
export class ConfirmDialogDemo { 

    constructor(private confirmationService: ConfirmationService) {}

    confirm() {
        this.confirmationService.confirm({
            message: 'Are you sure that you want to perform this action?',
            accept: () => {
                //Actual logic to perform a confirmation
            }
        });
    }
}
@cagataycivici cagataycivici added the Type: New Feature Issue contains a new feature or new component request label Sep 14, 2016
@cagataycivici cagataycivici added this to the 1.0.0-beta.16 milestone Sep 14, 2016
@cagataycivici cagataycivici self-assigned this Sep 14, 2016
@KumarGovindh
Copy link

KumarGovindh commented Dec 2, 2016

I want some more functionality in dialog like button label text because I have more confirmation dialog in a a single template.
I want to pass the button labels text, like message header and icon from confirm() function.
I red primeng tutorial. tutorial suggest that by using acceptLabel attribute, Its possible to change button lable text but in my confirm function its giving error that confirm function doesn't have acceptLabel attribute.
Is this confirmDialog module support that functionality? If yes, what could be the right format of the code structure.
Any suggestion could be appreciated.
thanks.

@ebosantos
Copy link

ebosantos commented Jan 20, 2017

What I think could fit nicely is allow html messages.

Instead of

<span class=\"ui-confirmdialog-message\">{{message}}</span>

We do

<span class=\"ui-confirmdialog-message\" [innerHTML]="message"></span>

What do you think, @cagataycivici ?

@igogu
Copy link

igogu commented Feb 9, 2017

@KumarGovindh Did you find how to customize acceptLabel and rejectLabel?

@igogu
Copy link

igogu commented Feb 9, 2017

Hi again,

I found how to do it, you just have to defined in you p-confirmDialog acceptLabel=""; for example:

<p-confirmDialog id="popupBorrar" header="Confirmation" width="425" acceptLabel="Add" #cd>

@barocsi
Copy link

barocsi commented Feb 20, 2017

Why cant we simply pass the confirmdialog template to the service?
Why cant we define multiple confirmdialogs per page identified by #id or something like that so we can target it with the .confirm() function?
What the hell?

@ebosantos
Copy link

@barocsi Take a look at p-dialog.

@barocsi
Copy link

barocsi commented Feb 20, 2017

Thanks, but this is not the way it should work. Why would I pollute my static dom with dialogs instead of having generic templates that I can display dynamically? It smells like an anti-pattern.

@sajalsuraj
Copy link

Has anyone found the proper solution ?

@pierfreeman
Copy link

Any news about this feature? Should we open an issue for creating more confirmDialog on the same page?

@sgentile
Copy link

Does the p-confirmDialog support a ng-template pTemplate="body" ?

@cristianVergaraSepulveda

the solution for my is appendTo="body"

<p-confirmDialog header="Confirmation" icon="fa fa-question-circle" width="425" appendTo="body" #cd>

@prakashpixels
Copy link

Did you have any possible in multi line of content in confirmation box ?

@shaungrady
Copy link

Is there no way to close these confirmation dialogs using the service? I want to display a "Your session is going to expire" message, and close the confirmation if the session expires—but there doesn't appear to be a way to do that.

@ningacoding
Copy link

@shaungrady use normal dialog with modal=true

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: New Feature Issue contains a new feature or new component request
Projects
None yet
Development

No branches or pull requests