Opened 12 years ago

Closed 12 years ago

#391 closed enhancement (fixed)

WFSFilterBuilder - Add fields support for titles

Reported by: belug Owned by: adube
Priority: minor Milestone: 1.2.0
Component: widgets Version: trunk
Keywords: WFSFilterBuilder fields Cc: belug

Description

The idea is to add the field support to this widget. So the fields could be renamed after something more readable than feature attributes names.

As an example :

Database field : "opt003u" Field configuration title : "Number of Plants"

Currently the widget writes "opt003u" in the search combobox and in the Grid columns name. It could be nicer to write "Number of Plants".

Change History (11)

comment:1 by belug, 12 years ago

Here I added the support for the fields. I'm not sure it's the best way but it's working.

But it gets the fields from the config, and add the title to the attribute store defined from the WFS DescribeFeatureType. If there is no title defined it set the title to the attribute name by default.

The title is used by the field combobox to create the filter, the combobox of the quick filter and in the grid columns name.

comment:2 by adube, 12 years ago

Here's a review. The patch looks good to me. It would be nice to leave a notice in the widget documentation that it supports reading the resource field titles for that purpose.

What do you think ?

comment:3 by belug, 12 years ago

Here's the file to modify the documentation so it now talks about setting up fields to the ressource.

comment:4 by belug, 12 years ago

Cc: belug added

comment:5 by adube, 12 years ago

belub, could you please also provide an update of the sample showing that new feature ?

(sorry for using "feature" again)

comment:6 by adube, 12 years ago

"belug", sorry.

comment:7 by belug, 12 years ago

While adding it to the sample I've noticed two bugs, the first was in my patch, the fields titles could be erased by other ressources before the atributes would be loaded so the titles would not change, for I made the object containing the titles golbal and that it would not be erased.

The thing with this solution is that if a field is declared in one ressource it could change the title in an other one where it is not declared and that if it is declared in two ressources with defferent titles it is possible that only one title will be used for both.

The second bug was in te field object in PHP if the field was declared with no options, the code would break. So I added a validation if there is no options the foreach will have an empty array to loop in.

comment:8 by adube, 12 years ago

Resolution: fixed
Status: newclosed

Fixed in r1258, with minor modifications.

Thanks a lot for the patch.

Note: See TracTickets for help on using tickets.