When I drag and drop the file into IExplorer, I see the text "Multiply
this by 10:" and I see a text box that contains a value "4" (ie. the
bob element). I also see a button with "obtain results of search".
However, when I click the button I simply get a blank window.
So, I have two questions.
1) Does anyone see obvious errors in the XForms above?
2) Are there any clever ways of debugging XForms code such as this?
I see that you are using formsPlayer, and obviously this list is for
the Mozilla implementation! However, since I think your form would not
work in Firefox either, then I'm sure people won't mind if I throw out
some comments. (Particularly because you ask about debugging
techniques, and everything I suggest below will work in formsPlayer
and the Firefox XForms Extension.)
> So, I have two questions.
> 1) Does anyone see obvious errors in the XForms above?
My guess is that the problem is a lack of a method on your submission.
This means that the submission is failing, (xforms-submit-error) but
because you don't have a handler for xforms-submit-error, you see
nothing. And worse, because you are toggling the second xf:case
immediately after you do the submit, _regardless of the result of that
submission_, then you simply get a blank page (because there is no
data to show).
So try setting @method="post".
Note by the way that even if there was data coming back correctly, if
you had your XPath expressions wrong then you would still not see any
data., so I'll outline below a few techniques that might speed up
spotting this kind of problem.
> 2) Are there any clever ways of debugging XForms code such as this?
The first thing I would strongly recommend is to use tools that show
you your network traffic--in IE we use Fiddler, and in Firefox we use
Firebug, but there are lots of tools out there--and in a case like
this you'd see very quickly whether your request was correctly formed,
what the server sent back, or even whether the submission was made at
all. (I don't think a request would be made here.)
Note also that the way you have your form structured you are toggling
immediately after the submission starts, and the toggle is done
regardless of the success or failure of the request. I'd recommend a
more 'defensive' approach, which involves putting any toggles on the
submission events, and having additional cases for 'error' and 'in
With this set-up you can at least tell whether everything went well
with the server. If you get the 'success' case toggled in, but still
don't see your data, then the most likely scenario is that you have
your XPath wrong.
(I've also changed your trigger for a submit.)
The technique I've just shown is one we use a lot in our forms,
because it makes it much easier to control the user experience with
things like 'in progress' animations, and so on. See our Flickr and
Amazon samples for an illustration of this: