Select to view content in your preferred language

Add help to widget

907
4
Jump to solution
12-10-2012 09:33 AM
anjelinaponker
Emerging Contributor
How can I add help for widget?
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
AnthonyGiles
Honored Contributor
Anjelina,

I do it by adding an icon in the widget header that opens up a web page with the help on. In the init function add:

wTemplate.addTitlebarButton("assets/images/i_help.png", "Help", showHelp);


then add a showHelp function:

private function showHelp():void  {  var urlRequest:URLRequest = new URLRequest("widgets/Bearing/help.html");  navigateToURL(urlRequest, "_blank"); }


Regards

Anthony

View solution in original post

0 Kudos
4 Replies
AnthonyGiles
Honored Contributor
Anjelina,

I do it by adding an icon in the widget header that opens up a web page with the help on. In the init function add:

wTemplate.addTitlebarButton("assets/images/i_help.png", "Help", showHelp);


then add a showHelp function:

private function showHelp():void  {  var urlRequest:URLRequest = new URLRequest("widgets/Bearing/help.html");  navigateToURL(urlRequest, "_blank"); }


Regards

Anthony
0 Kudos
RhettZufelt
MVP Notable Contributor
I have implemented this on most my widgets, but have changed to use ExternalInterface.call instead of navigateToURL so I can control the new browser window size.

Seems to be working great, however, for about half the widgets, the help button shows as selected (underlined) as soon as you open the widget.

The other half of my widgets don't get the selected underline until I actually click on the icon.

Doesn't seem to be affecting the operation, but is somewhat confusing to some.

Was wondering if anyone has an idea as to why it sometimes makes it selected, others not.

For that matter, really just need a way to make them show as non-selected on widget open.

Thanks for any insight,

R_
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Rhett,

   What about just adding the fourth argument as false and the button will not act as a toggle button and just act like a button.
0 Kudos
RhettZufelt
MVP Notable Contributor
Perfect, works like a charm.

R_
0 Kudos