Skip to content

Instantly share code, notes, and snippets.

@joeldatabox
Created July 12, 2017 01:53
Show Gist options
  • Select an option

  • Save joeldatabox/9607976489fff5a9277de73e521325b8 to your computer and use it in GitHub Desktop.

Select an option

Save joeldatabox/9607976489fff5a9277de73e521325b8 to your computer and use it in GitHub Desktop.
public class Dialog<T> {
protected void openDialogModal(String dialog) {
Map<String, Object> options = new HashMap<>();
options.put("modal", true);
options.put("draggable", false);
options.put("responsive", true);
options.put("resizable", false);
options.put("contentHeight", 600);
options.put("contentWidth", 800);
RequestContext.getCurrentInstance().openDialog(dialog, options, null);
}
protected void openDialog(String dialog) {
RequestContext.getCurrentInstance().openDialog(dialog);
}
protected void openDialog(String dialog, Map<String, Object> options) {
RequestContext.getCurrentInstance().openDialog(dialog, options, null);
}
protected void onCloseDialog() {
RequestContext.getCurrentInstance().closeDialog(null);
}
protected void onSelectDialog(T value) {
RequestContext.getCurrentInstance().closeDialog(value);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment