html_area var troubles

Questions, tips and tricks and techniques for scripting in Servoy

Re: html_area var troubles

Postby eKelman » Wed May 20, 2009 1:11 am

Hi johan,

Thank you for the reply.

Could you please give me an example of how this works? I'm new to servoy and javascript and am totally lost at this point. thanks
Ernest
Kelman Technologies
eKelman
 
Posts: 52
Joined: Tue May 12, 2009 9:09 pm

Re: html_area var troubles

Postby jcompagner » Wed May 20, 2009 2:04 pm

But you are already doing al that stuff:

Code: Select all
<link target="_BLANK" rel="stylesheet" type="text/css" href="http://serverapi.arcgisonline.com/jsapi/arcgis/1.3/js/dojo/dijit/themes/tundra/tundra.css">\
<script type="text/javascript">djConfig = { parseOnLoad:true }</script>\
<script type="text/javascript" src="http://serverapi.arcgisonline.com/jsapi/arcgis/?v=1.3"></script>\
\
<script type="text/javascript">\
dojo.require("esri.map");\
dojo.require("esri.toolbars.navigation");\
dojo.require("esri.toolbars.draw");\
dojo.require("dijit.form.Button");\
dojo.require("dijit.Toolbar");\
\
function init() {\
var map = new esri.Map("map");\
var tiledMapServiceLayer = new esri.layers.ArcGISTiledMapServiceLayer("http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_Imagery_World_2D/MapServer");\
map.addLayer(tiledMapServiceLayer);\
}\
\
dojo.addOnLoad(init);\
\
</script>\
</head



that has to be done in the Main page itself.
The usage of that stuff can then be done in another form.

I think that last init() can maybe be moved to the tab form also so this part:

Code: Select all
function init() {\
var map = new esri.Map("map");\
var tiledMapServiceLayer = new esri.layers.ArcGISTiledMapServiceLayer("http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_Imagery_World_2D/MapServer");\
map.addLayer(tiledMapServiceLayer);\
}\
\
dojo.addOnLoad(init);\
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8833
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Re: html_area var troubles

Postby eKelman » Wed May 20, 2009 7:34 pm

Hi Johan,
I have attempted your solution and am unable to achieve what you have described to me.

my main form has method to open in dialog that looks like this:
Code: Select all
function openWizard()
{
wizard_markup = '<html>\
<head>\
<title>Create Map</title>\
<link target="_BLANK" rel="stylesheet" type="text/css" href="http://serverapi.arcgisonline.com/jsapi/arcgis/1.3/js/dojo/dijit/themes/tundra/tundra.css">\
<script type="text/javascript">djConfig = { parseOnLoad:true }</script>\
<script type="text/javascript" src="http://serverapi.arcgisonline.com/jsapi/arcgis/?v=1.3"></script>\
\
<script type="text/javascript">\
dojo.require("esri.map");\
dojo.require("esri.toolbars.navigation");\
dojo.require("esri.toolbars.draw");\
dojo.require("dijit.form.Button");\
dojo.require("dijit.Toolbar");\
\
</script>\
</head>\
<body>\
<div id="map" style="width:900px; height:600px; border:1px solid #000;"></div>\
<a target="_BLANK" href="http://www.bbc.co.uk">BBC</a>\
</body>\
</html>';

  application.showFormInDialog('mm_wizard',20,100,895,580,'Merge Move Wizard',false,false,'mm_wizard',true);
}

This runs fine and displays an empty html_area. I then click next until I hit the map tab.

the mm_wizard then has a button event that will move through the tabs.
Code: Select all
function NextStep_Click()
{
   if ( elements.tabs.tabIndex  < elements.tabs.getMaxTabIndex() + 1)
   {
      elements.tabs.tabIndex = elements.tabs.tabIndex + 1 ;
   }


When the user gets to the tab that will display the html_area i call onShow()
Code: Select all
function onShow()
{
   initMap();
}

function initMap()
{
  fv_mm_mark_up = '<html>\
<head>\
<script type="text/javascript">\
\
function init() {\
var map = new esri.Map("map");\
var tiledMapServiceLayer = new esri.layers.ArcGISTiledMapServiceLayer("http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_Imagery_World_2D/MapServer");\
map.addLayer(tiledMapServiceLayer);\
}\
\
dojo.addOnLoad(init);\
</script>\
</head>\
<body>\
<div id="map" style="width:900px; height:600px; border:1px solid #000;"></div>\
<a target="_BLANK" href="http://www.bbc.co.uk">BBC</a>\
</body>\
</html>';
}


When I do this the map shows up in the hidden html_area on the main form and not in the mapping tab.

any ideas on what I am doing wrong?
Ernest
Kelman Technologies
eKelman
 
Posts: 52
Joined: Tue May 12, 2009 9:09 pm

Re: html_area var troubles

Postby jcompagner » Mon May 25, 2009 10:27 am

no you have to dig into the dojo lib for this
i have no idea, i guess you now bind it on a div in the main page instead of a div in a tab.
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8833
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Re: html_area var troubles

Postby eKelman » Tue May 26, 2009 7:06 pm

HI,
thanks for the reply. and all of your help. I gave up on that for now, but will revisit the issue at a later date. I just can't seem to understand what it is that is causing this problem. If anyone has any ideas on how to solve this please feel free to post your solution. Thanks
Ernest
Kelman Technologies
eKelman
 
Posts: 52
Joined: Tue May 12, 2009 9:09 pm

Previous

Return to Methods

Who is online

Users browsing this forum: No registered users and 43 guests