spoco2
08-07-2005, 06:50 PM
Hi fellow Laszlo developers,
Myself and a co-worker are building our first Laszlo application, and by and large are very impressed with it.
I, however have started running into some walls in regards to datapaths/pointers/nodes etc.
Here's what I'm trying to do:
* We have a canvas that objects are being dropped onto, once there they are dragged around and snapped to a grid etc, for visual layout purposes.
* Each of these objects is an instance of a class called 'VisualObject'
* Each of these VisualObject class instances has an associated attribute which is an instance of a DataObject.
* When a VisualObject is doubleclicked on, a popup window is present that allows the user to update/view/enter the data from the DataObject associated with the VisualObject. They then click on an 'Update' button and it should write the changes back to the db (or for this proof of concept, an XML file).
The Dataset is set in the class library as such:
<dataset name="dset" autorequest="true" type="http" src="../data/gh_data.xml"/>
And the Dataobjects just set their datapath to be a particular point in that dataset. When the popup window is called, it is passed the datapath from the DataObject and uses that to display its contents for editing.
Here are my issues that I hope you guys can help me with:
1. I can't get the DataObject to point at the exact record I want, only the container... I thought the syntax would be of the sort:
this.dp = "dset:/ghdata/campaign[@myName=this.myname]";
but that doesn't result in a valid datapointer
2. Assuming that 1 can be fixed... at present, with only one record in each category, the updateData only seems to work on a local copy. Any changes I make to the data are reflected on subsequent openings of the popupwindow during that session, but if I reload the application all data is back to square one. What am I doing wrong here?
Thanks in advance to anyone that has got this far and can help! :D
Let me know if any more info is required.
Regards,
Simon O'Connor
The XML format is:
<ghdata>
<campaign ID="1" myName="Campaign_1" CreateDate="01/01/2001" Creator="Me" Description="Here is the campaign description, go wild with it... go wild"
Budget="1234" ExpectedListsize="1000" ExpectedWashrate="0.15" ExpectedContactRate="0.3"
/>
<campaigngroup ID="2" myName="CampGroup_1" CreateDate="01/01/2001" Creator="You" Description="Here is the campaign description, go wild with it... go wild"
Budget="1234" StrategyName="Winback" ExpectedListsize="10000"
/>
</ghdata>
Myself and a co-worker are building our first Laszlo application, and by and large are very impressed with it.
I, however have started running into some walls in regards to datapaths/pointers/nodes etc.
Here's what I'm trying to do:
* We have a canvas that objects are being dropped onto, once there they are dragged around and snapped to a grid etc, for visual layout purposes.
* Each of these objects is an instance of a class called 'VisualObject'
* Each of these VisualObject class instances has an associated attribute which is an instance of a DataObject.
* When a VisualObject is doubleclicked on, a popup window is present that allows the user to update/view/enter the data from the DataObject associated with the VisualObject. They then click on an 'Update' button and it should write the changes back to the db (or for this proof of concept, an XML file).
The Dataset is set in the class library as such:
<dataset name="dset" autorequest="true" type="http" src="../data/gh_data.xml"/>
And the Dataobjects just set their datapath to be a particular point in that dataset. When the popup window is called, it is passed the datapath from the DataObject and uses that to display its contents for editing.
Here are my issues that I hope you guys can help me with:
1. I can't get the DataObject to point at the exact record I want, only the container... I thought the syntax would be of the sort:
this.dp = "dset:/ghdata/campaign[@myName=this.myname]";
but that doesn't result in a valid datapointer
2. Assuming that 1 can be fixed... at present, with only one record in each category, the updateData only seems to work on a local copy. Any changes I make to the data are reflected on subsequent openings of the popupwindow during that session, but if I reload the application all data is back to square one. What am I doing wrong here?
Thanks in advance to anyone that has got this far and can help! :D
Let me know if any more info is required.
Regards,
Simon O'Connor
The XML format is:
<ghdata>
<campaign ID="1" myName="Campaign_1" CreateDate="01/01/2001" Creator="Me" Description="Here is the campaign description, go wild with it... go wild"
Budget="1234" ExpectedListsize="1000" ExpectedWashrate="0.15" ExpectedContactRate="0.3"
/>
<campaigngroup ID="2" myName="CampGroup_1" CreateDate="01/01/2001" Creator="You" Description="Here is the campaign description, go wild with it... go wild"
Budget="1234" StrategyName="Winback" ExpectedListsize="10000"
/>
</ghdata>