File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSF and the fly likes Problem inside a richModalPanel Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "Problem inside a richModalPanel" Watch "Problem inside a richModalPanel" New topic

Problem inside a richModalPanel

Jaaouane Aymen

Joined: Sep 22, 2009
Posts: 29
Hello, i have this modal panel which is dislayed to confirm the save or the delete action:

<rich:modalPanel id="confirmPopup" width="350" height="100"
<div class="actionButtons">
<a4j:commandButton event="onclick" action="#{}" oncomplete="#{rich:component('confirmPopup')}.hide()" value="#{messages['']}" />
<h:commandButton value="annuler" id="fermer" onclick="#{rich:component('confirmPopup')}.hide();return false;"></h:commandButton></div></center> </rich:modalPanel>

My first problem is that the action will not be triggered if i replace <a4j:commandButton by h:commandbutton, why?
I do not need an ajax action because i want to refresh the page so my source code is not logic.

The second problem is that i want to pass a parameter to the rich:modalPanel, I want this component rendered if a paramater is well passed to the rich:modalPanel.
<a4j:commandButton event="onclick" action="#{}" oncomplete="#{rich:component('confirmPopup')}.hide()" value="#{messages['']}" />
Wouter Oet
Saloon Keeper

Joined: Oct 25, 2008
Posts: 2700

Did you put your commandButton within a h:form?

"Any fool can write code that a computer can understand. Good programmers write code that humans can understand." --- Martin Fowler
Please correct my English.
Jaaouane Aymen

Joined: Sep 22, 2009
Posts: 29
Hello, this is my source code

<rich:modalPanel id="confirmPopup" width="350" height="100">
<f:facet name="header">
<h: outputText value="Modal Panel">< /hutputText>
<f:facet name="controls">
< h:panelGroup>
< h:graphicImage value="/img/false.png" styleClass="hidelink"
id="hidelink" />
<rich:componentControl for="confirmPopup" attachTo="hidelink"
operation="hide" event="onclick" />
<div class="actionButtons"><h:commandButton event="onclick"
value="#{messages['fr.aptus.siaptus.user.delete']}" /> <h:commandButton
onclick="#{rich:component('confirmPopup')}.hide();return false;">

I resolved the problem of submit but i don't for the problem of parameter, rendered="#{event.parameters.action=='delete'}" does not work
otherwise when i debugged the code by onshow="alert(event.parameters.action)" in the rich:modalpanel, the String delete is well dispalyed
I agree. Here's the link:
subject: Problem inside a richModalPanel
jQuery in Action, 3rd edition