On 7/6/07, Grégory Babusiaux <[EMAIL PROTECTED]> wrote: > here is the xslt file I'm sure it works, i've tested it before (for > the translation part anyway). > > I don't have a .js file associated, my widget is a base widget type > defined in WidgetBase.js > > Do i need a js file? sorry, I started working on this program 3 days > ago, i'm a rookie :S
Yes, but in you case it is very simple Have a look at: http://docs.codehaus.org/display/MAP/Add+Widget+Tutorial You can also decide to use a widget that is alredy present and overwrite the stylesheet or the js associated indicating the right parameters in the config file. > > <?xml version="1.0" encoding="UTF-8"?> > <xsl:stylesheet > xmlns:wmc="http://www.opengis.net/context" > xmlns:xsl="http://www.w3.org/1999/XSL/Transform" > xmlns:gml='http://www.opengis.net/gml' > xmlns:wfs='http://www.opengis.net/wfs' > xmlns:sld='http://www.opengis.net/sld' > xmlns:xlink='http://www.w3.org/1999/xlink' > version="1.0"> > > <xsl:output method="xml" encoding="utf-8"/> > > <!-- The common params set for all widgets --> > <xsl:param name="lang">en</xsl:param> > <xsl:param name="modelId"/> > <xsl:param name="widgetId"/> > > <xsl:param name="skinDir"/> > > <!-- Text params for this widget --> > <xsl:param name="title"/> > > <!-- The name of the javascript context object to call --> > <xsl:param name="featureName"/> > <xsl:param name="hidden"/> > <xsl:param name="context">config.objects.<xsl:value-of > select="$modelId"/></xsl:param> > > <!-- Main html --> > > <xsl:template match="/data"> > <script>alert("hello");</script> > <h1> > [Données] > </h1> > <xsl:apply-templates/> > </xsl:template> > > > <xsl:template match="country"> > <p class="country"> > <xsl:attribute name="onClick"> > affichage('<xsl:value-of select="@id"/>'); > </xsl:attribute> > > <xsl:value-of select="@id"/> > </p> > <p class="province"> > <xsl:attribute name="id"> > <xsl:value-of select="/data/country/@id"/> > </xsl:attribute> > <xsl:apply-templates/> > </p> > </xsl:template> > > <xsl:template match="province"> > <br/> > <span> > <xsl:attribute name="onClick"> > affichage('<xsl:value-of select="@id"/>'); > </xsl:attribute> > <xsl:value-of select="@id"/> > </span> > <p class="lits"> > <xsl:attribute name="id"> > <xsl:value-of select="@id"/> > </xsl:attribute> > <xsl:apply-templates/> > </p> > > </xsl:template> > </xsl:stylesheet> > > Le 06-juil.-07 à 11:54, Luca Giandoso a écrit : > > > The .js and the xslt if it is defined. > > > > On 7/6/07, Grégory Babusiaux <[EMAIL PROTECTED]> wrote: > >> what do you mean? the xml and xslt file? > >> > >> > >> Le 06-juil.-07 à 11:46, Luca Giandoso a écrit : > >> > >> > Can you post the code of your widget? > >> > > >> > Luca > >> > > >> > On 7/6/07, Grégory Babusiaux <[EMAIL PROTECTED]> wrote: > >> >> Hello again! > >> >> > >> >> I try to display a widget but i didn't get any luck so far .... > >> >> > >> >> Here is an extract of my main HTML file: > >> >> > >> >> <body onload="mbDoLoad()" > > >> >> <div id="header"> > >> >> <h1><a href="http://communitymapbuilder.org">MapBuilder</ > >> a> GML > >> >> Viewer - Belgique</h1> > >> >> </div> > >> >> > >> >> <div id="mainbody"> > >> >> <div id="data"> </div> HERE IS WHERE I WANT TO ADD MY > >> DATA > >> >> <div id="mainMapPane"> > >> >> <noscript> > >> >> this page requires Javascript to be enabled > >> >> </noscript> > >> >> </div> > >> >> <div id="mainButtonBar"></div> > >> >> <div id="cursorTrack"></div> > >> >> <div id="legend"></div> > >> >> </div> > >> >> </body></html> > >> >> > >> >> Here is an extract of my config file: > >> >> > >> >> [...] > >> >> <models> > >> >> <OwsContext id="mainMap"> > >> >> <defaultModelUrl>Belgium/belgiumContext.xml</ > >> defaultModelUrl> > >> >> <widgets> > >> >> <MapPaneOL id="mainMapWidget"> > >> >> <htmlTagId>mainMapPane</htmlTagId> > >> >> <mapContainerId>mainMapContainer</mapContainerId> > >> >> </MapPaneOL> > >> >> <Widget id="dataTree"> MY DATA AS A WIDGET > >> >> <htmlTagId>data</htmlTagId> data TAG > >> >> <stylesheet>./arbre/data.xsl</stylesheet> STYLESHEET > >> >> <defaultModelUrl>./arbre/data.xml</ > >> defaultModelUrl> URL > >> >> TO SOURCE > >> >> </Widget> > >> >> <Legend id="contextLegend"> > >> >> <htmlTagId>legend</htmlTagId> > >> >> <stylesheet>./Legend2.xsl</stylesheet> > >> >> </Legend> > >> >> </widgets> > >> >> [...] > >> >> > >> >> I put some alert(this.id); everywhere I could ans my widget is > >> well > >> >> defined but it won't display within <div id="data"></div> > >> >> > >> >> > >> >> Do you have any idea why it doesn't display? :S > >> >> > >> >> Thanks > >> >> > >> >> greg > >> >> > >> >> > >> >> > >> >> > >> >> > >> >> > >> >> > >> --------------------------------------------------------------------- > >> >> ---- > >> >> This SF.net email is sponsored by DB2 Express > >> >> Download DB2 Express C - the FREE version of DB2 express and take > >> >> control of your XML. No limits. Just data. Click to get it now. > >> >> http://sourceforge.net/powerbar/db2/ > >> >> _______________________________________________ > >> >> mapbuilder-devel mailing list > >> >> [email protected] > >> >> https://lists.sourceforge.net/lists/listinfo/mapbuilder-devel > >> >> > >> > >> > > ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ mapbuilder-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/mapbuilder-devel
