PDA

View Full Version : stumped


joemcglynn
01-26-2004, 04:41 PM
I'm building a simple app, based on the contact list example.

The issue I am having is that when I click the delete button I am not getting any data in the "sendData" method. I'm sure I am just doing something wrong, but it isn't clear what...

The app gets data from my getcomponents.jsp just fine. It calls the componentmanager.jsp just fine as well - if I hard code a componentName in the call it even deletes the data and returns.

I'm using LPS2.0p.

My question is essentially, at the point where I have:
p.addValue( "componentName", componentName.getText(), true);
How do I get it to resolve to the current row data values?

===================


<canvas bgcolor="#eaeaea" height="800" width="1200">
<font src="bitstream-vera-1.10/vera.ttf" name="contactsfont"/>
<font src="bitstream-vera-1.10/verabd.ttf" name="boldfont"/>
<font name="lztahoe8" src="lztahoe8.ttf"/>

<dataset name="mydata" src="http://localhost:8083/pmweb/getcomponents.jsp" autorequest="true"/>
<dataset name="dsSendData" autorequest="false" src="http://localhost:8083/pmweb/componentmanager.jsp" type="http"/>


<resource name="tab_top_mid">
<frame src="art/top_btn_mid.swf"/>
<frame src="art/top_btn_mid_mo.swf"/>
<frame src="art/top_btn_mid_dn.swf"/>
</resource>

<resource name="tab_bot_mid" src="art/bot_btn_mid.swf"/>

<class name="row" height="30" bgcolor="0xE7E7D6" width="100%">

<attribute name="minheight" value="30"/>
<attribute name="maxheight" value="290"/>

<method name="sendData" args="action">
var d=canvas.datasets.dsSendData;
var p=new LzParam();
p.addValue( "action", action, true);
p.addValue( "componentName", componentName.getText(), true);
p.addValue( "componentStatus", componentStatus.getText(), true);
p.addValue( "type", type.getText(), true);
p.addValue( "developmentPlanned", developmentPlanned.getText(), true);
p.addValue( "developmentActual", developmentActual.getText(), true);
p.addValue( "docComplete", docComplete.getText(), true);
p.addValue( "testPlan", testPlan.getText(), true);
p.addValue( "qaComplete", qaComplete.getText(), true);
p.addValue( "notes", notes.getText(), true);
p.addValue( "engineer", engineer.getText(), true);
p.addValue( "tester", tester.getText(), true);
d.setQueryString( p );
d.doRequest();
</method>

<view name="small" font="contactsfont" fontsize="12" width="100%">
<basebutton resource="tab_top_mid" clickable="true" width="${parent.width}" stretches="both">
<method event="onclick">
if (classroot.height == classroot.minheight) {
classroot.open.setAttribute('visible',true);
newheight = classroot.maxheight;
} else {
classroot.open.setAttribute('visible',false);
newheight = classroot.minheight;
}
classroot.animate('height', newheight, 300);
</method>
</basebutton>

<text x="5" y="3" width="200" datapath="@componentName"/>
<text x="215" y="3" width="150" datapath="@componentStatus"/>
<text x="375" y="3" width="70" datapath="@developmentPlanned"/>
<text x="445" y="3" width="70" datapath="@developmentActual"/>
<text x="525" y="3" width="70" datapath="@testPlan"/>
<text x="605" y="3" width="70" datapath="@qaActual"/>
<text x="685" y="3" width="70" datapath="@docActual"/>
<text x="765" y="3" width="70" datapath="@engineer"/>
<text x="855" y="3" width="70" datapath="@tester"/>

</view>

<view x="10" name="open" width="100%" font="lztahoe8" visible="false">
<text y="10">Component Name:</text>
<edittext name="componentName" width="200" height="22" datapath="@componentName" x="140" y="5"/>
<text y="35">Component Status:</text>
<edittext name="componentStatus" height="22" datapath="@componentStatus" x="140" y="30"/>
<text y="60">Development Planned:</text>
<edittext name="developmentPlanned" height="22" datapath="@developmentPlanned" x="140" y="55"/>
<text y="85">Development Actual:</text>
<edittext name="developmentActual" height="22" datapath="@developmentActual" x="140" y="80"/>
<text x="285" y="85">Engineer:</text>
<edittext name="engineer" height="22" datapath="@engineer" x="340" y="80"/>
<text y="110">Test Plan:</text>
<edittext name="testPlan" height="22" datapath="@testPlan" x="140" y="105"/>
<text x="285" y="110">Tester:</text>
<edittext name="tester" height="22" datapath="@tester" x="340" y="105"/>
<text y="135">Doc Complete:</text>
<edittext name="docComplete" height="22" datapath="@docActual" x="140" y="130"/>
<text y="160">QA Complete:</text>
<edittext name="qaComplete" height="22" datapath="@qaActual" x="140" y="155"/>
<text y="185">Notes:</text>
<edittext name="notes" multiline="true" width="400" height="80" datapath="@notes" x="140" y="180"/>

<button width="80" x="460" y="5">Update
<method event="onclick">
parent.parent.sendData("update")
parent.parent.datapath.updateData();
</method>
</button>

<button width="80" x="460" y="35">Delete
<method event="onclick">
parent.parent.sendData("delete")
parent.parent.datapath.deleteNode();
</method>
</button>

</view>

<simplelayout axis="y"/>

</class>

<view name="contactsborder" bgcolor="0x676767" x="40" y="40" height="580"
width="940" visible="false" oninit="this.setVisible(true)">

<text name="test" fgcolor="white" font="boldfont" fontsize="18" x="5" y="1">Series 60 Components</text>

<view name="header" fgcolor="white" font="boldfont" fontsize="12" y="20">
<text x="5" text="Component Name"/>
<text x="215" text="Status"/>
<text x="375" text="R/D Plan"/>
<text x="445" text="R/D Actual"/>
<text x="525" text="Test Plan"/>
<text x="605" text="QA Actual"/>
<text x="685" text="Doc Actual"/>
<text x="765" text="Engineer"/>
<text x="855" text="Tester"/>
</view>

<view datapath="mydata:/componentStatus" height="536" width="936" x="2" y="40" clip="true">

<view width="${parent.width-16}">
<row name="datarow" datapath="component">

</row>
<simplelayout axis="y"/>
</view>

<scrollbar axis="y"/>
<simplelayout axis="x"/>

</view>
</view>
</canvas>

antun
01-26-2004, 04:52 PM
The issue I am having is that when I click the delete button I am not getting any data in the "sendData" method.

You mean that things like:

componentName.getText()
componentStatus.getText()

... are not resolving to anything? If so, I don't see how they could - you would have to write:

open.componentName.getText()
open.componentStatus.getText()

... because both the componentName and componentStatus views are children of the "open" view.

Is that what you were asking, or did I completely misunderstand your question?

-Antun

joemcglynn
01-27-2004, 08:08 AM
You nailed it, thanks!

I had a mental block about name spaces and object references I guess.