source:
trunk/workshop-routing-foss4g/web/GeoExt/docs/_sources/lib/GeoExt/widgets/form/FormPanel.txt
@
76
Revision 76, 2.6 KB checked in by djay, 12 years ago (diff) | |
---|---|
|
Line | |
---|---|
1 | |
2 | .. currentmodule:: GeoExt.form |
3 | |
4 | :class:`GeoExt.form.FormPanel` |
5 | ================================================================================ |
6 | |
7 | |
8 | .. cssclass:: meta |
9 | |
10 | |
11 | Extends |
12 | * `Ext.form.FormPanel <http://dev.sencha.com/deploy/dev/docs/?class=Ext.form.FormPanel>`_ |
13 | |
14 | |
15 | |
16 | |
17 | xtype |
18 | ``gx_formpanel`` |
19 | |
20 | |
21 | |
22 | |
23 | .. class:: FormPanel(config) |
24 | |
25 | A specific ``Ext.form.FormPanel`` whose internal form is a |
26 | :class:`GeoExt.form.BasicForm` instead of ``Ext.form.BasicForm``. |
27 | One would use this form to do search requests through |
28 | an ``OpenLayers.Protocol`` object (``OpenLayers.Protocol.WFS`` |
29 | for example). |
30 | |
31 | Look at :class:`GeoExt.form.SearchAction` to understand how |
32 | form fields must be named for appropriate filters to be |
33 | passed to the protocol. |
34 | |
35 | |
36 | |
37 | Example Use |
38 | ----------- |
39 | |
40 | Sample code showing how to use a GeoExt form panel. |
41 | |
42 | .. code-block:: javascript |
43 | |
44 | var formPanel = new GeoExt.form.FormPanel({ |
45 | renderTo: "formpanel", |
46 | protocol: new OpenLayers.Protocol.WFS({ |
47 | url: "http://publicus.opengeo.org/geoserver/wfs", |
48 | featureType: "tasmania_roads", |
49 | featureNS: "http://www.openplans.org/topp" |
50 | }), |
51 | items: [{ |
52 | xtype: "textfield", |
53 | name: "name__ilike", |
54 | value: "mont" |
55 | }, { |
56 | xtype: "textfield", |
57 | name: "elevation__ge", |
58 | value: "2000" |
59 | }], |
60 | listeners: { |
61 | actioncomplete: function(form, action) { |
62 | // this listener triggers when the search request |
63 | // is complete, the OpenLayers.Protocol.Response |
64 | // resulting from the request is available |
65 | // in "action.response" |
66 | } |
67 | } |
68 | }); |
69 | |
70 | formPanel.addButton({ |
71 | text: "search", |
72 | handler: function() { |
73 | this.search(); |
74 | }, |
75 | scope: formPanel |
76 | }); |
77 | |
78 | |
79 | |
80 | |
81 | Config Options |
82 | -------------- |
83 | |
84 | Configuration properties in addition to |
85 | those listed for `Ext.form.FormPanel <http://dev.sencha.com/deploy/dev/docs/?class=Ext.form.FormPanel>`_. |
86 | |
87 | |
88 | .. describe:: protocol |
89 | |
90 | ``OpenLayers.Protocol`` The protocol instance this form panel |
91 | is configured with, actions resulting from this form |
92 | will be performed through the protocol. |
93 | |
94 | |
95 | |
96 | |
97 | |
98 | |
99 | Public Methods |
100 | -------------- |
101 | |
102 | Public methods in addition to those |
103 | listed for `Ext.form.FormPanel <http://dev.sencha.com/deploy/dev/docs/?class=Ext.form.FormPanel>`_. |
104 | |
105 | |
106 | .. method:: FormPanel.search |
107 | |
108 | :param options: ``Object`` The options passed to the |
109 | :class:`GeoExt.form.SearchAction` constructor. |
110 | |
111 | Shortcut to the internal form's search method. |
112 | |
113 | |
114 | |
115 | |
116 |
Note: See TracBrowser
for help on using the repository browser.