This is Interesting: Free Magazines for Graphics designers and webmasters
Home > Archive > Mozilla XML > May 2005 > XForms disappointed beginner
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
XForms disappointed beginner
|
|
| Alex Meyers 2005-05-13, 7:33 pm |
| Got XForms working on Mozilla, took some time to convince IIS to serve it
correctly :)
Now I got a little test form, nothing really complicated, which I
constructed with XFormation editor
formsPlayer version
<?xml version="1.0" encoding="utf-8"?>
<html xmlns:fp="urn:formsplayer.com" xmlns="http://www.w3.org/1999/xhtml"
xmlns:xf="http://www.w3.org/2002/xforms"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<head>
<object width="0" height="0" id="FormsPlayer"
classid="CLSID:4D0ABA11-C5F0-4478-991A-375C4B648F58">
<b>FormsPlayer has failed to load! Please check your installation.</b>
</object>
<?import namespace="xf" implementation="#FormsPlayer"?>
<xf:model>
<xf:instance id="Data">
<Data>
<ReadOnly>1</ReadOnly><Required>2</Required><Relevant>3</Relevant><Calculate>4</Calculate><Constraint>5</Constraint>
</Data>
</xf:instance>
<xf:bind nodeset="/Data/*" type="xs:integer" id="DataInteger" />
<xf:bind id="ReadOnly" readonly="true()" nodeset="ReadOnly" />
<xf:bind id="Required" required="true()" nodeset="Required" />
<xf:submission id="SaveLocal" action="./savelocal.xml" method="put"
replace="none" ref="/" />
<xf:bind nodeset="Calculate" calculate="../ReadOnly * ../Required" />
</xf:model>
</head>
<body>
<p><xf:input ref="ReadOnly"><xf:label>ReadOnly</xf:label></xf:input></p>
<p><xf:input ref="Required"><xf:label>Required</xf:label></xf:input></p>
<p><xf:input ref="Relevant"><xf:label>Relevant</xf:label></xf:input></p>
<p><xf:output
ref="Calculate"><xf:label>Calculate</xf:label></xf:output></p>
<p><xf:input
ref="Constraint"><xf:label>Constraint</xf:label></xf:input></p>
<p><xf:submit
submission="SaveLocal"><xf:label>Save</xf:label></xf:submit></p>
</body>
</html>
for Mozilla drop the fp namespace, object and import
for Novell drop the fp namespave, object and replace import with
<?import namespace="xf" urn="http://www.w3.org/2002/xforms"
implementation="#default#nxforms"/>
tried it with Mozilla, IE with formsPlayer plugin and IE with Novell plugin,
each give a different behaviour
formsPlayer plays the example completely correctly, but my intention was to
make a relevant rule for the Relevant field if Required was greater than 5
and after half a day i gave up on that, no way to get it working
Novell only shows the save button and it works, but none of the fields is
displayed !!!
Mozilla shows fields but doesn't show any of the default values and any
values that you enter are not saved, but saving works with the initial
values !!!
is my form that bad ???
i was very excited when i started learing about XForms (XForms essentials by
Dubinko)
in theory everything seems great
but implementation seems long way off for something that became a standard
19 months ago !!!
i think it will probably go in the ijskast again, my chef will not tolerate
anymore time wasting :(
Alex
| |
| Aaron Reed 2005-05-16, 7:43 pm |
| Alex Meyers wrote:
> Got XForms working on Mozilla, took some time to convince IIS to serve it
> correctly :)
> Now I got a little test form, nothing really complicated, which I
> constructed with XFormation editor
>
> formsPlayer version
>
> <?xml version="1.0" encoding="utf-8"?>
> <html xmlns:fp="urn:formsplayer.com" xmlns="http://www.w3.org/1999/xhtml"
> xmlns:xf="http://www.w3.org/2002/xforms"
> xmlns:xs="http://www.w3.org/2001/XMLSchema">
> <head>
> <object width="0" height="0" id="FormsPlayer"
> classid="CLSID:4D0ABA11-C5F0-4478-991A-375C4B648F58">
> <b>FormsPlayer has failed to load! Please check your installation.</b>
> </object>
> <?import namespace="xf" implementation="#FormsPlayer"?>
> <xf:model>
> <xf:instance id="Data">
> <Data>
> <ReadOnly>1</ReadOnly><Required>2</Required><Relevant>3</Relevant><Calculate>4</Calculate><Constraint>5</Constraint>
> </Data>
> </xf:instance>
> <xf:bind nodeset="/Data/*" type="xs:integer" id="DataInteger" />
> <xf:bind id="ReadOnly" readonly="true()" nodeset="ReadOnly" />
> <xf:bind id="Required" required="true()" nodeset="Required" />
> <xf:submission id="SaveLocal" action="./savelocal.xml" method="put"
> replace="none" ref="/" />
> <xf:bind nodeset="Calculate" calculate="../ReadOnly * ../Required" />
> </xf:model>
> </head>
> <body>
> <p><xf:input ref="ReadOnly"><xf:label>ReadOnly</xf:label></xf:input></p>
> <p><xf:input ref="Required"><xf:label>Required</xf:label></xf:input></p>
> <p><xf:input ref="Relevant"><xf:label>Relevant</xf:label></xf:input></p>
> <p><xf:output
> ref="Calculate"><xf:label>Calculate</xf:label></xf:output></p>
> <p><xf:input
> ref="Constraint"><xf:label>Constraint</xf:label></xf:input></p>
> <p><xf:submit
> submission="SaveLocal"><xf:label>Save</xf:label></xf:submit></p>
> </body>
> </html>
>
> for Mozilla drop the fp namespace, object and import
> for Novell drop the fp namespave, object and replace import with
> <?import namespace="xf" urn="http://www.w3.org/2002/xforms"
> implementation="#default#nxforms"/>
>
> tried it with Mozilla, IE with formsPlayer plugin and IE with Novell plugin,
> each give a different behaviour
>
> formsPlayer plays the example completely correctly, but my intention was to
> make a relevant rule for the Relevant field if Required was greater than 5
> and after half a day i gave up on that, no way to get it working
>
> Novell only shows the save button and it works, but none of the fields is
> displayed !!!
>
> Mozilla shows fields but doesn't show any of the default values and any
> values that you enter are not saved, but saving works with the initial
> values !!!
>
> is my form that bad ???
> i was very excited when i started learing about XForms (XForms essentials by
> Dubinko)
> in theory everything seems great
> but implementation seems long way off for something that became a standard
> 19 months ago !!!
>
> i think it will probably go in the ijskast again, my chef will not tolerate
> anymore time wasting :(
>
> Alex
>
>
Hi Alex,
Its takes a little bit to get the hang of writing XForms. Did you try
running your form through an XForms validator? There is one at:
http://xformsinstitute.com/validator/ When I put your form through the
validator (the first step I always do when something isn't working the
way that I think that it should) I got some errors. Firstly, you need
to namespace qualify the instance. If you are using xpath expressions
to get to the instance without namespaces, then you need to put xmlns=""
on either the xf:instance node or on the root node of the instance
document (the first child node of the xf:instance). This is covered in
the XForms:Essentials book, but you may have missed it when you were
reading it. "The instance data XML itself is not defined in any
namespace, so the xmlns="" declaration is essential to turn off the
default XHTML namespace that would otherwise be in effect at this
point." When I did that to your form, I got the numbers to appear.
Then I changed the value of 'required' to 43, saw the value change in
the calculate when I tabbed out of the field and when I clicked on the
save button it saved fine to my local disc. When I changed the required
field to 'aa' I saw calc go to NaN and save was NOT successful because
the required field did not contain a valid integer.
I got what you need to make relevant do what you want it to do, too.
Use this bind: <xf:bind id="Relevant" relevant="../Required > 5"
nodeset="Relevant" />. Of course, to make it hide under Mozilla you'll
have to style it. We don't support pseudo classes quite yet, so you'd
have to use the temporary attribute that we set on it. So the style
would look like this: xf|*[disabled] {display: none; }. For Novell's
plugin or formsPlayer, that should look like: xf|*:disabled {display:
none; }, I believe.
I hope that this helps,
--Aaron
| |
| Alex Meyers 2005-05-17, 7:40 pm |
| Aaron Reed wrote:
>
> Hi Alex,
>
> Its takes a little bit to get the hang of writing XForms. Did you try
> running your form through an XForms validator? There is one at:
> http://xformsinstitute.com/validator/ When I put your form through the
> validator (the first step I always do when something isn't working the
> way that I think that it should) I got some errors. Firstly, you need
> to namespace qualify the instance. If you are using xpath expressions
> to get to the instance without namespaces, then you need to put xmlns=""
> on either the xf:instance node or on the root node of the instance
> document (the first child node of the xf:instance). This is covered in
> the XForms:Essentials book, but you may have missed it when you were
> reading it. "The instance data XML itself is not defined in any
> namespace, so the xmlns="" declaration is essential to turn off the
> default XHTML namespace that would otherwise be in effect at this
> point." When I did that to your form, I got the numbers to appear.
>
> Then I changed the value of 'required' to 43, saw the value change in
> the calculate when I tabbed out of the field and when I clicked on the
> save button it saved fine to my local disc. When I changed the required
> field to 'aa' I saw calc go to NaN and save was NOT successful because
> the required field did not contain a valid integer.
>
> I got what you need to make relevant do what you want it to do, too. Use
> this bind: <xf:bind id="Relevant" relevant="../Required > 5"
> nodeset="Relevant" />. Of course, to make it hide under Mozilla you'll
> have to style it. We don't support pseudo classes quite yet, so you'd
> have to use the temporary attribute that we set on it. So the style
> would look like this: xf|*[disabled] {display: none; }. For Novell's
> plugin or formsPlayer, that should look like: xf|*:disabled {display:
> none; }, I believe.
>
> I hope that this helps,
> --Aaron
Hi Aaron,
the namespace adaption works, thank you very much
the styling however I can not get to work
<style type="text/css">
xf|*[disabled] {display: none;}
</style>
Alex
| |
| Allan Beaufour 2005-05-17, 7:40 pm |
| On Tuesday 17 May 2005 13:46, Alex Meyers wrote:
> the namespace adaption works, thank you very much
> the styling however I can not get to work
>
> <style type="text/css">
> xf|*[disabled] {display: none;}
> </style>
If that's the full style example, then you're lacking a:
@namespace xf url("http://www.w3.org/2002/xforms");
--
Allan Beaufour
Novell Denmark
Novell, Inc., the leading provider of Net Business Solutions.
www.novell.com
| |
| Alex Meyers 2005-05-17, 7:40 pm |
| Allan Beaufour wrote:
> On Tuesday 17 May 2005 13:46, Alex Meyers wrote:
>
>
>
> If that's the full style example, then you're lacking a:
> @namespace xf url("http://www.w3.org/2002/xforms");
>
Thanks, that solved it
so for Mozilla I need
<style type="text/css">
@namespace xf url("http://www.w3.org/2002/xforms");
xf|*[disabled] {display: none;}
</style>
for formsPlayer I need
<style type="text/css">
.disabled { display:none; }
</style>
hardly standard, is it :)
i need to know a lot about the client to get my XForm to display and
work proparly
Alex
| |
| Anne van Kesteren 2005-05-17, 7:40 pm |
| Alex Meyers wrote:
> hardly standard, is it :)
> i need to know a lot about the client to get my XForm to display and
> work proparly
And for the W3C you need :disabled{ display:none }.
--
Anne van Kesteren
<http://annevankesteren.nl/>
|
|
|
| | Copyright 2003 - 2008 forum4designers.com Software forum Computer Hardware reviews |
|