Login  Register

Re: Re: Re: Is there a simple way to check if all components in an <fr:section> are relevant

Posted by Ramon de Beijer-2 on Mar 09, 2011; 1:00pm
URL: https://discuss.orbeon.com/Form-runner-in-a-seperate-deployment-architecture-tp3339244p3343525.html

Hi Binesh,

It seems that the construction you mention here works when i use xforms:group instead of fr:section
anyone who knows why?

regards Ramon

On 03/09/2011 09:57 AM, Binesh Gummadi wrote:
Ramon,

I have a similar situation and I solved it with fr:error-summary control. Each section of your xform should have this control and populate the error count to your section instance which could be used in relevancy for the next section.

Here is what you should do.
  1. Add a new node to instance('fr-form-instance')/section_personal and instance('fr-form-instance')/section_extra. Lets say error_count.
  2. Add error-summary control above each section and hide it from user. observer points the id of your section and errors-count-ref points respective node.
    1. <span style="display:none">
      <fr:error-summary observer="section_personal-section" errors-count-ref="instance('fr-form-instance')/section_personal/ error_count" />


      </span>
    2. <span style="display:none">
      <fr:error-summary observer="section_extra-section" errors-count-ref="instance('fr-form-instance')/section_extra/error_count" />


      </span>
  3. Change the binding of section_extra.
    1. <xforms:bind id="section_extra-bind" nodeset="section_extra" name="section_extra" relevant="instance('fr-form-instance')/section_personal/error_count = 0">
I have limited experience with form builder. I am not sure if adding nodes by hand will cause any issue. I will have Eric comment on that.


Binesh Gummadi
Senior Software Engineer
rivetlogic
Voice +1.703.879.5740
Skype binesh.gummadi_rivetlogic
GTalk [hidden email]
Calendar binesh gummadi's calendar



On Wed, Mar 9, 2011 at 2:45 AM, Ramon de Beijer <[hidden email]> wrote:
Hi Erik,

Its party answer to my question, but as you already assumed its not the complete answer for me.
I have attached an example form i made with Form Builder, which has 2 sections 'section_personal' and 'section_extra'

i want 'section_extra' only to become visible if all fields in 'section_personal' are valid,

so i mean filled in and filled in correctly, so fields like 'first name' and 'last name' are mandatory and the field 'servicenumber'
is not only mandatory but should also match the 11-test (a test used in the Netherlands to check Citizen Service Number for taxes and that kinda things)

And only then i want to show the 'section_extra'. Can that be done in a simple way?
Perhaps u could fill in the way you would do it for this very example

regards Ramon




On 03/09/2011 06:11 AM, Erik Bruchez wrote:
Ramon,

If you want every field of section 1 non-empty, you could use an expression like this for the visibility of section 2:

not(exists(/*/section-1/*[not(normalize-space())]))

assuming "section-1" is the id of the first section.

Now in your question you mention relevance, which is not the same as "filled in", so I don't know if I answered on topic.

-Erik

On Tue, Mar 8, 2011 at 4:43 AM, Ramon de Beijer <[hidden email]> wrote:
Is there a simple way to check if all components in an <fr:section> are relevant

the case is I want section 2 only to become visible if section 1 is totally filled in.


Regards Ramon


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws





--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws





--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws