There is a compiler warning when the new list is set up in the method
_flistselect().
WARNING: null item value in _flistselect
"item" is supposed to be passed to the method. The only code that I can see
that references the method is a new LzDelegate declaration at the end of
_setupcblist method.
cblist.setAttribute('attach', this.listattach);
if (this._selectdel == null) {
this._selectdel = new LzDelegate( this,
"_flistselect" );
}
this._selectdel.register(cblist, 'onselect');
The _flistselectI() method is supposed to take "item" as a parameter.
<method name="_flistselect" args="item" >
I don't see the parameter being passed. "item" is coming up null inside
the _flistselect() method and I believe "item" is the thing that is supposed
to contain the text data you see in the dropdown. Does anyone know what is
supposed to be happening here? Why does the newly added node data not show
up in the dropdown?
-----Original Message-----
From: Tim Patsch [mailto:[EMAIL PROTECTED]
Sent: Friday, September 01, 2006 7:00 PM
To: Tim Patsch
Subject: RE: [Laszlo-user] Datacombobox reflect changes in underlying
dataset?
Here's a small sample app to demonstrate...
<canvas height="200" >
<!--Some names to go into a datacombobox-->
<dataset name="drivers">
<item value="Select">Select</item>
<item value="Driver 1">John</item>
<item value="Driver 2">Mary</item>
<item value="Driver 3">Mike</item>
<item value="Driver 4">Samantha</item>
</dataset>
<!--Pointers: outer used to add and inner used to delete-->
<datapointer name="driverpointerouter" xpath="drivers:/"/>
<datapointer name="driverpointerinner" />
<simplelayout spacing="20"/>
<!--Datacombobox pointing to drivers dataset-->
<datacombobox name="dc" itemdatapath="drivers:/item" />
<!--Click the button to modify the dataset and refresh the datacombobox-->
<button text="Modify">
<method event="onclick">
<![CDATA[
//Destroy nodes in drivers dataset
var end;
var driverCount =
driverpointerouter.getNodeCount();
for(var i=0; i<driverCount; i++) {
end = driverpointerouter.xpathQuery('*/last()');
driverpointerinner.setXPath('drivers:/*[' + end + ']');
//Debug.write("Driver " + i + ": " +
driverpointerinner.getNodeText());
driverpointerinner.deleteNode();
}
//Do a node count to make sure all were
destroyed (should be "0")
Debug.write("Driver count after delete: " +
driverpointerouter.getNodeCount());
//Repopulate the drivers dataset with different
names
driverpointerouter.addNode("Name 1");
driverpointerouter.addNode("Name 2");
driverpointerouter.addNode("Name 3");
driverpointerouter.addNode("Name 4");
//Do a node count to see if adding new data
went ok
Debug.write("Driver count after adding data
back: " +
driverpointerouter.getNodeCount());
//Refresh the datacombobox
dc.refresh();
//Debug.write("driver count:" +
driverpointerouter.getNodeCount());
]]>
</method>
</button>
</canvas>
-----Original Message-----
From: Tim Patsch [mailto:[EMAIL PROTECTED]
Sent: Friday, September 01, 2006 4:31 PM
To: [email protected]
Subject: [Laszlo-user] Datacombobox reflect changes in underlying dataset?
If I use addNode() and deleteNode()to modify a dataset, should a
datacombobox pointing at this dataset reflect my changes? It's not doing so
even if I call an explicit refresh() on the datacombobox. I've verified
that my dataset's structure has changed and that it contains new valid data.
Just can't get it to reflect properly in the control. The basedatacombobox
has the following refresh code:
<method name="refresh">
<![CDATA[
this._teardowncblist();
this._setupcblist();
]]></method>
Should this do the trick or do I need to do something else explicitly to
refresh the UI.
--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.405 / Virus Database: 268.11.7/435 - Release Date: 8/31/2006
_______________________________________________
Laszlo-user mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-user
--
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.405 / Virus Database: 268.11.7/435 - Release Date: 8/31/2006
--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.405 / Virus Database: 268.11.7/435 - Release Date: 8/31/2006
--
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.405 / Virus Database: 268.11.7/437 - Release Date: 9/4/2006
--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.405 / Virus Database: 268.11.7/437 - Release Date: 9/4/2006
_______________________________________________
Laszlo-user mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-user