This may be a newbie question, but I'm stuck and I need help.

I have a window with a button that triggers a dataset's doRequest  
method to fetch data from a remote server.

The returned data may come in two different formats:

<results success="true">
   <countries>
     <country id="1" code="US" />
   </countries>
</results>

or

<results success="false">
   <errors>
     <message code="404">Not Found</message>
   </errors>
</results>

So, in my window I have something like:

<view name="messages"
       datapath="[EMAIL PROTECTED] = 'false']/errors/"
       width="${parent.width}" height="${parent.height}">
   <text datapath="message/text()" resize="true" multiline="true" />
</view>

<grid name="countryGrid" sizetoheader="false"
       datapath="[EMAIL PROTECTED] = 'true']/countries/"
       width="${parent.width}" height="${parent.height}">

   <gridtext width="25" sortable="false" resizable="false"  
editable="false" datapath="position()">
     #
   </gridtext>
   <gridtext width="40" editable="false" datapath="@code">
     Code
   </gridtext>
</grid>

Basically, the idea is that depending on the parameters sent to the  
server, either the error message(s) will be displayed or the grid  
will be displayed. However, here is what's happening:

When I initially submit a request that returns valid data, the grid  
displays fine. I can even re-submit another request with different  
parameters to return data and the currently displayed grid is updated  
accordingly with the new returned data. However, if I submit invalid  
parameters that return the "error" messages, the grid remains  
displayed, the messages view is not displayed, and the application is  
stuck. I can't even type in the debugger or do anything in the  
application.

Now, here is another twist. If I initially submit a request that will  
return the error response, the messages view is displayed as  
expected. While the messages view is displayed and I submit a request  
that will return good data, the messages view is not shown and the  
grid is shown with the proper data. At this moment, I can re-submit  
the request to return more valid data and the displayed grid is  
updated accordingly. However, if I submit a request that will return  
the error response, the application freezes again, where I can't  
click on anything or type anything.

Did I miss something?

Just to be complete, on that same window I have a simple form that  
prompts the user for some parameters to include in the query string.  
The "submit" button simply checks if the user typed anything and  
updates the dataset's URL accordingly and then issues the doRequest  
method. Watching the back end server, I can see that the requests are  
being sent correctly and it's returning the proper XML documents.

Do I have to play with setVisible somewhere or do I need to reset the  
datapath's of the components in any way?

Help please!

Thanks,
Daniel
_______________________________________________
Laszlo-user mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-user

Reply via email to