problem with submission and relevant attribute

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

problem with submission and relevant attribute

xform-mozilla
Hi all
i'm new to xforms and help would be very appreciated.
I have a xform in which i use relevant to hide some items and i only
want to hide them according to some values (i still want them to be
stored when saving because otherwise the load fails)
Apparently if we save with this command (relevant=false), it should
ignore relevant or not and as a consequence everything?

<xf:submission id="save-to-local-file"   resource="file:data.xml"
ref="instance('save-plantSystem-instance')"    method="put"
relevant="false" replace="instance"  ><xf:message ev:event="xforms-
submit"
level="modal">Submitting...</xf:message>
       <xf:message ev:event="xforms-submit-done"
level="modal">Submission complete</xf:message>


                <xf:message ev:event="xforms-submit-error"
level="modal">Error > can-t submit the form</xf:message>
                </xf:submission>

However when i save to local, it applys the relevant rules... so i
don't know what is wrong...
If i save this instance and try to reload it fails with a warning
message (could not send data to the network)
Thanks for helping and let me know if more information is needed
Lana
PS: one  constraint is to save the file locally
_______________________________________________
dev-tech-xforms mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xforms
Reply | Threaded
Open this post in threaded view
|

Re: problem with submission and relevant attribute

Aaron Reed
As it states here: http://www.w3.org/TR/xforms11/#submit-evt-submit,
non-relevant instance nodes are pruned prior to submission.  You could
have UI specific instance data in another instance document in the same
model and use THAT data to control visibility of controls.  So this UI
specific data would be relevant or irrelevant but pull their values from
the main instance data.

You could also use switch/case to achieve hidden controls or, of course,
use normal xhtml+CSS to do it.

--Aaron

xform-mozilla wrote:

> Hi all
> i'm new to xforms and help would be very appreciated.
> I have a xform in which i use relevant to hide some items and i only
> want to hide them according to some values (i still want them to be
> stored when saving because otherwise the load fails)
> Apparently if we save with this command (relevant=false), it should
> ignore relevant or not and as a consequence everything?
>
> <xf:submission id="save-to-local-file"   resource="file:data.xml"
> ref="instance('save-plantSystem-instance')"    method="put"
> relevant="false" replace="instance"><xf:message ev:event="xforms-
> submit"
> level="modal">Submitting...</xf:message>
>         <xf:message ev:event="xforms-submit-done"
> level="modal">Submission complete</xf:message>
>
>
>                  <xf:message ev:event="xforms-submit-error"
> level="modal">Error>  can-t submit the form</xf:message>
>                  </xf:submission>
>
> However when i save to local, it applys the relevant rules... so i
> don't know what is wrong...
> If i save this instance and try to reload it fails with a warning
> message (could not send data to the network)
> Thanks for helping and let me know if more information is needed
> Lana
> PS: one  constraint is to save the file locally

_______________________________________________
dev-tech-xforms mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xforms
Reply | Threaded
Open this post in threaded view
|

Re: problem with submission and relevant attribute

xform-mozilla
Hi Aaron
thanks. I thought relevant attribute in submission would solve my
problem as it si shown here:
http://www.w3.org/TR/xforms11/#submit-put
They said that it should not do relevance pruning
Otherwise can you give an example which illsutrates your suggestion
about two instances. i'm not sure i understand you.
Thanks
Lana
On 11 jan, 20:20, Aaron Reed <[hidden email]> wrote:

