Error-Summary fr:accordion

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

Error-Summary fr:accordion

bsteuhl
Is there anyway to have the accordion case open if it is closed where a control is located with an error when the user selects the link in the error-summary?  Currently if you select the link nothing happens if the accordion case is closed.  In the switch case I was able to have code that would take them to the correct case and the control.  But in the xbl component how would this be done?

Thanks.
Reply | Threaded
Open this post in threaded view
|

Re: Error-Summary fr:accordion

Alessandro  Vernet
Administrator
Brian,

How to you handle this when the controls are in a number of <xforms:case>?

Alex

On Wed, Oct 27, 2010 at 5:10 PM, bsteuhl <[hidden email]> wrote:

>
> Is there anyway to have the accordion case open if it is closed where a
> control is located with an error when the user selects the link in the
> error-summary?  Currently if you select the link nothing happens if the
> accordion case is closed.  In the switch case I was able to have code that
> would take them to the correct case and the control.  But in the xbl
> component how would this be done?
>
> Thanks.
> --
> View this message in context: http://orbeon-forms-ops-users.24843.n4.nabble.com/Error-Summary-fr-accordion-tp3016416p3016416.html
> Sent from the Orbeon Forms (ops-users) mailing list archive at Nabble.com.
>
>
> --
> 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
>
>


--
Orbeon Forms - Web forms, open-source, for the Enterprise -
http://www.orbeon.com/
My Twitter: http://twitter.com/avernet


--
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
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Re: Error-Summary fr:accordion

bsteuhl
I have a dialog that opens up and the id includes the path to the case and I take the substring after the - which provides me with the case and then I toggle there and setfocu to control.  See below.

<xxforms:dialog id="errorsDialog" level="modeless" appearance="full" close="true" draggable="true" visible="false">
                <xforms:group>
                                    <xforms:group ref="instance('errors-instance')">
                                      <xforms:group ref=".[error]">
                                          <xhtml:table class="errors-table">
                                              <xhtml:tr>
                                                  <xhtml:th colspan="3" class="error-title">
                                                     <xforms:output value="concat('Your Form Has ', count(error), ' ', if (count(error) &gt; 1) then 'Items That Require Attention' else 'Item That Requires Attention')"/>
                                                  </xhtml:th>
                                              </xhtml:tr>
                                              <xhtml:tr>
                                                    <xhtml:th style="text-align:center">Location</xhtml:th>
                                                    <xhtml:th style="text-align:center">Message</xhtml:th>
                                                    <xhtml:th style="text-align:center">Row</xhtml:th>
                                              </xhtml:tr>
                                              <xforms:repeat nodeset="error" id="errors-repeat">
                                                  <xhtml:tr>
                                                      <xhtml:th>
                                                          <xforms:trigger class="triggerErrorLoc">
                                                              <xforms:label><xforms:output value="substring-after(@id, '-')"/></xforms:label>
                                                              <xforms:action ev:event="DOMActivate">
                                                                  <xforms:toggle case="{substring-after(@id, '-')}"/>
                                                                  <xforms:setfocus control="{@id}"/>
                                                              </xforms:action>
                                                          </xforms:trigger>
                                                      </xhtml:th>
                                                      <xhtml:td>
                                                          <xforms:output value="@alert"/>
                                                      </xhtml:td>
                                                       <xhtml:td>
                                                          <i>
                                                              <xforms:output value="if (string-length(@indexes) > 0) then concat('(Row ', @indexes, ')') else ''"/>
                                                          </i>
                                                      </xhtml:td>
                                                  </xhtml:tr>
                                              </xforms:repeat>
                                          </xhtml:table>
                                      </xforms:group>
                                      <xforms:group ref=".[not(error)]">
                                          <xhtml:table class="no-errors-table">
                                              <xhtml:tr>
                                                  <xhtml:th colspan="3" class="no-error-title">
                                                      Your Form Does Not Have Any Errors/Omissions
                                                  </xhtml:th>
                                              </xhtml:tr>
                                          </xhtml:table>
                                      </xforms:group>
                                  </xforms:group>
                                </xforms:group>
                </xxforms:dialog>
 

