0 Replies Latest reply on Sep 15, 2011 11:09 AM by kaneeec

    RichFaces + JSF 2 strange problem with rich:popupPanel

    kaneeec

      I have the following page. Like this it works fine. But if I change jsFunction name to delete (and the button in the popupPanel also to delete();), it does not work at all. How is that possible?

       

      Also how can I create a popupPanel which has form for new Profile creation? The form in in does not set the variables in the bean.

       

      <?xml version='1.0' encoding='UTF-8' ?>
      <!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      <ui:composition xmlns:ui="http://java.sun.com/jsf/facelets"
                template="./templates/template.xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:rich="http://richfaces.org/rich"
                xmlns:a4j="http://richfaces.org/a4j"
                xmlns:fn="http://java.sun.com/jsp/jstl/functions">
      
      
                <ui:define name="main_title">Profiles</ui:define>
                <ui:define name="main">
                          <h:form>
                                    <rich:dataTable value="#{dataProviderBean.profiles}" var="item"
                                              id="profilesTable" styleClass="nice-tbl">
                                              <rich:column filterValue="#{filteringBean.usernameFilter}"
                                                        filterExpression="#{fn:containsIgnoreCase(item.username, filteringBean.usernameFilter)}">
                                                        <f:facet name="header">
                                                                  <h:outputText value="Username" />
                                                                  <br />
                                                                  <h:inputText value="#{filteringBean.usernameFilter}">
                                                                            <a4j:ajax event="keyup" render="profilesTable@body"
                                                                                      execute="@this" />
                                                                  </h:inputText>
                                                        </f:facet>
                                                        <h:outputText value="#{item.username}" />
                                              </rich:column>
                                              <rich:column>
                                                        <f:facet name="header">Password</f:facet>
                                                        <h:outputText value="#{item.password}" />
                                              </rich:column>
                                              <rich:column>
                                                        <f:facet name="header">URL</f:facet>
                                                        <h:outputText value="#{item.url}" />
                                              </rich:column>
                                              <rich:column>
                                                        <f:facet name="header">Administration</f:facet>
                                                        <a4j:commandLink execute="@this" render="@none"
                                                                  oncomplete="#{rich:component('confirmPane')}.show()">
                                                                  <h:graphicImage url="./resources/images/delete.png" alt="Delete" />
                                                                  <a4j:param value="#{item.username}"
                                                                            assignTo="#{deleteProfileBean.username}" />
                                                        </a4j:commandLink>
                                              </rich:column>
                                    </rich:dataTable>
                          </h:form>
      
      
                          <a4j:jsFunction name="remove" action="#{deleteProfileBean.delete}"
                                    render="profilesTable" execute="@this"
                                    oncomplete="#{rich:component('confirmPane')}.hide();" />
      
      
                          <rich:popupPanel id="confirmPane" autosized="true"> 
                                  Are you sure you want to delete the profile?
                                  <a4j:commandButton value="Cancel"
                                              onclick="#{rich:component('confirmPane')}.hide(); return false;" />
                                    <a4j:commandButton value="Delete" onclick="remove(); return false;" />
                          </rich:popupPanel>
                </ui:define>
      </ui:composition>