Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 08-06-2009, 08:27 PM
Member
 
Join Date: Aug 2009
Posts: 1
Rep Power: 0
Dreambig is on a distinguished road
Question rich:modalPanel display problem
I have got a rich modal panel that gets displayed once the user hits the save button. However, if the form validation fails, the modal panel should not be displayed. Within the save button action method savePromotion(), I set a boolean displayModalPanel property to false if validation fails and to true if if it succeeds (by default it's set to true). Then using rich:componentControl, I display the modal panel which should be rendered only if the displayModalPanel is true. I use the rendered attribute of componentControl to control that. The problem: the modal panel always displays even if the displayModalPanel set to false within savePromotion() method. It seems somehow the rendered is not being re-evaluated. I am not sure how I can get this to work. Any help will be greatly appreciated.


<a4j:commandButton value="save"
action="#{AddPromotion.savePromotion}">
<rich:componentControl for="savePromoPanel"
operation="show"
event="oncomplete"
rendered="#{AddPromotion.displayModalPanel}"/>
</a4j:commandButton>


<rich:modalPanel id="savePromoPanel" width="350" height="150">
<!-- modal panel code here -->
</rich:modalPanel>

//Java code
boolean displayModalPanel = true;

public boolean isdisplayModalPanel () {
return displayModalPanel ;
}

public void setdisplayModalPanel (boolean displayModalPanel ) {
this.displayModalPanel = displayModalPanel ;
}



public void savePromotion () {
// other code here

if (validationFailed)
setdisplayModalPanel (false);
else
setdisplayModalPanel (true);
}
Bookmark Post in Technorati
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help me please in studing rich:tree ruby JavaServer Faces 0 07-28-2009 09:13 PM
Date n Time Display problem kapilverma32 Advanced Java 6 02-10-2009 02:53 PM
Struts 2 paging problem using display tag...? prabhurangan Web Frameworks 0 07-02-2008 09:20 AM
Problem with display the character romina New To Java 1 07-25-2007 08:43 PM
Problem with display in Netbeans 5.5 Albert NetBeans 1 07-13-2007 04:33 PM


All times are GMT +2. The time now is 10:59 AM.



VBulletin, Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2009, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org