kipsta
11-09-2004, 09:02 AM
I have a dataset attached to a servlet. This dataset is used as the datapath in a view, which contains a reference to a custom class. The odd thing is, if I don't execute the dataset (i.e., comment out the doRequest() line), it still creates an instance of the custom class. This then triggers the oninit() of the custom class and throws things in a funky state. I can tell the servlet isn't being called due to logging in my app server.
Oddly, if I change the dataset to hardcoded XML and remove the entries that should be looped over and displayed, the same thing happens.
Here's what I have that works correctly:
<dataset name="myDataset">
<engineListResponse>
<LastUpdate>1100018660288</LastUpdate>
<engineList>
<engine engineID="4193"/>
<engine engineID="4194"/>
</engineList>
</engineListResponse>
</dataset>
<view name="myView" bgcolor="blue" width="500" height="500" datapath="myDataset:/engineListResponse/engineList">
<engineClass name="myEngine" queryUserID="5" queryEngineID="$path{'@engineID'}" datapath="engine"/>
<wrappinglayout axis="x" xinset="10" yinset="10" spacing="10"/>
</view>
This all works fine... it displays only two instances of the engineClass object with the queryUserID and queryEngineID attributes set correctly. But, if I rip up the XML and only have:
<dataset name="myDataset">
<engineListResponse>
<LastUpdate>1100018660288</LastUpdate>
<engineList>
</engineList>
</engineListResponse>
</dataset>
I get one incorrectly intialized instance of the engineClass object. I would expect my view to be constructed and to have no instances of the engineClass object.
Have I constructed my view in an incorrect way?
Oddly, if I change the dataset to hardcoded XML and remove the entries that should be looped over and displayed, the same thing happens.
Here's what I have that works correctly:
<dataset name="myDataset">
<engineListResponse>
<LastUpdate>1100018660288</LastUpdate>
<engineList>
<engine engineID="4193"/>
<engine engineID="4194"/>
</engineList>
</engineListResponse>
</dataset>
<view name="myView" bgcolor="blue" width="500" height="500" datapath="myDataset:/engineListResponse/engineList">
<engineClass name="myEngine" queryUserID="5" queryEngineID="$path{'@engineID'}" datapath="engine"/>
<wrappinglayout axis="x" xinset="10" yinset="10" spacing="10"/>
</view>
This all works fine... it displays only two instances of the engineClass object with the queryUserID and queryEngineID attributes set correctly. But, if I rip up the XML and only have:
<dataset name="myDataset">
<engineListResponse>
<LastUpdate>1100018660288</LastUpdate>
<engineList>
</engineList>
</engineListResponse>
</dataset>
I get one incorrectly intialized instance of the engineClass object. I would expect my view to be constructed and to have no instances of the engineClass object.
Have I constructed my view in an incorrect way?