tangollama
03-04-2003, 01:03 PM
I have the following code
-----------------------
<canvas width="100" height="800" title="CommNav Menubar">
<script>
if (bgColor == null) {
this.setBGColor(0xffffff);
} else {
Debug.Write('0x' + bgColor);
this.setBGColor('0x' + bgColor);
}
</script>
<splash/>
<!-- IMAGE RESOURCES -->
<resource src="logo.jpg" name="bg_img" />
<resource src="splash_logo.jpg" name="splash_img" />
<!-- FONT RESOURCES -->
<font src="helmetr.ttf" name="Helvetica"/>
<font src="helmetb.ttf" name="Helvetica" style="bold" />
<font src="lztahoe8b.ttf" name="Bold"/>
<!-- DATA SOURCE -->
<dataset name="portalData" autorequest="true"
src="http://jworrall.mars.dev.commnav.com:8014/mars/templates/jworrall/portalData.jsp"/>
<view id="datarows" width="immediateParent.width" resource="splash_img">
<!-- VIEWS of datarows -->
<simplelayout axis="y" />
<view width="immediateParent.width" height="20"
clickable="true" name="result" onclick="callDesktop(nameid/text())"
datapath="portalData:/sbh[1]/desktopList[1]/desktop">
<!--VIEWS-->
<simplelayout axis="x" />
<view id="icon" name="icon" resource="" />
<text datapath="name/text()"/>
<method name="callDesktop" args="nameid">
var nameId = nameid;
Debug.Write(nameId);
LzBrowser.loadURL("javascript:window.setDesktop(document.changeDeskto pFrm,null,'"+nameId+"')");
</method>
</view>
</view>
</canvas>
-----------------------------
the xml document I'm passing is the following:
-------------------------------
<sbh>
<desktopList>
<desktop>
<desktopid>2138</desktopid>
<nameid>home</nameid>
<name>Home</name>
<icon>/images/icons/home.gif</icon>
<currentFlag>true</currentFlag>
</desktop>
<desktop>
<desktopid>2741</desktopid>
<nameid>home2</nameid>
<name>home2</name>
<icon>/images/icons/file_document.gif</icon>
</desktop>
</desktopList>
</sbh>
-----------------------------
how can I access the nameid element to call the given method which calls a javascript function in the surrounding page? I have tried several other methods with little success. Probably a very simple question but I'm a little lost of the documentation.
On another note, documenting that the autorequest attribute on the dataset must be set to true to get the request to execute (or even what the attribute actually is) might be helpful. thanks.
-----------------------
<canvas width="100" height="800" title="CommNav Menubar">
<script>
if (bgColor == null) {
this.setBGColor(0xffffff);
} else {
Debug.Write('0x' + bgColor);
this.setBGColor('0x' + bgColor);
}
</script>
<splash/>
<!-- IMAGE RESOURCES -->
<resource src="logo.jpg" name="bg_img" />
<resource src="splash_logo.jpg" name="splash_img" />
<!-- FONT RESOURCES -->
<font src="helmetr.ttf" name="Helvetica"/>
<font src="helmetb.ttf" name="Helvetica" style="bold" />
<font src="lztahoe8b.ttf" name="Bold"/>
<!-- DATA SOURCE -->
<dataset name="portalData" autorequest="true"
src="http://jworrall.mars.dev.commnav.com:8014/mars/templates/jworrall/portalData.jsp"/>
<view id="datarows" width="immediateParent.width" resource="splash_img">
<!-- VIEWS of datarows -->
<simplelayout axis="y" />
<view width="immediateParent.width" height="20"
clickable="true" name="result" onclick="callDesktop(nameid/text())"
datapath="portalData:/sbh[1]/desktopList[1]/desktop">
<!--VIEWS-->
<simplelayout axis="x" />
<view id="icon" name="icon" resource="" />
<text datapath="name/text()"/>
<method name="callDesktop" args="nameid">
var nameId = nameid;
Debug.Write(nameId);
LzBrowser.loadURL("javascript:window.setDesktop(document.changeDeskto pFrm,null,'"+nameId+"')");
</method>
</view>
</view>
</canvas>
-----------------------------
the xml document I'm passing is the following:
-------------------------------
<sbh>
<desktopList>
<desktop>
<desktopid>2138</desktopid>
<nameid>home</nameid>
<name>Home</name>
<icon>/images/icons/home.gif</icon>
<currentFlag>true</currentFlag>
</desktop>
<desktop>
<desktopid>2741</desktopid>
<nameid>home2</nameid>
<name>home2</name>
<icon>/images/icons/file_document.gif</icon>
</desktop>
</desktopList>
</sbh>
-----------------------------
how can I access the nameid element to call the given method which calls a javascript function in the surrounding page? I have tried several other methods with little success. Probably a very simple question but I'm a little lost of the documentation.
On another note, documenting that the autorequest attribute on the dataset must be set to true to get the request to execute (or even what the attribute actually is) might be helpful. thanks.