hw to display the dialog box after checking a condition at server side,
here dialog box is displaying directly ......need support
thank you
display the dialog box after checking a condition at server
-
- Posts: 4
- Joined: 19 May 2011, 10:04
Hi,
a little code snippet would be usefull.
YourBean.java
rendered="" checks for a boolean.
you also can open the dialog with a javascript. check http://www.primefaces.org/showcase-labs/ui/dialog.jsf for examples
Felix
a little code snippet would be usefull.
Code: Select all
<p:commandButton action="#{yourBean.checkMyCondition}" update="mydialog" />
<h:panelGroup id="mydialog">
<p:dialog rendered=#{yourBean.conditionFlag}>
// content
</p:dialog>
</h:panelGroup>
Code: Select all
private boolean conditionFlag;
public void checkMyCondition() {
this.conditionFlag = (weather.equals("sunny")) ? true : false;
}
// public getter and setter for conditionFlag
...
you also can open the dialog with a javascript. check http://www.primefaces.org/showcase-labs/ui/dialog.jsf for examples
Felix
-
- Posts: 4
- Joined: 24 Jun 2011, 14:55
already i worked with ur suggested scenario
My.xhtml::
The dialog is displaying only when i call "confirmation.show()" for a button
But when i used render property not displaying the dialog where i am changing the flag value
Irrespective of the render value it is displaying the dialog
(Note : Here i am updating the panel when action performed)
thanks for reply
My.xhtml::
Code: Select all
<p:panel id="mypanel">
<p:dialog message="Version already exists. Do you want to override it?"
modal="true" fixedCenter="true" rendered="#{bean.Flag}"
widgetVar="confirmation">
<!-- Some Logic-->
</p:dialog>
</p:panel>
But when i used render property not displaying the dialog where i am changing the flag value
Irrespective of the render value it is displaying the dialog
(Note : Here i am updating the panel when action performed)
thanks for reply
-
- Information
-
Who is online
Users browsing this forum: No registered users and 43 guests