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

Confirm: ability to adjust button label and class of global confirmation #11929

Closed
BalusC opened this issue May 14, 2024 · 9 comments · Fixed by #11946 or #11981
Closed

Confirm: ability to adjust button label and class of global confirmation #11929

BalusC opened this issue May 14, 2024 · 9 comments · Fixed by #11946 or #11981
Assignees
Milestone

Comments

@BalusC
Copy link

BalusC commented May 14, 2024

Description

It would be nice to be able to adjust button labels and classes of a global confirm dialog via <p:confirm>. It's currently already possible to adjust the header and message of a global confirm dialog but nothing else than that.

Describe the solution you would like

Imaginary code:

<p:confirm header="Confirm delete"
           message="Are you sure to delete this?"
           yesButtonLabel="Delete this"
           yesButtonClass="ui-button-danger"
           noButtonLabel="Keep this!" />
  • yesButtonLabel: overrides label of 'Yes' button (and restores it before the global confirm dialog is reused elsewhere)
  • yesButtonClass: adds given class to 'Yes' button (and removes it before the global confirm dialog is reused elsewhere)
  • noButtonLabel: overrides label of 'No' button (and restores it before the global confirm dialog is reused elsewhere)
  • noButtonClass: adds given class to 'No' button (and removes it before the global confirm dialog is reused elsewhere)

Additional context

Currently I'm working around this with a patched PrimeFaces.widget.ConfirmDialog which inspects a custom type in showMessage() function.

@BalusC BalusC added ‼️ needs-triage Issue needs triaging new feature labels May 14, 2024
@jepsar jepsar removed the ‼️ needs-triage Issue needs triaging label May 14, 2024
@Rapster Rapster changed the title <p:confirm> - ability to adjust button label and class of global confirm dialog Confirm: ability to adjust button label and class of global confirm dialog May 14, 2024
@fcorneli
Copy link
Contributor

What would also be nice here is:

<p:confirm header="Confirm delete">
    <p>Are you sure to delete?</p>
    ... some formatted content here instead of a single line ...
</p:confirm>

@melloware melloware added this to the 15.0.0 milestone May 14, 2024
@melloware

This comment has been minimized.

@melloware
Copy link
Member

@fcorneli the Confirm is a Behavior and I don't think Behaviors can have children or facets like you have posted? I could be wrong?

@fcorneli

This comment was marked as off-topic.

@fcorneli

This comment was marked as off-topic.

@BalusC

This comment was marked as off-topic.

@fcorneli

This comment was marked as off-topic.

@melloware melloware self-assigned this May 15, 2024
melloware added a commit to melloware/primefaces that referenced this issue May 15, 2024
@melloware melloware changed the title Confirm: ability to adjust button label and class of global confirm dialog Confirm: ability to adjust button label and class of global confirmation May 15, 2024
melloware added a commit to melloware/primefaces that referenced this issue May 15, 2024
melloware added a commit to melloware/primefaces that referenced this issue May 16, 2024
@mkomko
Copy link
Contributor

mkomko commented May 21, 2024

@melloware @BalusC What do you think of an additional yesButtonIcon and noButtonIcon? This would enable even better usage of a global confirm dialog for multiple scenarios, like save and delete with proper button icons.

@melloware
Copy link
Member

melloware commented May 21, 2024

@mkomko i don't see why not. I will add these two new fields.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment