Multiple dialogs from the same button

UI Components for JSF
Post Reply
ThiagoM
Posts: 1
Joined: 29 Apr 2016, 19:50

29 Apr 2016, 20:30

Hello.
I'm trying to open multiple dialog from the same button.
So if I click twice I would got 2 dialog window open.

- I have index.xhtml
- I have janela.xhtml (the dialog page).

on Index.xhtml

Code: Select all

<p:commandButton value="Testing"  actionListener="#{janelaBean.showDialogWithAdditionalArg('aa2')}" update="output" ajax="true"/>
on janelaBean.java

Code: Select all

public String showDialogWithAdditionalArg(String oid) {
Map<String, Object> properties = new HashMap<>();
properties.put("modal", false);
properties.put("id", "aaff"+oid);
properties.put("name", "aaff"+oid);
properties.put("widgetVar", "aaff"+oid);
properties.put("resizable", true);
properties.put("draggable", true);
properties.put("minimizable", true);
properties.put("maximizable", true);
properties.put("closeOnEscape", true);
properties.put("width", 400);
properties.put("height", 400);
RequestContext.getCurrentInstance().openDialog("Janela", properties, null);
return "";
}
Looking at the resulting html, the problem seems to be the <div> name. When I click the second time, the div doesn't receive a new id. I tried to make a javascript that change the id after click, but then close button e other things stop working, so this doesn't seems like a good idea -).

Is there a right way to do that?

thanks a lot

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 41 guests