Hi,
I’m having a configuration issue using FilterTable. I configure the widgetset using the following annotation on my ApplicationServlet implementation class:
Second, I think you have some kind of a configuration issue with the widgetset. When I compile the widgetset and remove the .nocache.js file from the server the alert says this:
Failed to load the widgetset: /FilteringTable/VAADIN/widgetsets/org.tepi.filtertable.gwt.FilterTableWidgetset/org.tepi.filtertable.gwt.FilterTableWidgetset.nocache.js?1353306743984
Notice how the alert points to “org.tepi.filtertable.gwt.FilterTableWidgetset” )whereas yours points to “org.tepi.filtertable.FilterTable”.
I have no idea why this might happen. Have you tried to configure the widgetset using web.xml and see if that works?
I’m using FilteringTable addon with LazyQueryContainer, but I can’t understand one thing: why size() is invoked before querying elements. For performance it’ll be the best (for example in SpringDataJpa) to query for Page object and store page.getTotalElements() to return it later after invoking size() method. Why FilteringTable is behaving in opposite way?
unfortunately I don’t know the actual reason for that. The FilteringTable is based on Vaadin’s Table component and that behavior (and everything else related to container handling) comes from there. I think you could create a new thread about the size() issue so someone with the correct knowledge might see it more easily.
Hi Tepi,
now I can compile the add-on and maven prints out this message (Error?!?) during add-on compilation:
[INFO]
--- vaadin-maven-plugin:1.0.1:update-widgetset (default) @ mistral-vaadin ---
[INFO]
Updating widgetset org.tepi.filtertable.gwt.FilterTableWidgetset
[INFO]
establishing classpath list (scope = compile)
[ERROR]
20-nov-2012 19.21.29 com.vaadin.terminal.gwt.widgetsetutils.ClassPathExplorer getAvailableWidgetSets
[ERROR]
INFO: Widgetsets found from classpath:
[ERROR]
org.vaadin.hene.popupbutton.widgetset.PopupbuttonWidgetset in jar:file:/home/valerio/.m2/repository/org/vaadin/addons/popupbutton/1.2.1/popupbutton-1.2.1.jar!/
[ERROR]
com.vaadin.terminal.gwt.DefaultWidgetSet in jar:file:/home/valerio/.m2/repository/com/vaadin/vaadin/6.8.2/vaadin-6.8.2.jar!/
[ERROR]
org.tepi.filtertable.gwt.FilterTableWidgetset in jar:file:/home/valerio/.m2/repository/org/vaadin/addons/filteringtable/0.7.3/filteringtable-0.7.3.jar!/
[ERROR]
[ERROR]
20-nov-2012 19.21.29 com.vaadin.terminal.gwt.widgetsetutils.ClassPathExplorer getAvailableWidgetSets
[ERROR]
INFO: Search took 11ms
It seems that the add-on is found and the compilation is ok. When I run application the server prints out this message on the stdout:
19:22:23,432 INFO [com.vaadin.terminal.gwt.server.AbstractApplicationServlet]
(http--127.0.0.1-8080-1) Requested resource [VAADIN/widgetsets/org.tepi.filtertable.gwt.FilterTableWidgetset/org.tepi.filtertable.gwt.FilterTableWidgetset.nocache.js]
not found from filesystem or through class loader. Add widgetset and/or theme JAR to your classpath or add files to WebContent/VAADIN folder.
and the same popup is viewed again. The message above suggests to copy and past the directory VAADIN and its content under my vaadin project. But there is no VAADIN folder on the git repository.
not sure if I can help, I’m not that experienced with Maven :(. Some thoughts:
From the compilation output it seems to me that the widgetset is compiled properly.
There’s no VAADIN folder in the git repo since the contents (widgetset) are generated at compile-time.
Seems to me that for some reason the compilation results do not go into the right place. Can you find the compiled widgetset anywhere within the project?
This sounds more like a maven issue than anything related to the FilteringTable as such. Are you able to use any other addons with your project setup?
The “error” as reported by maven is a false positive: Maven interprets the output of a separate class executed from there as errors. This is a long-standing issue (ticket exists).
What you pasted in the message was the output of the update-widgetset goal (i.e. updating the .gwt.xml file to include add-ons), not of widgetset compilation (goal gwt:compile for Vaadin 6). Did you also compile the widgetset?
Furthermore, it looks like you were trying to update the widgetset of the FilteringTable add-on rather than your own widgetset that should import it.
Hello,
I’ve noticed following problem: I have very wide FilterTable so horizontal scrollbar is in use. When I scroll a little bit to the right side and filter some column (in attached video it is column “designs”) table get filtered correctly but the table header (column names) are shifted as if table was not scrolled to the right side (basically header shows column names from the first one even if this should be hidden because table is horizontally scrolled).
Please take a look at this video, it clearly explains my problem:
I just tested this with the latest Vaadin and FilteringTable versions (6.8.5 and 0.7.3) and could not reproduce the issue. If you’re not using the latest versions, please update. If you already have the latest versions and this still occurs, please post a simplified test case so I could reproduce the problem. Thanks.
I just released version 0.8.0 of the FilteringTable add-on. The larger change is support for paging, see the PagedFilteringTable class and the related example in the
demo application and the
source code . Do note the container you use must implement Container.Indexed, Container.Sortable and Container.Filterable in order to be usable with the PagedFilteringTable class.
This is just a preliminary implementation and I have not tested it very much; although it seems to work quite nicely with the simple case in the demo application.
Special thanks go to Jens Jansson for creating the
PagedTable add-on so I could steal the code ;)
Thank you for the wonderful add-on, it has really helped my users in their workflow.
I am using 0.7.3 (I just saw you released 0.8.2), but I was wondering if there is a way to get the number of displayed results. For example, after filtering, to be able to retrieve “showing x out of y records”.
as far as I know, there is no way in the Container interfaces to get the total size of the container when one or more filters has been set. The size() method of the container always returns the count of visible items - in other words, the number of items that pass the filter(s) - which would be the x in your example.
However, if you’re using a container which extends AbstractInMemoryContainer (or actually, extend one such container yourself), you could use the protected methods getFilteredItemIds() and getAllItemIds() to get both the x and y. Looking at the class hierarchy this should be doable for IndexedContainer, HierarchicalContainer, BeanContainer and BeanItemContainer.
As a followup, I was able to solve my problem. When I initially populate the table, I save the total number of results. Then, in filterRemoved() and filterAdded() in the FilterGenerator(), I use filterTable.getItemIds().size() to get the number of displayed results, and update the caption. Easy!
FilterTable works awesome but I am trying to make a FilterColumn to have a DropDown (instead of Text Field) of the values from that Unique Column Values displayed in the Table.
Could you please help me how to achieve this? Thanks is advance.
you should implement the FilterGenerator interface. Then this method:
public AbstractField getCustomFilterComponent(Object propertyId);
is called when creating each filter component. The propertyId will be the same which is used for the Table/Container. If you want to use the default field just return null, if not you can create the field you want and return it. After this you just set your filter generator to your table like this:
On your example application you have a drop down that hides the column you select. I was wondering how you hide a column and if you could sort by that hidden column.
-Thanks
I am using the SQLContainer for reteriving the data from the database.
Following is the code snippets…
private static final String VISIBLE_COLS ={“id”,“name”,“lastname”};
pool = new SimpleJDBCConnectionPool(“com.sybase.jdbc3.jdbc.SybDriver”, “url”, “username”, “password”);
FreeformQuery tq = new FreeformQuery(“select id,name,lastname from name”,pool,“id”);
SQLContainer container = new SQLContainer(tq);