-
1. Re: Context menu broken after sorting/filtering ExtendedDataTable with built-in (RF 4.3.0+) controls.
gmlussi Mar 18, 2013 9:43 AM (in response to gmlussi)Update (still broken):
I created a stripped down test page with only an Extended Data Table and Context Menu component, within a form, with a backing filter bean...
Test page:
{code:xml}
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html"
xmlns:rich="http://richfaces.org/rich" xmlns:f="http://java.sun.com/jsf/core"
xmlns:fn="http://java.sun.com/jsp/jstl/functions">
<h:head>
</h:head>
<h:body>
<h:form id="testForm">
<rich:extendedDataTable value="#{testFilterBean.testData}" var="testValue" id="testTable">
<rich:column sortBy="#{testValue}" sortOrder="#{testFilterBean.sortsOrders['test']}"
filterValue="#{testFilterBean.testFilter}"
filterExpression="#{fn:containsIgnoreCase(testValue,testFilterBean.testFilter)}">
<f:facet name="header">
<h:outputText value="Test"/>
</f:facet>
<h:outputText value="#{testValue}"/>
</rich:column>
</rich:extendedDataTable>
<rich:contextMenu id="testContextMenu" target="testTable">
<rich:menuItem id="docContextMenuMetadataOption" execute="@this" mode="client">
Test Option
</rich:menuItem>
</rich:contextMenu>
</h:form>
</h:body>
</html>
{code}
backing:
{code:java}
package com.test;
import org.apache.myfaces.extensions.cdi.core.api.scope.conversation.ViewAccessScoped;
import org.richfaces.component.SortOrder;
import javax.inject.Named;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Named("testFilterBean")
@ViewAccessScoped
public class TestFilterBean implements Serializable {
private Map<String, SortOrder> sortsOrders;
private List<String> sortPriorities;
private String testFilter = "";
public TestFilterBean() {
sortsOrders = new HashMap<>();
sortPriorities = new ArrayList<>();
}
public String getTestFilter() {
return testFilter;
}
public void setTestFilter(String testFilter) {
this.testFilter = testFilter;
}
public List<String> getSortPriorities() {
return sortPriorities;
}
public Map<String, SortOrder> getSortsOrders() {
return sortsOrders;
}
public ArrayList getTestData()
{
ArrayList<String> testData = new ArrayList<>();
testData.add("Row 1");
testData.add("Row 2");
testData.add("Row 3");
return testData;
}
}
{code}
The problem remains (the context menu is not attached, and is broken, after use of filter or sort) with the above sample code. Oddly, the context menu doesn't break if there is no h:form on the page (but obviously that's no use, as I need to be able to submit on that page).
Nobody have any suggestions?
Or does this seem like a good candidate to formally raise a bug against?
-
2. Re: Context menu broken after sorting/filtering ExtendedDataTable with built-in (RF 4.3.0+) controls.
gmlussi Mar 18, 2013 10:20 AM (in response to gmlussi)Ok... it seems that the reason our custom filters and sorts don't break the context menu is because when we make the sort link or input filter box ourselves we can attach the following:
{code:xml}<a4j:ajax render="#{parentForm}"/>{code}
to force a re-render. If we don't add that line, then the menu breaks / is not attached after filtering.
When using the built-in sort and filter there seems to be no way to specify a render list for after the sort or filter. Is there any way I could get the form to re-render after using the built-in controls? (If it's impossible, are we in feature-request territory?)
Thanks.
-
3. Re: Context menu broken after sorting/filtering ExtendedDataTable with built-in (RF 4.3.0+) controls.
jhuska Mar 19, 2013 8:06 AM (in response to gmlussi)Hello,
thanks for going deeper into the issue and finding the root cause.
IMHO it is a bug and it is (the similar one) already reported here:
https://issues.jboss.org/browse/RF-11973
Please see the comments there, I was able to reproduce your issue.
Regards,
Juro
-
4. Re: Context menu broken after sorting/filtering ExtendedDataTable with built-in (RF 4.3.0+) controls.
gmlussi Mar 19, 2013 9:39 AM (in response to jhuska)Hi Juro,
Thanks for the reply / looking into it.
I'd say that seems about right, it seems to be related to that re-render issue (I assume filter/sort is ajax rendering the table only, causing the broken context menu).
Oddly enough, I've had problems with that exact bug in the past, and previously had to try to work around it. I hope it gets resolved...
Cheers,
Gavin
-
5. Re: Context menu broken after sorting/filtering ExtendedDataTable with built-in (RF 4.3.0+) controls.
suckerd Dec 5, 2013 3:47 AM (in response to jhuska)Hi I did file a JIRA Ticket - please vote for it!
[RF-13418] After sorting on extendedDataTable the contextMenu is broken - JBoss Issue Tracker
THX+CU Mike