initial bind and xforms-ready event

10 views
Skip to first unread message

Chris

unread,
Apr 23, 2009, 6:20:56 PM4/23/09
to Ubiquity XForms Developers
I don't know if this is a bug I should register or if I'm just not
doing things right.

I have a bind tag which does a calculation, it is within my model. I
also have an action tag on event xforms-ready in my model. Neither of
those fire off reliably when I first load my doc.

If I submit my doc then do a back-button they do fire.

I am using my local copy of the source, being served by Apache. I
don't think there is any web caching going on, but I could be wrong.
My browser is IE 7.0.5730.11



Bryan Kyle

unread,
Apr 27, 2009, 12:26:26 PM4/27/09
to ubiquit...@googlegroups.com
Hi,

Would you be able to post a snippet of your form here?  I think that would give us a better idea of what's going on.

Thanks

Chris

unread,
Apr 29, 2009, 11:34:35 AM4/29/09
to Ubiquity XForms Developers
Here it is. I reference my own server for the ubiquity library and
for a script that prints out the submitted XML. The instance is
a hacked up version of an example I found on the web.
Sorry I don't remember where I got it but somebody else out there
deserves the credit for that.

In my environment when I run this thing it loads up Ubiquity then
sits there. I hit the submit button and then do a "back" and
it loads Ubiquity again and shows "Ok". The first time it should
have said "Ok" also but didn't. The second time I submit I see that
the position() function binds have done their thing. So all of the
binds only work on the second time around. I think there must
be some missing event on the initial load.

This example doesn't have the explicit action tag on xforms-ready
event. I can work up an example for that if needed.


<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:xf="http://www.w3.org/2002/xforms"
xmlns:ev="http://www.w3.org/2001/xml-events">
<head>
<title> An XForms Example</title>
<script src="http://flash.yipyap.com/ubiquity-xforms-read-only/src/
ubiquity-loader.js" type="text/javascript">/**/</script>
</head>
<body>
<xf:model>
<xf:instance>
<Data xmlns="">
<currentLot/>
<currentItem/>
<Lot code="">
<Item code=""/>
<Item code=""/>
</Lot>
<Lot code="">
<Item code=""/>
<Item code=""/>
</Lot>
<Lot code="">
<Item code=""/>
<Item code=""/>
</Lot>
</Data>
</xf:instance>

<xf:bind nodeset="/Data/currentLot" calculate="string('OK!')"/
>
<xf:bind nodeset="/Data/Lot/@code" calculate="position()"/>
<xf:bind nodeset="Lot[@code]/Item/@code" calculate="position
()"/>

<xf:submission action="http://flash.yipyap.com/cgi-bin/list2"
method="post" id="sendStuff" includenamespaceprefixes=""/>
</xf:model>

<hr />
<xf:output ref="/Data/currentLot"><xf:label>currentLot</xf:label></
xf:output>
<hr />
<xf:submit submission="sendStuff"><xf:label>Echo</xf:label></
xf:submit>
<hr />
done
</body>
</html>

Bryan Kyle

unread,
May 1, 2009, 5:35:48 PM5/1/09
to ubiquit...@googlegroups.com

I've had a look at your form and I don't see anything that would cause what you are seeing.  I've pasted a copy of your form with my modifications at the end of this message, you might want to try running that against the copy of ubiquity-xforms you have installed as well as against the latest from trunk.

If you still see the problem you might want to consider creating a new issue and attaching your entire form.

      xmlns:ev="http://www.w3.org/2001/xml-events">
  <head>
<title> An XForms Example</title>
<script src="file:///d:/src/ubiquity/trunk/src/ubiquity-loader.js" type="text/javascript">/**/</script>
  </head>
  <body>
<xf:model>
      <xf:instance>
        <Data xmlns="">
          <currentLot/>
          <currentItem/>
          <Lot code="">
            <Item code=""/>
            <Item code=""/>
          </Lot>
          <Lot code="">
            <Item code=""/>
            <Item code=""/>
          </Lot>
          <Lot code="">
            <Item code=""/>
            <Item code=""/>
          </Lot>
        </Data>
      </xf:instance>
 
      <xf:bind nodeset="/Data/currentLot" calculate="string('OK!')"/>
      <xf:bind nodeset="/Data/Lot/@code" calculate="position()"/>
      <xf:bind nodeset="Lot[@code]/Item/@code" calculate="position()"/>

 <xf:action ev:event="xforms-ready">
<xf:setvalue ref="/Data/currentLot" value="'Hello!'"></xf:setvalue>
 </xf:action>

      <xf:submission action="http://flash.yipyap.com/cgi-bin/list2" method="post"  id="sendStuff" includenamespaceprefixes=""/>
</xf:model>
<hr />
<xf:output ref="/Data/currentLot"><xf:label>currentLot</xf:label></xf:output>
<hr />
<xf:submit submission="sendStuff"><xf:label>Echo</xf:label></xf:submit>
<hr />
done
  </body>
</html>

Chris

unread,
May 7, 2009, 4:16:45 PM5/7/09
to Ubiquity XForms Developers

Thanks for looking at it. I have tried your code and it has the same
behavior. I just brought down the most recent trunk and it
still has the same behavior.

I'll see if I can figure out how to create an issue.

Thanks
Chris
Reply all
Reply to author
Forward
0 new messages