[Seaside] Updating non Smallfaces component.
Burella Juan M.
juan.burella at gmail.com
Thu Aug 27 20:01:41 UTC 2009
Let me see if I've understood what are you doing. You need to:
-Create (or modify?) a LBCGoogleMap when a ListBox changes
-Render or update the LBCGoogleMap when a Button is clicked.
You said LBCGoogleMap is not a WAComponent, what it is? If it's a
SFObject, then you can add to your SearcherInterface sending as
argument of #addSubpane: message, as already knows how to answer
#name (remember, it must answer #name properly, that is, not the #name
method in Object).
Then you can have:
self addSubpane: self map
name: 'mapDisplay'; " configure the mapDisplay's name"
setCenter: model coordinates zoom: model zoom;
addControl: GControl largeMapControl;
If when the list changes, you have to re-create the mapDisplay, in the
#regionSelectionChanged "callback" (the message sent when the list is
#changed) you should replace it as follows:
oldMap := self paneNamed: 'mapDisplay'.
self replacePane: oldMap with: self map
And to refresh properly the mapDisplay it should be rendered inside a
tag with id equals to its styleId, like this:
LBCGoogleMap >>renderContentOn: aRenderer
id: self styleId;
with: [ "render your component" ]
and must answer #refreshOn: (please see #when:send:to:refresh: section
in http://wiki.squeak.org/squeak/6093). You can implement it this way:
"Support for the events"
self renderContentOn: aRenderer
You will need to preserve the same #styleId, to do this simply send
the message styleId: 'anyId' to the mapDisplay. Another way to solve
this is adding a SFPanel which contains the mapDisplay and refresh it
when the button is clicked.
On Thu, Aug 27, 2009 at 1:02 PM, Timothy James Ziebart <
timothy at churchmilitant.org> wrote:
> Hi All,
> I have an object SearchInterface, a subclass of WASmallFacesComposite. On
> SearchInterface there are rendered a number of SFListBoxes and SFButtons.
> Included are three listboxes that are cascaded and the control was created
> like this:
> |pane panes list|
> list := self session findCodeByParent: 'region'.
> panes := OrderedCollection
> with: ( self paneNamed: 'nhoodList')
> with: ( self paneNamed: 'cityList').
> pane := SFListBox new.
> name: 'regionList';
> items: list;
> lines: 5;
> printSelector: #asString;
> owner: self;
> when: #changed:
> send: #regionSelectionChanged:
> to: self
> refresh: panes.
> The listboxes work correctly. What I need to do is have a GoogleMap
> rendered on SearchInterfaces as well. The map will not be a WAComponent as
> I need to render it as new whenever the listbox contents change. But not
> before an Update button is pressed. Such as:
> | pane panes |
> panes := OrderedCollection with: (*self paneNamed: 'mapDisplay')*.
> pane := SFButton new.
> label: 'Update Map';
> name: 'updateButton';
> when: #clicked
> send: #updateButtonPressed
> to: self
> refresh: panes.
> The question is how do I create *mapDisplay*? mapDisplay is rendered like
> this everytime the update button is pressed.
> ^LBCGoogleMap new
> setCenter: model coordinates zoom: model zoom;
> addControl: GControl largeMapControl;
> Can I place it on a SmallFace component that will render as I desire or do
> I replace it with non SmallFace components? Thank you for any assistance.
> seaside mailing list
> seaside at lists.squeakfoundation.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the seaside