Place change dynamically

17 views
Skip to first unread message

Cristian Rinaldi

unread,
Jan 29, 2012, 12:07:27 PM1/29/12
to google-we...@googlegroups.com
I have a place that change dynamically but these changes are not reflected in the URL.

In the activity, a place with information is launched, but the mapper (CachingActivityMapper) needs to put other information, then I tried this code in the Mapper:

        this.eventBus.addHandler( PlaceChangeEvent.TYPE, new PlaceChangeEvent.Handler() {
            @Override
            public void onPlaceChange( PlaceChangeEvent event ) {
                Place newPlace = event.getNewPlace();
                if ( newPlace instanceof PlaceTrace ) {
                    ((PlaceTrace)newPlace).setPosition( CachingCenterActivityMapper.getKeyPosition() );
                }
            }
        } );

but the handler is called after writing the URL.

Any suggestions?

Ashton Thomas

unread,
Jan 29, 2012, 1:56:28 PM1/29/12
to google-we...@googlegroups.com
If you use a PlaceController to goTo new places, try creating a wrapper around the placeController to do the check and then call the original goTo(Place new place)...
Reply all
Reply to author
Forward
0 new messages