Non-visual widgets

9 messages Options
Embed this post
Permalink
Jackie Ng

Non-visual widgets

Reply Threaded More More options
Print post
Permalink
Hi All,

I want to do is to be able to execute some javascript in response to a map selection event, but I want to be able to do this without hacking each fusion template, so I thought some kind of widget similar to Invoke Script in functionality would do the trick, but I was wondering:

a) Is it possible to create widgets that have no visual appearance?
b) If so, how do these get associated with the ApplicationDefinition? Is there MapGuide Studio support for this? Or would I have to manually edit the XML.

- Jackie
Mike Adair

Re: Non-visual widgets

Reply Threaded More More options
Print post
Permalink
Jackie Ng wrote:
> Hi All,
>
> I want to do is to be able to execute some javascript in response to a map selection event, but I want to be able to do this without hacking each fusion template, so I thought some kind of widget similar to Invoke Script in functionality would do the trick, but I was wondering:
>
> a) Is it possible to create widgets that have no visual appearance?
>  
Yes, the Maptip widget might be an example of this.  It does have some
visual output but there is no buttons or anything to start/stop it.

> b) If so, how do these get associated with the ApplicationDefinition? Is there MapGuide Studio support for this? Or would I have to manually edit the XML.
>  
You would put it in the AppDef, with a <Type> that corresponds to what
you called the widget, e.g. Fusion.Widget.MyWidgetType would have <Type>
set to MyWidgetType.  For the <Name> element, I think you need a
corresponding HTML element in your template, but that can be an empty
hidden element.  Paul can correct me if I'm wrong about that.

I don't think there is support for this in Studio so you would have to
code that by hand in your AppDef.


Mike

> - Jackie
>  

--
   Michael Adair
   Senior Software Architect
   DM Solutions Group Inc.

   Office: (613) 565-5056 x26
   [hidden email]
   http://www.dmsolutions.ca
   http://research.dmsolutions.ca


_______________________________________________
fusion-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/fusion-users
Jackie Ng

Re: Non-visual widgets

Reply Threaded More More options
Print post
Permalink
I don't want to modify the actual mapguide templates to accomodate this widget, can it be stored within a container, even though it has no visual appearance?

- Jackie

Mike Adair wrote:
Jackie Ng wrote:
> Hi All,
>
> I want to do is to be able to execute some javascript in response to a map selection event, but I want to be able to do this without hacking each fusion template, so I thought some kind of widget similar to Invoke Script in functionality would do the trick, but I was wondering:
>
> a) Is it possible to create widgets that have no visual appearance?
>  
Yes, the Maptip widget might be an example of this.  It does have some
visual output but there is no buttons or anything to start/stop it.

> b) If so, how do these get associated with the ApplicationDefinition? Is there MapGuide Studio support for this? Or would I have to manually edit the XML.
>  
You would put it in the AppDef, with a <Type> that corresponds to what
you called the widget, e.g. Fusion.Widget.MyWidgetType would have <Type>
set to MyWidgetType.  For the <Name> element, I think you need a
corresponding HTML element in your template, but that can be an empty
hidden element.  Paul can correct me if I'm wrong about that.

I don't think there is support for this in Studio so you would have to
code that by hand in your AppDef.


Mike

> - Jackie
>  

--
   Michael Adair
   Senior Software Architect
   DM Solutions Group Inc.

   Office: (613) 565-5056 x26
   madair@dmsolutions.ca
   http://www.dmsolutions.ca
   http://research.dmsolutions.ca


_______________________________________________
fusion-users mailing list
fusion-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/fusion-users
Måns Beckman

problem with localization of fusion, i think i found a bug...

Reply Threaded More More options
Print post
Permalink
Hi,

Ok, I'm still no coder, but I found something that isn't working as it should. I was trying to localize fusion in MGE2010 and it wouldn't read my localization, so I did some code digging and found something strange.

