|
View:
New views
4 Messages
—
Rating Filter:
Alert me
|
|
|
Failure to signal required and disabled fields for nested formsHi all,
I am the maintainer for an application(based on Chiba-web 2.3.0) that has been in production for nearly a year now. So I can't just try upgrading to a later version like chiba-web 3.0.0b2. We managed to simulate inline forms (see picture 1: http://img40.imageshack.us/i/picture1mia.png/) using xforms:group and Dojo tabs. On this specific form, the selection widget offers a list of available items (left side) and a list a items the user has selected (right side) using the right-pointed arrow. "Modifier" is the french word for "Modify" or "Edit" and "Créer" is the word for "Create". For each selected item, the inline form is updated and reflects the field values for that item. For instance, for item "Langue fr_FR", the field "Titre" may read "France". Had we also selected "Langue en_US", "Titre" would have read another text we chose to enter, for instance "U.S.A.". This is standard XForm, except maybe for our selection widget. When there's no item selected, the inline form shows no fields, which is the expected (and wanted) behavior since the instance does not provide the bindings for those fields. The problem: when the user selects a first item in the selection widget, the action associated with the trigger (the right-pointed arrow) inserts the instance subsection BUT required/disabled text and date fields are not shown as required/disabled (see picture 2: http://img3.imageshack.us/i/picture2oj.png/) although the binds specify the right values for the "required" and "readonly" (lines 25 and 26). The xhtml template for the form show in both pictures is attached to this email. What I tried: - after reading the XForms 1.1 recommendation (http://www.w3.org/TR/xforms11), I tried adding xforms:refresh to the action for the trigger (lines 195-199) below the last "xf:setvalue". To no avail. I even tried it with rebuild, recalculate and revalidate actions so that the action was as below, still to no avail. <!-- start of the action --> <xf:action ev:event="DOMActivate" if=...> <xf:insert at="last()" position="after" bind="bind-5" /> <xf:setvalue ref="... /> <xf:setvalue ref="... /> <xf:rebuild model="objectmodel"> <xf:recalculate model="objectmodel"> <xf:revalidate model="objectmodel"> <xf:refresh model="objectmodel"> </xf:action> <!-- end --> - I even added a xf:message to make sure all actions were processed, which seems to be the case since I saw that message. - I later added a dispatch with a delay of "2000" for the "xforms-refresh" event, which caused an OutOfBound exception. I'm at the end of my wits... all the more since our selection widgets in the inline form get marked as required (see picture 1). Can someone offer some advice or insight on this problem ? What I want if to have Chiba update the webpage after a user activates a specific trigger that modifies the form's instance with an insert. I would be immensely grateful. Thanks. -Archi. "Only that which is the other gives us fully unto ourselves" Sri Yogananda ------------------------------------------------------------------------------ Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference _______________________________________________ Chiba-users mailing list Chiba-users@... https://lists.sourceforge.net/lists/listinfo/chiba-users |
|
|
Re: Failure to signal required and disabled fields for nested formsI'm not sure, but this might be a bug in Chiba 2.3. If required field is
inside optional group, then the star is not shown. The field itself should perform as required, ie submit is unsuccessful, unless you enter value. The fix is quite simple - remove following lines from xforms.css and chiba-theme.css: .optional .required-symbol { display: none; } I attached patch also to this mail, but this requires recompile of chiba-web. It's probably easier for you to just modify those two files in Chiba resources/styles directory. Tambet Vodoo Moth wrote: > Hi all, > I am the maintainer for an application(based on Chiba-web 2.3.0) that has been in production for nearly a year now. So I can't just try upgrading to a later version like chiba-web 3.0.0b2. > > We managed to simulate inline forms (see picture 1: http://img40.imageshack.us/i/picture1mia.png/) using xforms:group and Dojo tabs. > > On this specific form, the selection widget offers a list of available items (left side) and a list a items the user has selected (right side) using the right-pointed arrow. "Modifier" is the french word for "Modify" or "Edit" and "Créer" is the word for "Create". For each selected item, the inline form is updated and reflects the field values for that item. For instance, for item "Langue fr_FR", the field "Titre" may read "France". Had we also selected "Langue en_US", "Titre" would have read another text we chose to enter, for instance "U.S.A.". This is standard XForm, except maybe for our selection widget. > > When there's no item selected, the inline form shows no fields, which is the expected (and wanted) behavior since the instance does not provide the bindings for those fields. > > The problem: when the user selects a first item in the selection widget, the action associated with the trigger (the right-pointed arrow) inserts the instance subsection BUT required/disabled text and date fields are not shown as required/disabled (see picture 2: http://img3.imageshack.us/i/picture2oj.png/) although the binds specify the right values for the "required" and "readonly" (lines 25 and 26). The xhtml template for the form show in both pictures is attached to this email. > > > What I tried: > - after reading the XForms 1.1 recommendation (http://www.w3.org/TR/xforms11), I tried adding xforms:refresh to the action for the trigger (lines 195-199) below the last "xf:setvalue". To no avail. I even tried it with rebuild, recalculate and revalidate actions so that the action was as below, still to no avail. > > <!-- start of the action --> > <xf:action ev:event="DOMActivate" if=...> > <xf:insert at="last()" position="after" bind="bind-5" /> > <xf:setvalue ref="... /> > <xf:setvalue ref="... /> > <xf:rebuild model="objectmodel"> > <xf:recalculate model="objectmodel"> > <xf:revalidate model="objectmodel"> > <xf:refresh model="objectmodel"> > </xf:action> > <!-- end --> > > - I even added a xf:message to make sure all actions were processed, which seems to be the case since I saw that message. > > - I later added a dispatch with a delay of "2000" for the "xforms-refresh" event, which caused an OutOfBound exception. > > > I'm at the end of my wits... all the more since our selection widgets in the inline form get marked as required (see picture 1). > > Can someone offer some advice or insight on this problem ? What I want if to have Chiba update the webpage after a user activates a specific trigger that modifies the form's instance with an insert. > > I would be immensely grateful. Thanks. > > -Archi. > > > "Only that which is the other gives us fully unto ourselves" > Sri Yogananda > > > > > ------------------------------------------------------------------------------ > Come build with us! The BlackBerry(R) Developer Conference in SF, CA > is the only developer event you need to attend this year. Jumpstart your > developing skills, take BlackBerry mobile applications to market and stay > ahead of the curve. Join us from November 9 - 12, 2009. Register now! > http://p.sf.net/sfu/devconference > _______________________________________________ > Chiba-users mailing list > Chiba-users@... > https://lists.sourceforge.net/lists/listinfo/chiba-users > Index: web/src/main/webapp/resources/styles/xforms.css =================================================================== --- web/src/main/webapp/resources/styles/xforms.css (revision 3547) +++ web/src/main/webapp/resources/styles/xforms.css (working copy) @@ -76,10 +76,6 @@ display: inline; } -.optional .required-symbol { - display: none; -} - .help-text { position: absolute; display: none; Index: web/src/main/webapp/resources/styles/chiba-theme.css =================================================================== --- web/src/main/webapp/resources/styles/chiba-theme.css (revision 3547) +++ web/src/main/webapp/resources/styles/chiba-theme.css (working copy) @@ -241,11 +241,6 @@ display: inline; } -.optional .required-symbol { - display: none; -} - - .help-text { width: 300px; border: thin solid gray; ------------------------------------------------------------------------------ Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference _______________________________________________ Chiba-users mailing list Chiba-users@... https://lists.sourceforge.net/lists/listinfo/chiba-users |
|
|
|
|
|
Re : Failure to signal required and disabled fields for nested formsHi all, as a follow-up to my message below and for the record: I finally solved the problem below by modifying the "PresentationContext.js" file: - I added the required symbol by myself in the _setRequired function if the control is marked as required but its label doesn't have the symbol. Also required calling _setRequired (after the date and time widgets have been called) - I moved the _setRequired, _setValid, etc. functions after the widgets are created (i.e. after the "if (!tmpControl) {...} else {...}" test in _handleStateChanged). This was required because in the case of widget'ed controls, the widget may be created after the update functions are called. Chiba version is 2.3 or 2.4 (can't check it, I'm not at work right now). Maybe it will help someone. ----- Message d'origine ---- De : Vodoo Moth <vodoomoth@...> À : Tambet Matiisen <tambet.matiisen@...> Cc : chiba-users@... Envoyé le : Jeu 22 Octobre 2009, 14 h 56 min 30 s Objet : Re: [Chiba-users] Failure to signal required and disabled fields for nested forms Thanks Tambet for your answer. You are right about the field performing as required: submit fails (and the "* - required" at the bottom of the page blinks) but the user does not know why... as there are no visual cues indicating required fields in the nested form. I guess I was not too wrong when thinking that it could be a bug. I tried your solution but it didn't work. I'm not very surprised of that since the solution does not explain the fact that read-only form controls are still modifiable on the UI. For my education, what are "optional groups" ? My next thing to try would be to test the behavior with Chiba 3.0 or other XForms processors. Thanks again. -Archi. "Only that which is the other gives us fully unto ourselves" Sri Yogananda P.S. I am attaching the file that I forgot to attach to my initial email. --- En date de : Jeu 22.10.09, Tambet Matiisen <tambet.matiisen@...> a écrit : > De: Tambet Matiisen <tambet.matiisen@...> > Objet: Re: [Chiba-users] Failure to signal required and disabled fields for nested forms > À: "Vodoo Moth" <vodoomoth@...> > Cc: chiba-users@... > Date: Jeudi 22 Octobre 2009, 9h39 > I'm not sure, but this might be a bug > in Chiba 2.3. If required field is inside optional group, > then the star is not shown. The field itself should perform > as required, ie submit is unsuccessful, unless you enter > value. > > The fix is quite simple - remove following lines from > xforms.css and chiba-theme.css: > .optional .required-symbol { > display: none; > } > > I attached patch also to this mail, but this requires > recompile of chiba-web. It's probably easier for you to just > modify those two files in Chiba resources/styles directory. > > Tambet > ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ Chiba-users mailing list Chiba-users@... https://lists.sourceforge.net/lists/listinfo/chiba-users |
| Free embeddable forum powered by Nabble | Forum Help |