> As it states here:http://www.w3.org/TR/xforms11/#submit-evt-submit,
> non-relevant instance nodes are pruned prior to submission.  You could
> have UI specific instance data in another instance document in the same
> model and use THAT data to control visibility of controls.  So this UI
> specific data would be relevant or irrelevant but pull their values from
> the main instance data.
>
> You could also use switch/case to achieve hidden controls or, of course,
> use normal xhtml+CSS to do it.
>
> --Aaron
>
> xform-mozilla wrote:
> > Hi all
> > i'm new to xforms and help would be very appreciated.
> > I have a xform in which i use relevant to hide some items and i only
> > want to hide them according to some values (i still want them to be
> > stored when saving because otherwise the load fails)
> > Apparently if we save with this command (relevant=false), it should
> > ignore relevant or not and as a consequence everything?
>
> > <xf:submission id="save-to-local-file"   resource="file:data.xml"
> > ref="instance('save-plantSystem-instance')"    method="put"
> > relevant="false" replace="instance"><xf:message ev:event="xforms-
> > submit"
> > level="modal">Submitting...</xf:message>
> >         <xf:message ev:event="xforms-submit-done"
> > level="modal">Submission complete</xf:message>
>
> >                  <xf:message ev:event="xforms-submit-error"
> > level="modal">Error>  can-t submit the form</xf:message>
> >                  </xf:submission>
>
> > However when i save to local, it applys the relevant rules... so i
> > don't know what is wrong...
> > If i save this instance and try to reload it fails with a warning
> > message (could not send data to the network)
> > Thanks for helping and let me know if more information is needed
> > Lana
> > PS: one  constraint is to save the file locally

_______________________________________________
dev-tech-xforms mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xforms
Reply | Threaded
Open this post in threaded view
|

Re: problem with submission and relevant attribute

Aaron Reed
Ah, I see that now.  I didn't notice that you were relying on the
@relevant on xf:submission.  Looking through our code, it looks like we
implemented @validate, but not @relevant.  If you could, please open a
bug on us and attach a testcase that demonstrates the problem.

Thanks,
--Aaron

xform-mozilla wrote:

> Hi Aaron
> thanks. I thought relevant attribute in submission would solve my
> problem as it si shown here:
> http://www.w3.org/TR/xforms11/#submit-put
> They said that it should not do relevance pruning
> Otherwise can you give an example which illsutrates your suggestion
> about two instances. i'm not sure i understand you.
> Thanks
> Lana
> On 11 jan, 20:20, Aaron Reed<[hidden email]>  wrote:
>> As it states here:http://www.w3.org/TR/xforms11/#submit-evt-submit,
>> non-relevant instance nodes are pruned prior to submission.  You could
>> have UI specific instance data in another instance document in the same
>> model and use THAT data to control visibility of controls.  So this UI
>> specific data would be relevant or irrelevant but pull their values from
>> the main instance data.
>>
>> You could also use switch/case to achieve hidden controls or, of course,
>> use normal xhtml+CSS to do it.
>>
>> --Aaron
>>
>> xform-mozilla wrote:
>>> Hi all
>>> i'm new to xforms and help would be very appreciated.
>>> I have a xform in which i use relevant to hide some items and i only
>>> want to hide them according to some values (i still want them to be
>>> stored when saving because otherwise the load fails)
>>> Apparently if we save with this command (relevant=false), it should
>>> ignore relevant or not and as a consequence everything?
>>
>>> <xf:submission id="save-to-local-file"   resource="file:data.xml"
>>> ref="instance('save-plantSystem-instance')"    method="put"
>>> relevant="false" replace="instance"><xf:message ev:event="xforms-
>>> submit"
>>> level="modal">Submitting...</xf:message>
>>>          <xf:message ev:event="xforms-submit-done"
>>> level="modal">Submission complete</xf:message>
>>
>>>                   <xf:message ev:event="xforms-submit-error"
>>> level="modal">Error>    can-t submit the form</xf:message>
>>>                   </xf:submission>
>>
>>> However when i save to local, it applys the relevant rules... so i
>>> don't know what is wrong...
>>> If i save this instance and try to reload it fails with a warning
>>> message (could not send data to the network)
>>> Thanks for helping and let me know if more information is needed
>>> Lana
>>> PS: one  constraint is to save the file locally
>

_______________________________________________
dev-tech-xforms mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xforms