In this snippet from fusion.js something isn't working as it should.

        initializeLocale: function(locale) {
          OpenLayers.Lang.setCode(locale ? locale : window._FusionLocale);
          this.locale = OpenLayers.Lang.code;

To see what's happening in a simple way I modified it like this.

        initializeLocale: function(locale) {
alert(window._FusionLocale);
alert(locale?locale:window._FusionLocale)
OpenLayers.Lang.setCode(locale?locale:window._FusionLocale);this.locale=OpenLayers.Lang.code;
alert(OpenLayers.Lang.code)

And the result I got was in my case where I'm using a Swedish browser "sv", so window._FusionLocale is correct, "sv", so locale?locale:window._FusionLocale is reporting what I want, but then I get "en", so by some reason OpenLayers.Lang.code is reporting "en".

Anyone who can explain why, and what I need to do to get it to work? (I can think of some quick and dirty ways to fix it, but clean code is nicer.)

Cheers
Måns
_______________________________________________
fusion-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/fusion-users
Måns Beckman

SV: problem with localization of fusion, i think i found a bug...

Reply Threaded More More options
Print post
Permalink
Ok, so here is the problem. We are always sending two letter lang codes to Open Layers, that works great for some languages, but not others. For example to recognize Swedish open layers wants the code sv-SE. We will need to fix this in some way.

Cheers
Måns
       
-----Ursprungligt meddelande-----
Från: [hidden email] [mailto:[hidden email]] För Måns Beckman
Skickat: den 17 april 2009 12:07
Till: [hidden email]
Ämne: [fusion-users] problem with localization of fusion,i think i found a bug...

Hi,

Ok, I'm still no coder, but I found something that isn't working as it should. I was trying to localize fusion in MGE2010 and it wouldn't read my localization, so I did some code digging and found something strange.

In this snippet from fusion.js something isn't working as it should.

        initializeLocale: function(locale) {
          OpenLayers.Lang.setCode(locale ? locale : window._FusionLocale);
          this.locale = OpenLayers.Lang.code;

To see what's happening in a simple way I modified it like this.

        initializeLocale: function(locale) {
alert(window._FusionLocale);
alert(locale?locale:window._FusionLocale)
OpenLayers.Lang.setCode(locale?locale:window._FusionLocale);this.locale=OpenLayers.Lang.code;
alert(OpenLayers.Lang.code)

And the result I got was in my case where I'm using a Swedish browser "sv", so window._FusionLocale is correct, "sv", so locale?locale:window._FusionLocale is reporting what I want, but then I get "en", so by some reason OpenLayers.Lang.code is reporting "en".

Anyone who can explain why, and what I need to do to get it to work? (I can think of some quick and dirty ways to fix it, but clean code is nicer.)

Cheers
Måns
_______________________________________________
fusion-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/fusion-users

No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 8.5.287 / Virus Database: 270.11.58/2061 - Release Date: 04/16/09 16:38:00
_______________________________________________
fusion-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/fusion-users
Mike Adair

Re: SV: problem with localization of fusion, i think i found a bug...

Reply Threaded More More options
Print post
Permalink
Yes it looks like Fusion is stripping off the regional part of the
locale around line 1075 of fusion.js.  Can you enter a ticket for this
please on the Fusion trac system please? http://trac.osgeo.org/fusion/

Mike

Måns Beckman wrote:

> Ok, so here is the problem. We are always sending two letter lang codes to Open Layers, that works great for some languages, but not others. For example to recognize Swedish open layers wants the code sv-SE. We will need to fix this in some way.
>
> Cheers
> Måns
>
> -----Ursprungligt meddelande-----
> Från: [hidden email] [mailto:[hidden email]] För Måns Beckman
> Skickat: den 17 april 2009 12:07
> Till: [hidden email]
> Ämne: [fusion-users] problem with localization of fusion,i think i found a bug...
>
> Hi,
>
> Ok, I'm still no coder, but I found something that isn't working as it should. I was trying to localize fusion in MGE2010 and it wouldn't read my localization, so I did some code digging and found something strange.
>
> In this snippet from fusion.js something isn't working as it should.
>
>         initializeLocale: function(locale) {
>           OpenLayers.Lang.setCode(locale ? locale : window._FusionLocale);
>           this.locale = OpenLayers.Lang.code;
>
> To see what's happening in a simple way I modified it like this.
>
>         initializeLocale: function(locale) {
> alert(window._FusionLocale);
> alert(locale?locale:window._FusionLocale)
> OpenLayers.Lang.setCode(locale?locale:window._FusionLocale);this.locale=OpenLayers.Lang.code;
> alert(OpenLayers.Lang.code)
>
> And the result I got was in my case where I'm using a Swedish browser "sv", so window._FusionLocale is correct, "sv", so locale?locale:window._FusionLocale is reporting what I want, but then I get "en", so by some reason OpenLayers.Lang.code is reporting "en".
>
> Anyone who can explain why, and what I need to do to get it to work? (I can think of some quick and dirty ways to fix it, but clean code is nicer.)
>
> Cheers
> Måns
> _______________________________________________
> fusion-users mailing list
> [hidden email]
> http://lists.osgeo.org/mailman/listinfo/fusion-users
>
> No virus found in this incoming message.
> Checked by AVG - www.avg.com
> Version: 8.5.287 / Virus Database: 270.11.58/2061 - Release Date: 04/16/09 16:38:00
> _______________________________________________
> fusion-users mailing list
> [hidden email]
> http://lists.osgeo.org/mailman/listinfo/fusion-users
>
>  

--
   Michael Adair
   Senior Software Architect
   DM Solutions Group Inc.

   Office: (613) 565-5056 x26
   [hidden email]
   http://www.dmsolutions.ca
   http://research.dmsolutions.ca


_______________________________________________
fusion-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/fusion-users
Måns Beckman

SV: SV: problem with localization of fusion, i think i found a bug...

Reply Threaded More More options
Print post
Permalink
I have filed a ticket for the issue.
Another thing that I was wondering about was if we actually use any parts of the OpenLayers translation files? When we are using setCode, it will actually check if there is an OpenLayers translation file, and it seems unnecessary to translate OpenLayers into a local language if we don't use the translation.

Cheers
Måns

-----Ursprungligt meddelande-----
Från: Mike Adair [mailto:[hidden email]]
Skickat: den 17 april 2009 16:20
Till: Måns Beckman
Kopia: [hidden email]
Ämne: Re: SV: [fusion-users] problem with localization of fusion, i think i found a bug...

Yes it looks like Fusion is stripping off the regional part of the
locale around line 1075 of fusion.js.  Can you enter a ticket for this
please on the Fusion trac system please? http://trac.osgeo.org/fusion/

Mike

Måns Beckman wrote:

> Ok, so here is the problem. We are always sending two letter lang codes to Open Layers, that works great for some languages, but not others. For example to recognize Swedish open layers wants the code sv-SE. We will need to fix this in some way.
>
> Cheers
> Måns
>
> -----Ursprungligt meddelande-----
> Från: [hidden email] [mailto:[hidden email]] För Måns Beckman
> Skickat: den 17 april 2009 12:07
> Till: [hidden email]
> Ämne: [fusion-users] problem with localization of fusion,i think i found a bug...
>
> Hi,
>
> Ok, I'm still no coder, but I found something that isn't working as it should. I was trying to localize fusion in MGE2010 and it wouldn't read my localization, so I did some code digging and found something strange.
>
> In this snippet from fusion.js something isn't working as it should.
>
>         initializeLocale: function(locale) {
>           OpenLayers.Lang.setCode(locale ? locale : window._FusionLocale);
>           this.locale = OpenLayers.Lang.code;
>
> To see what's happening in a simple way I modified it like this.
>
>         initializeLocale: function(locale) {
> alert(window._FusionLocale);
> alert(locale?locale:window._FusionLocale)
> OpenLayers.Lang.setCode(locale?locale:window._FusionLocale);this.locale=OpenLayers.Lang.code;
> alert(OpenLayers.Lang.code)
>
> And the result I got was in my case where I'm using a Swedish browser "sv", so window._FusionLocale is correct, "sv", so locale?locale:window._FusionLocale is reporting what I want, but then I get "en", so by some reason OpenLayers.Lang.code is reporting "en".
>
> Anyone who can explain why, and what I need to do to get it to work? (I can think of some quick and dirty ways to fix it, but clean code is nicer.)
>
> Cheers
> Måns
> _______________________________________________
> fusion-users mailing list
> [hidden email]
> http://lists.osgeo.org/mailman/listinfo/fusion-users
>
> No virus found in this incoming message.
> Checked by AVG - www.avg.com
> Version: 8.5.287 / Virus Database: 270.11.58/2061 - Release Date: 04/16/09 16:38:00
> _______________________________________________
> fusion-users mailing list
> [hidden email]
> http://lists.osgeo.org/mailman/listinfo/fusion-users
>
>  

--
   Michael Adair
   Senior Software Architect
   DM Solutions Group Inc.

   Office: (613) 565-5056 x26
   [hidden email]
   http://www.dmsolutions.ca
   http://research.dmsolutions.ca



No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 8.5.287 / Virus Database: 270.12.0/2068 - Release Date: 04/19/09 20:04:00
_______________________________________________
fusion-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/fusion-users
Chris Claydon

RE: problem with localization of fusion, i think i found a bug...

Reply Threaded More More options
Print post
Permalink
In reply to this post by Måns Beckman
If the code isn't supported by OpenLayers, it will revert to en. Is 'sv' supported by OpenLayers?

-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of Måns Beckman
Sent: Friday, April 17, 2009 4:07 AM
To: [hidden email]
Subject: [fusion-users] problem with localization of fusion, i think i found a bug...

Hi,

Ok, I'm still no coder, but I found something that isn't working as it should. I was trying to localize fusion in MGE2010 and it wouldn't read my localization, so I did some code digging and found something strange.

In this snippet from fusion.js something isn't working as it should.

        initializeLocale: function(locale) {
          OpenLayers.Lang.setCode(locale ? locale : window._FusionLocale);
          this.locale = OpenLayers.Lang.code;

To see what's happening in a simple way I modified it like this.

        initializeLocale: function(locale) {
alert(window._FusionLocale);
alert(locale?locale:window._FusionLocale)
OpenLayers.Lang.setCode(locale?locale:window._FusionLocale);this.locale=OpenLayers.Lang.code;
alert(OpenLayers.Lang.code)

And the result I got was in my case where I'm using a Swedish browser "sv", so window._FusionLocale is correct, "sv", so locale?locale:window._FusionLocale is reporting what I want, but then I get "en", so by some reason OpenLayers.Lang.code is reporting "en".

Anyone who can explain why, and what I need to do to get it to work? (I can think of some quick and dirty ways to fix it, but clean code is nicer.)

Cheers
Måns
_______________________________________________
fusion-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/fusion-users
_______________________________________________
fusion-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/fusion-users
Chris Claydon

RE: Non-visual widgets

Reply Threaded More More options
Print post
Permalink
In reply to this post by Jackie Ng
I'm not sure this is the best approach, but could you extend the existing selection widget to add in the new code (either by modifying it directly or by creating a new widget based on it)?

-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of Jackie Ng
Sent: Thursday, April 09, 2009 3:48 AM
To: [hidden email]
Subject: Re: [fusion-users] Non-visual widgets


I don't want to modify the actual mapguide templates to accomodate this widget, can it be stored within a container, even though it has no visual appearance?

- Jackie


Jackie Ng wrote:
> Hi All,
>
> I want to do is to be able to execute some javascript in response to a map selection event, but I want to be able to do this without hacking each fusion template, so I thought some kind of widget similar to Invoke Script in functionality would do the trick, but I was wondering:
>
> a) Is it possible to create widgets that have no visual appearance?
>  
Yes, the Maptip widget might be an example of this.  It does have some
visual output but there is no buttons or anything to start/stop it.

> b) If so, how do these get associated with the ApplicationDefinition? Is there MapGuide Studio support for this? Or would I have to manually edit the XML.
>  
You would put it in the AppDef, with a <Type> that corresponds to what
you called the widget, e.g. Fusion.Widget.MyWidgetType would have <Type>
set to MyWidgetType.  For the <Name> element, I think you need a
corresponding HTML element in your template, but that can be an empty
hidden element.  Paul can correct me if I'm wrong about that.

I don't think there is support for this in Studio so you would have to
code that by hand in your AppDef.


Mike

> - Jackie
>  

--
   Michael Adair
   Senior Software Architect
   DM Solutions Group Inc.

   Office: (613) 565-5056 x26
   [hidden email]
   http://www.dmsolutions.ca
   http://research.dmsolutions.ca


_______________________________________________
fusion-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/fusion-users



--
View this message in context: http://n2.nabble.com/Non-visual-widgets-tp2561352p2610210.html
Sent from the Fusion Users mailing list archive at Nabble.com.

_______________________________________________
fusion-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/fusion-users
_______________________________________________
fusion-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/fusion-users