Hi,

you need to attach a mixin to the component that you'd like to manipulate. 
Read this: http://tapestry.apache.org/component-mixins.html

And have a look at other mixin implementations, like the Autocomplete-Mixin:

Autcomplete.java
https://git-wip-us.apache.org/repos/asf?p=tapestry-5.git;a=blob;f=tapestry-core/src/main/java/org/apache/tapestry5/corelib/mixins/Autocomplete.java;h=737457986be53f86393b5f21e03b4b5dd8434420;hb=5.3

autocomplete.js
https://git-wip-us.apache.org/repos/asf?p=tapestry-5.git;a=blob;f=tapestry-core/src/main/resources/org/apache/tapestry5/corelib/mixins/autocomplete.js;h=ba8dd503a9bd90ba2e7e749802194fea20b94689;hb=5.3


Best,
Christian


Am 11.06.2012 um 15:08 schrieb dick.mur...@unit4.com:

> Hi all. (Tapestry newbie).
> 
> I'm struggling to understand how to get a MixIn to be called.
> 
> I have the following template.
> 
> <html t:type="layout" title="Ordnance Survey"
>  xmlns:t="http://tapestry.apache.org/schema/tapestry_5_3.xsd";>
> <p>
>       Data
>       <t:beandisplay object="this" include="postcode, georss"/>
> </p>
> 
> <p>
>       Metadata
>       <t:beandisplay object="this" include="uri, tripleSize"/>
> </p>
> 
> <p>
>       <t:if test="getModel().getFound()">
>               <p>
>                       <t:actionlink t:id="AsTriples" 
> context="${getPostcode()}">As
> Triples</t:actionlink>
>               </p>
>       </t:if>
> </p>
> 
> <div id="map" style="width: 600px; height: 400px; border: 1px solid
> black;"></div>
>       
> </html>
> 
> I have the following mixin os.js
> 
> var OS = Class.create();
> OS.prototype = {
>       var osMap;
>       
>        initialize: function(element) {
>                Event.observe($(element), 'click',
> this.doOS.bindAsEventListener());
>        },
> 
>        doOS: function() {
>                        osMap = new OpenSpace.Map('map');
>                        osMap.setCenter(new OpenSpace.MapPoint(438760, 
> 114760), 10);
>                        var markers = new OpenLayers.Layer.Markers("Markers");
>                        osMap.addLayer(markers);
>                        var pos, marker;
>                        pos = new OpenSpace.MapPoint(438760, 114760);
>                        marker = new OpenLayers.Marker(pos);
>                        markers.addMarker(marker);
>        }
> }
> 
> Where do I put the "call" to the os.js to populate the <div></div> please..?
> 
> --
> View this message in context: 
> http://tapestry.1045711.n5.nabble.com/Struggling-to-get-mixin-to-work-tp5713764.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to