History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: LPP-4844
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: P1 P1
Assignee: Unassigned
Reporter: Robert Yeager
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
OpenLaszlo

ondata event not triggered when dataset loads v4.0.5 SWF

Created: 05/Oct/07 01:33 PM   Updated: 08/Nov/07 03:38 PM
Component/s: LFC - Data
Affects Version/s: 4.0.5WaffleCone
Fix Version/s: Cranberry

Time Tracking:
Not Specified

Severity: Critical
Fixed in Change#: 6,855
Runtime: N/A
Fix in hand: False


 Description  « Hide
I have a dataset on the canvas that reads from an XML file. The ondata event is not being triggered when the data is loaded w/ 4.0.5 SWF. The code worked fine in all v3.x versions.

    <dataset name="dsStoryboardScenes" type="http">
     <handler name="ondata">
     // ondata not firing w/ OL 4.0.5 SWF
canvas.setAttribute("sceneCount", dsStoryboardScenes.getPointer().xpathQuery("/dataset/scene/last()"));
     </handler>
    </dataset>

The dataset's src attribute and a doRequest() call is performed in script within the app's oninit handler.

 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Henry Minsky - 05/Oct/07 01:56 PM
Hmm, you will need this workaround right now

   <dataset name="myds" type="http" datafromchild="true">
       <handler name="ondata">
               // ondata not firing w/ OL 4.0.5 SWF
               Debug.write("ondata fired", this);
       </handler>
   </dataset>

"datafromchild" attribute says that if there is literal data, it is contained within a child <data> node (new syntax for 4.0). It also
tells the compiler that the body of the <dataset> is not literal data.

We need to fix the compiler to obey the 3.x semantics, which was that if the dataset type was http, the body
of the dataset was treated like view content instead of literal data.


Henry Minsky - 11/Oct/07 09:45 AM
test case:

<canvas width="100%" height="80%" debug="true">
  <debug fontsize="12"/>
   <dataset name="myds" type="http" >
       <handler name="ondata">
         // ondata not firing w/ OL 4.0.5 SWF
         Debug.write("ondata fired", this);
       </handler>
   </dataset>
   

   <view id="myview">
     <handler name="oninit">
       Debug.write("oninit handler for ",this);
       myds.setSrc("foo.xml");
       myds.doRequest();
     </handler>
   </view>

<dataset name="myliteral">
  <foo>bar</foo>
  <method name="baz">
    This is actually supposed to be interpreted as raw XML data, not a method
 </method>
</dataset>

</canvas>


make sure 'ondata fired' prints in the debugger
and no compiler warning is generated


Henry Minsky - 17/Oct/07 11:38 AM
------------------------------------------------------------------------
r6855 | hqm | 2007-10-15 22:36:23 -0400 (Mon, 15 Oct 2007) | 42 lines
Changed paths:
   M /openlaszlo/trunk/WEB-INF/lps/lfc/data/LzHTTPDataProvider.lzs
   M /openlaszlo/trunk/WEB-INF/lps/lfc/kernel/dhtml/LzHTTPLoader.js
   M /openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf/LzHTTPLoader.as
   M /openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf/LzLoader.lzs
   M /openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/compiler/NodeModel.java

Change 20071015-hqm-2 by hqm@IBM-2E06404CB67 on 2007-10-15 16:39:47 EDT
    in /cygdrive/c/users/hqm/openlaszlo/trunk
    for http://svn.openlaszlo.org/openlaszlo/trunk

Summary: fix dataset timeout event callback

New Features:

Bugs Fixed: LPP-4881

Technical Reviewer: andre
QA Reviewer: pkang
Doc Reviewer:

Documentation:

Release Notes:

Details:

The code in LzHttpDataProvider which dispatched on the datarequest
status type was
always calling loadResponse, which always set the requests status to
error if data was null.

Modified the code in LzHttpDataProcider.loadTimeout to just directly
call the onstatus event
iinstead of calling loadResponse.


DHTML timeout checking code rewritten by andre to be more efficient


 
Tests:

test/lfc/data/alldata.lzx
amazon app
calendar app
smokecheck



Henry Minsky - 28/Oct/07 06:32 PM
Merged into wafflecone
Committed revision 7037.

Mamye Kratt - 08/Nov/07 03:38 PM
(wafflecone branch r7137 - Cranberry RC)
Ran testfile from my-app (need to create foo.xml in my-apps). Also ran alldata.lzx earlier this week on r7102 - Cranberry RC.