Brian Steuhl
website: http://BTMSoftwareSolutions.com
business email: [hidden email]
cell: 908-421-0742

home office: 732-961-3187
RSS Feed To My Blog:

Business Process Modeling - BTMSoftwareSolutions.com




From: Alessandro Vernet <[hidden email]>
To: [hidden email]
Sent: Thu, October 28, 2010 11:31:04 AM
Subject: [ops-users] Re: Error-Summary fr:accordion

Brian,

How to you handle this when the controls are in a number of <xforms:case>?

Alex

On Wed, Oct 27, 2010 at 5:10 PM, bsteuhl <[hidden email]> wrote:

>
> Is there anyway to have the accordion case open if it is closed where a
> control is located with an error when the user selects the link in the
> error-summary?  Currently if you select the link nothing happens if the
> accordion case is closed.  In the switch case I was able to have code that
> would take them to the correct case and the control.  But in the xbl
> component how would this be done?
>
> Thanks.
> --
> View this message in context: http://orbeon-forms-ops-users.24843.n4.nabble.com/Error-Summary-fr-accordion-tp3016416p3016416.html
> Sent from the Orbeon Forms (ops-users) mailing list archive at Nabble.com.
>
>
> --
> 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
>
>



--
Orbeon Forms - Web forms, open-source, for the Enterprise -
http://www.orbeon.com/
My Twitter: http://twitter.com/avernet



--
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
Reply | Threaded
Open this post in threaded view
|

Re: Re: Re: Error-Summary fr:accordion

Alessandro  Vernet
Administrator
Brian,

I don't quite get your code: I assume you're using your own error
summary, which is similar to <fr:error-summary> (first link below).
But when you have an <xforms:switch> instead of an <fr:accordion> I am
not sure how you get the case id to be someone part of the id of the
invalid control, so you can then toggle to that case. Maybe you have a
naming convention for your ids? If that is the case, then you should
be able to do the same in the case of an accordion, just dispatching
the fr-toggle event instead of using <xforms:toggle> (see second link
below).

http://wiki.orbeon.com/forms/doc/developer-guide/xbl-components/error-summary-component
http://wiki.orbeon.com/forms/doc/developer-guide/xbl-components#TOC-Accordion-menu

Alex

On Thu, Oct 28, 2010 at 8:51 AM, Brian Steuhl <[hidden email]> wrote:

