8 Replies Latest reply on Jul 20, 2007 3:17 AM by Sergey Smirnov

    t:commandSortHeader will close the rich:modalPanel

    éKökjhlkj HJéLKJH Newbie

      Apparently having a sortable table inside a modal panel will always close the panel when the sorting header is clicked. Here is my code:

      <h:form id="values_panel" styleClass="popup_panel">
      <rich:modalPanel id='panel_values'>
       <f:facet name="header">
       <h:outputText value="#{myBean.serverCurrent}"/>
       <f:facet name="controls">
       <h:commandLink onclick="javascript:Richfaces.hideModalPanel('panel_values')" value="X" />
       <t:dataTable id="values_table" var="currentValue" value="#{myBean.listValues}" sortColumn="#{myBean.sortValuesColumn}"
      sortAscending="#{myBean.sortValuesAscending}" sortable="true">
       <t:column defaultSorted="true" sortable="true" sortPropertyName="#{myBean.VAR_PROPERTY}">
       <f:facet name="header">
       <t:commandSortHeader columnName="#{myBean.VAR_PROPERTY}" arrow="true">
       <h:outputText value="#{myBean.VAR_PROPERTY}"/>
       <h:outputText value="#{currentValue[myBean.VAR_PROPERTY]}"/>
       <t:column sortable="true" sortPropertyName="#{myBean.VAR_VALUE}">
       <f:facet name="header">
       <t:commandSortHeader columnName="#{myBean.VAR_VALUE}" arrow="true">
       <h:outputText value="#{myBean.VAR_VALUE}"/>
       <h:outputText value="#{currentValue[myBean.VAR_VALUE]}"/>

      What am I doing wrong?
      I can say that the default action of those table-sorting command links is the one closing the panel, because when I add an a4j:support with disableDefault=true then it won't close anymore (but also won't sort the table)
      Or, is there a way to work around that so I end up having a modal panel which stays open while sorting the table?
      Thank you very much,