Draw & Measure Widgets not activating in custom theme since 1.2 upgrade

2692
5
Jump to solution
09-10-2015 12:59 PM
Drew
by
Regular Contributor

Hello,

I recently updated our code base to the 1.2 builder and viewer. I am having some issues with the default Measure and Draw widgets (the only 2 out of the box widgets I use). 

Basically the buttons do not stay activated and the drawtool code deactivates instantly. When I click on the draw button the css class "jimu-state-active" gets added to the element but the instantly gets removed.  Something  in the 1.2 code has changed and I am having difficulties trying to figure it out. 

Please note this is only happening in our custom theme we have built in house and not in an ESRI theme. There must be some event I need to add to my theme code or something..

Any ideas ?

Drew

0 Kudos
1 Solution

Accepted Solutions
Drew
by
Regular Contributor

I have finally figured out it..

In our theme I was creating a new instance of the PanelManager where I should have been using the PanelManager.getInstance();

Simple, but stumped me for a long time... Something in 1.2 changed i guess.

Thanks again,

Drew

View solution in original post

0 Kudos
5 Replies
RobertScheitlin__GISP
MVP Esteemed Contributor

Drew,

   The DrawBox Dijit and related css rules has changed a bit in 1.2. In 1.1 the selected drawing tool use to get the "selected" class rule applied. Now in 1.2 it is the "jimu-state-active" class rule.

  The DrawBox dijit now has a deactivateAfterDrawing proprty that is defaulted to true.

   I am not sure what affects this would have on your theme but they affected a couple of my widgets that used the DrawBox

0 Kudos
QunSun
by
New Contributor III

Hi Andrew,

When you click drawtool on Draw widget, the drawToolBar will be activated, then you can draw a geometry on map. After you finish drawing, darwToolBar will be deactivated. This is by design.

If you want to draw graphics continuously, you need to add the following line of code in Query/Widget.js.

ZeZhengLi
Occasional Contributor

Andrew,

Could you give details information about Measurement ?

0 Kudos
Drew
by
Regular Contributor

Thanks for the reply guys.

As I step though some code I am seeing the deactivate() function being  after the item click.

It all stems back to the "onPanelClick" event in the PanelManager class.

I did a few hacks when creating our theme and I think I have to look how I add widgets to the application.

Basically I was using a shared panel for many widgets and it seems that may not be possible.

Thanks for the suggestions

Drew

0 Kudos
Drew
by
Regular Contributor

I have finally figured out it..

In our theme I was creating a new instance of the PanelManager where I should have been using the PanelManager.getInstance();

Simple, but stumped me for a long time... Something in 1.2 changed i guess.

Thanks again,

Drew

0 Kudos