>
> I have a dialog that opens up and the id includes the path to the case and I take the substring after the - which provides me with the case and then I toggle there and setfocu to control.  See below.
>
> <xxforms:dialog id="errorsDialog" level="modeless" appearance="full" close="true" draggable="true" visible="false">
>                 <xforms:group>
>                                     <xforms:group ref="instance('errors-instance')">
>                                       <xforms:group ref=".[error]">
>                                           <xhtml:table class="errors-table">
>                                               <xhtml:tr>
>                                                   <xhtml:th colspan="3" class="error-title">
>                                                      <xforms:output value="concat('Your Form Has ', count(error), ' ', if (count(error) &gt; 1) then 'Items That Require Attention' else 'Item That Requires Attention')"/>
>                                                   </xhtml:th>
>                                               </xhtml:tr>
>                                               <xhtml:tr>
>                                                     <xhtml:th style="text-align:center">Location</xhtml:th>
>                                                     <xhtml:th style="text-align:center">Message</xhtml:th>
>                                                     <xhtml:th style="text-align:center">Row</xhtml:th>
>                                               </xhtml:tr>
>                                               <xforms:repeat nodeset="error" id="errors-repeat">
>                                                   <xhtml:tr>
>                                                       <xhtml:th>
>                                                           <xforms:trigger class="triggerErrorLoc">
>                                                               <xforms:label><xforms:output value="substring-after(@id, '-')"/></xforms:label>
>                                                               <xforms:action ev:event="DOMActivate">
>                                                                   <xforms:toggle case="{substring-after(@id, '-')}"/>
>                                                                   <xforms:setfocus control="{@id}"/>
>                                                               </xforms:action>
>                                                           </xforms:trigger>
>                                                       </xhtml:th>
>                                                       <xhtml:td>
>                                                           <xforms:output value="@alert"/>
>                                                       </xhtml:td>
>                                                        <xhtml:td>
>                                                           <i>
>                                                               <xforms:output value="if (string-length(@indexes) > 0) then concat('(Row ', @indexes, ')') else ''"/>
>                                                           </i>
>                                                       </xhtml:td>
>                                                   </xhtml:tr>
>                                               </xforms:repeat>
>                                           </xhtml:table>
>                                       </xforms:group>
>                                       <xforms:group ref=".[not(error)]">
>                                           <xhtml:table class="no-errors-table">
>                                               <xhtml:tr>
>                                                   <xhtml:th colspan="3" class="no-error-title">
>                                                       Your Form Does Not Have Any Errors/Omissions
>                                                   </xhtml:th>
>                                               </xhtml:tr>
>                                           </xhtml:table>
>                                       </xforms:group>
>                                   </xforms:group>
>                                 </xforms:group>
>                 </xxforms:dialog>
>
>
> Brian Steuhl
> website: http://BTMSoftwareSolutions.com
> business email: [hidden email]
> cell: 908-421-0742
>
> home office: 732-961-3187
> RSS Feed To My Blog:
>
>
>
> ________________________________
> From: Alessandro Vernet <[hidden email]>
> To: [hidden email]
> Sent: Thu, October 28, 2010 11:31:04 AM
> Subject: [ops-users] Re: Error-Summary fr:accordion
>
> Brian,
>
> How to you handle this when the controls are in a number of <xforms:case>?
>
> Alex
>
> On Wed, Oct 27, 2010 at 5:10 PM, bsteuhl <[hidden email]> wrote:
> >
> > Is there anyway to have the accordion case open if it is closed where a
> > control is located with an error when the user selects the link in the
> > error-summary?  Currently if you select the link nothing happens if the
> > accordion case is closed.  In the switch case I was able to have code that
> > would take them to the correct case and the control.  But in the xbl
> > component how would this be done?
> >
> > Thanks.
> > --
> > View this message in context: http://orbeon-forms-ops-users.24843.n4.nabble.com/Error-Summary-fr-accordion-tp3016416p3016416.html
> > Sent from the Orbeon Forms (ops-users) mailing list archive at Nabble.com.
> >
> >
> > --
> > 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
> >
> >
>
>
>
> --
> Orbeon Forms - Web forms, open-source, for the Enterprise -
> http://www.orbeon.com/
> My Twitter: http://twitter.com/avernet
>
>
>
> --
> 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
>


--
Orbeon Forms - Web forms, open-source, for the Enterprise -
http://www.orbeon.com/
My Twitter: http://twitter.com/avernet


--
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
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Re: Re: Error-Summary fr:accordion

bsteuhl
Alex,

Getting back to this since it is now coming close to being rolled out in a production environment.  I unpacked orbeon-resources-private.jar and opened up the accordion.xbl file.  At the bottom of the code is where you set focus of the control through the label.  I have attempted to add the toggle action as you mention above to this action but it does not expand the case.  Any insight would be helpful.


The short term was just to hard code in the case id to test:

<xforms:action ev:event="DOMActivate">
     <xforms:dispatch target="intakeInformation" name="fr-toggle" />
     <xforms:setfocus control="{{$effective-id-outer}}" xxbl:scope="outer"/>
</xforms:action>

and then to replace the hard code id with a dynamic id.  This would be as you mentioned above a naming convention in the control id in which the second part of the id would be the case id.  For example, a case with id='intakeInformation' and a control id within this case id="control1-intakeInformation'.  Then within the xbl, create a variable as follows:

<xxforms:variable name="target" as="element(error)" select="substring-after($error/@id, '-')"/>

And then implement the toggle and the setfocus.

<xforms:action ev:event="DOMActivate">
     <xforms:dispatch target="$target" name="fr-toggle" />
     <xforms:setfocus control="{{$effective-id-outer}}" xxbl:scope="outer"/>
</xforms:action>

I attempted above recompiling the jar file and restarting server, but the code does not work.  Where I am going wrong?  Is this possible as I have described above?

Thanks
Brian Steuhl
BTM Software Solutions