[MGNLUI-5167] DOC: Example needed to build alerts using AlertBuilder Created: 23/Apr/19  Updated: 28/Jul/21  Resolved: 28/Jul/21

Status: Closed
Project: Magnolia UI
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Task Priority: Neutral
Reporter: Martin Drápela Assignee: Martin Drápela
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
relation
is related to MGNLUI-6679 DEV DOC: Update Messages app/module f... Closed
Template:
Acceptance criteria:
Empty
Task DoR:
Empty
Date of First Response:

 Description   

As spotted by mmichel, our pages about 

use deprecated `UiContext` APIs to generate dialogs.

 

Task

  1. A developer should provide new usage examples implementing the AlertBuilder instead. Just add the code as a comment to this ticket.
  2. A documentarian will then update the pages.

 

 



 Comments   
Comment by Adam Siska [ 27/Mar/20 ]

There is JavaDoc within introducing commit by mgeljic:
https://git.magnolia-cms.com/projects/PLATFORM/repos/ui/pull-requests/622/commits/47f6162c2ecfdc6c24115373fa2912b4b1151ee8#magnolia-ui-framework/src/main/java/info/magnolia/ui/AlertBuilder.java

with this example:

AlertBuilder.confirmDialog("Say hi?")
         .withLevel(Notification.Type.HUMANIZED_MESSAGE)
         .withBody("Do you want to say hello?")
         .withOkButtonCaption("You bet")
         .withDeclineButtonCaption("No way")
         .withConfirmationHandler(() -> sayHello(name))
         .buildAndOpen();
Comment by Adam Siska [ 27/Mar/20 ]

Other source of examples here:
https://git.magnolia-cms.com/projects/PLATFORM/repos/ui/browse/magnolia-admincentral/src/main/java/info/magnolia/admincentral/ResurfaceShell.java

Generated at Mon Feb 12 09:23:51 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.