rickilama54 / smartgwt

Automatically exported from code.google.com/p/smartgwt
0 stars 0 forks source link

FilterBuilder does not render correctly a Datasource field with FK and editor type SelectItem #376

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?

1. Double click on the grid to see that the SelectItem is showing data
2. If you try selecting a continent in the filter builder you will notice
that the SelectItem in the filter contains no data.

What is the expected output? What do you see instead?

I would like to be able to pick the filter value from a drop down, same as
in the grid in edit mode.

What version of the product are you using? On what operating system?
SmartGWT 1.3
GWT 1.7.1 Bundled (Eclipse Google Plugin)
Windows 7

Please provide any additional information below.

I have attached the sample project.
If you have the Google plugin installed, importing the project in Eclipse
and fix the smartgwt jar imports. After this project should be ready to run.

Original issue reported on code.google.com by doru.par...@gmail.com on 11 Dec 2009 at 7:15

Attachments:

GoogleCodeExporter commented 8 years ago
This is the related forum thread.
http://forums.smartclient.com/showthread.php?p=34998

Original comment by doru.par...@gmail.com on 13 Dec 2009 at 2:14

GoogleCodeExporter commented 8 years ago
Anybody?

Original comment by doru.par...@gmail.com on 15 Dec 2009 at 9:55

GoogleCodeExporter commented 8 years ago
I have got the similar problem with ComboBox in the FilterBuilder. Works with
ValueMap (this is presented in the Showcase), but not with OptionDatasource:
http://forums.smartclient.com/showthread.php?t=8215

Original comment by michal.g...@gmail.com on 20 Jan 2010 at 10:12

GoogleCodeExporter commented 8 years ago
Hopefully somebody will fix this. As it is right now I cannot use FilterBuilder 
since
nobody would know by heart the IDs of the searches categories. Fingers crossed.

Original comment by doru.par...@gmail.com on 20 Jan 2010 at 10:17

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Somebody has to do the dirty work - I am somebody.
This is a patch for the FilterBuilder.js (attached). After applying it, you have
SelectItem od ComboBox filled from DataSource in the FilterBuilder as in the
following example:

        DataSource ds = new DataSource();
        ds.setDataFormat(DSDataFormat.XML);
        ds.setRecordXPath("/List/country");
        ds.setDataURL("data.xml");

        DataSourceIntegerField pkField = new DataSourceIntegerField("pk");
        pkField.setHidden(true);
        pkField.setPrimaryKey(true);

        DataSourceTextField continentField = new DataSourceTextField("continent",
"Continent");
        SelectItem selectItem = new SelectItem("continent");
        selectItem.setValueField("continent");
        continentField.setEditorType(selectItem);

        ds.setFields(pkField, continentField);

        FilterBuilder filterBuilder = new FilterBuilder();
        filterBuilder.setDataSource(ds);

At least it works for me ... although this is the first time I used javascript 
ever,
so I hope someone skilled would check it and take care this issue.

Original comment by michal.g...@gmail.com on 21 Jan 2010 at 1:19

Attachments:

GoogleCodeExporter commented 8 years ago

Original comment by sanjiv.j...@gmail.com on 22 Jan 2010 at 1:02

GoogleCodeExporter commented 8 years ago
Fixed in SVN. Thanks for the patch Michal.

Original comment by sanjiv.j...@gmail.com on 28 Feb 2010 at 7:52

GoogleCodeExporter commented 8 years ago
Thank you as well Michal. I have been waiting for this fix for a long time.

Original comment by doru.par...@gmail.com on 6 Mar 2010 at 10:30

GoogleCodeExporter commented 8 years ago
Is it sure that this fix is available in the latest distributions? I seem to 
have the same problem with a smartgwtpro3.1p distribution downloaded in 
december 2013

Original comment by santilh@gmail.com on 22 Jan 2014 at 11:56