Hi
Can anyone tell me how I can display a large number in an XForm field when displaying the result of a calculation. If, for instance, I produced a calculation such as 9999 x 9999, the result will come up as 9.9980001E7. Are there any settings in OPS or indeed XForms which will allow me to specify the length of a returned calculation before it jumps off to a scientific notation/infinity!? The result should surely be 99980001 in this case -- Colin Seaman Senior Developer Tradocs Ltd, Tower Point, 44 North Road, Brighton, BN1 1YR email: [hidden email] skype: colin,seaman telephone: 0870-1417031 website: http://www.tradocs.net This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please contact Tradocs. Please note that any views or opinions presented in this email are solely those of the author and do not necessarily represent those of the company. Finally, the recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. This content of this email is without prejudice. -- 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 ObjectWeb mailing lists service home page: http://www.objectweb.org/wws |
The formatting section in the
Orbeon documentation explains how you can use the XSLT format-number()
function:
http://www.orbeon.com/ops/doc/reference-xforms-ng#xforms-formatting eg <xforms:output ref="size" xxforms:format="format-number(., '###,##0')"/> Adrian Colin Seaman wrote: Hi -- 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 ObjectWeb mailing lists service home page: http://www.objectweb.org/wws |
ah yes, thanks. But what I really meant was if you display the output
of the calculation in an "input" tag, ie:
<xforms:inputref="size" xxforms:format="format-number(., '###,##0')"/> ..see what happens! Colin Seaman Senior Developer Tradocs Ltd, Tower Point, 44 North Road, Brighton, BN1 1YR email: [hidden email] skype: colin,seaman telephone: 0870-1417031 website: http://www.tradocs.net This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please contact Tradocs. Please note that any views or opinions presented in this email are solely those of the author and do not necessarily represent those of the company. Finally, the recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. This content of this email is without prejudice. Adrian Baker wrote: The formatting section in the Orbeon documentation explains how you can use the XSLT format-number() function: -- 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 ObjectWeb mailing lists service home page: http://www.objectweb.org/wws |
Administrator
|
In reply to this post by Colin Seaman
Colin,
How exactly are you getting this result? I seem to be getting 99980001 as expected. Can you send a file we can run in the sandbox? -Erik Colin Seaman wrote: > Hi > > Can anyone tell me how I can display a large number in an XForm field > when displaying the result of a calculation. > > If, for instance, I produced a calculation such as 9999 x 9999, the > result will come up as 9.9980001E7. > > Are there any settings in OPS or indeed XForms which will allow me to > specify the length of a returned calculation before it jumps off to a > scientific notation/infinity!? > > The result should surely be 99980001 in this case Orbeon Forms - Web Forms for the Enterprise Done the Right Way http://www.orbeon.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 ObjectWeb mailing lists service home page: http://www.objectweb.org/wws |
Question for everyone:
Is there any way to right-align an input field (for entering numeric data) in XForms? Larry T. Chen Sr. Software Engineer Intelenet Communications, Inc. -- 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 ObjectWeb mailing lists service home page: http://www.objectweb.org/wws |
Larry,
can you achieve this with some css? <input id="myElementId"...>...</input> #myElementId input{ text-align: right; float: right; /* etc.*/ } More: http://www.cs.tut.fi/~jkorpela/forms/present.html#align http://archivist.incutio.com/viewlist/css-discuss/51329 Hope I understood your question right, and that you find this usefull :-) Henrik On 12/9/06,
Larry T. Chen <[hidden email]> wrote: Question for everyone: -- 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 ObjectWeb mailing lists service home page: http://www.objectweb.org/wws |
Henrik,
Thank you for your reply. Exactly like you suggested, I'm trying to apply "text-align: right;" to the input field. However, because the Orbeon XForms engine does the translation of <xforms:input> into an HTML <input field>, I attempted to assign a class to the <xforms:input> element and it showed up in the <span> element that wraps the HTML input element instead of the HTML <input> element itself when you view the Orbeon-generated HTML. Of course applying "text-align:right" to the <span> element has no effect. Basically I need some way of assigning a class or id for the generated HTML input field via XForms. Any ideas? Larry T. Chen Sr. Software Engineer Intelenet Communications, Inc. Henrik Pettersen wrote: Larry, -- 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 ObjectWeb mailing lists service home page: http://www.objectweb.org/wws |
Larry,
best way to do this is to sorround the the xforms:input with a div like this: <xhtml:div id="wrapper"> <xforms:input ...>...</xforms:input> </xhtml:div> Then you can reference the xforms:input elements like this in your css: #wrapper input{ } #wrapper span{ } Hope that works. Henrik On 12/9/06,
Larry T. Chen <[hidden email]> wrote:
-- 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 ObjectWeb mailing lists service home page: http://www.objectweb.org/wws |
Henrik,
Thank you for the tip. That worked great! It just struck me that CSS descendant selectors could be very helpful in styling other XForms components as well, since a lot of the generated HTML elements are wrapped by <span> elements. Suggestion to the Orbeon team: How about adding a CSS styling guide for XForms to the documentation, summarizing the best practices for styling the Orbeon implementation of XForms? This topic has come up quite a bit in this mailing list. To a new Orbeon user, it is one of the more mysterious aspects of using XForms. Larry Henrik Pettersen wrote: Larry, -- 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 ObjectWeb mailing lists service home page: http://www.objectweb.org/wws |
Hi Everyone,
Is it possible to render an input field for xs:date, and still have the calendar icon to select the date if desired? In many cases, a date can be entered faster by typing than by browsing the calendar to find the desired date. This is true especially in business use cases when sometimes you're just copying a date from a paper form or an email. Larry T. Chen Sr. Software Engineer Intelenet Communications, Inc. -- 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 ObjectWeb mailing lists service home page: http://www.objectweb.org/wws |
Hi Larry,
This feature was requested before and in fact there is an entry for this in bug tracker: http://forge.objectweb.org/tracker/? group_id=168&atid=350207&func=detail&aid=306172 A. On Dec 10, 2006, at 11:27 PM, Larry T. Chen wrote: > Hi Everyone, > > Is it possible to render an input field for xs:date, and still have > the calendar icon to select the date if desired? In many cases, a > date can be entered faster by typing than by browsing the calendar > to find the desired date. This is true especially in business use > cases when sometimes you're just copying a date from a paper form > or an email. > > Larry T. Chen > Sr. Software Engineer > Intelenet Communications, Inc. > > > > -- > You receive this message as a subscriber of the ops- > [hidden email] mailing list. > To unsubscribe: mailto:[hidden email] > For general help: mailto:[hidden email]?subject=help > ObjectWeb mailing lists service home page: http://www.objectweb.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 ObjectWeb mailing lists service home page: http://www.objectweb.org/wws |
In reply to this post by Erik Bruchez
Please find attached a Sandbox example of this. No matter how I try, I can't stop the ..E... appearing! Colin Seaman Senior Developer Tradocs Ltd, Tower Point, 44 North Road, Brighton, BN1 1YR email: [hidden email] skype: colin,seaman telephone: 0870-1417031 website: http://www.tradocs.net This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please contact Tradocs. Please note that any views or opinions presented in this email are solely those of the author and do not necessarily represent those of the company. Finally, the recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. This content of this email is without prejudice. Erik Bruchez wrote: Colin, -- 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 ObjectWeb mailing lists service home page: http://www.objectweb.org/wws sandbox.xhtml (1K) Download Attachment |
In reply to this post by Larry T. Chen
Larry,
I'm happy you got it to work. Great suggestion, hopefully the Orbeon Forms team will find the time to include this in 3.5 proper (or is that 4?) documentation. Luckily, thorough and excellent documentation is one of their strong points :-) I just have one addition: Because the existence and order of elements in XHTML, as well as the position of the elements in the XML hierarchy, are important for rendering, it would be great if we had some sort of templating langauge for how to layout each XForms control (global, per-page, etc.) in XHTML. Here's an example: In my current application I do not wish to display the hints as a span, but rather as a tooltip. That means not using the < help > element and inserting some fancy javacode, which again breaks the semantics (and universal device rendering) of the XForms control markup. My 2 cents. Henrik On 12/10/06, Larry T. Chen <[hidden email]> wrote: > > Henrik, > > Thank you for the tip. That worked great! It just struck me that CSS > descendant selectors could be very helpful in styling other XForms > components as well, since a lot of the generated HTML elements are wrapped > by <span> elements. > > Suggestion to the Orbeon team: How about adding a CSS styling guide for > XForms to the documentation, summarizing the best practices for styling the > Orbeon implementation of XForms? This topic has come up quite a bit in this > mailing list. To a new Orbeon user, it is one of the more mysterious > aspects of using XForms. > > Larry > > Henrik Pettersen wrote: > Larry, > > best way to do this is to sorround the the xforms:input with a div like > this: > > <xhtml:div id="wrapper"> > <xforms:input ...>...</xforms:input> > </xhtml:div> > > Then you can reference the xforms:input elements like this in your css: > > #wrapper input{ > > } > > #wrapper span{ > > } > > Hope that works. > > Henrik > > > On 12/9/06, Larry T. Chen <[hidden email]> wrote: > > > > Henrik, > > > > Thank you for your reply. Exactly like you suggested, I'm trying to apply > "text-align: right;" to the input field. However, because the Orbeon XForms > engine does the translation of <xforms:input> into an HTML <input field>, I > attempted to assign a class to the <xforms:input> element and it showed up > in the <span> element that wraps the HTML input element instead of the HTML > <input> element itself when you view the Orbeon-generated HTML. Of course > applying "text-align:right" to the <span> element has no effect. > > > > Basically I need some way of assigning a class or id for the generated > HTML input field via XForms. > > Any ideas? > > > > Larry T. Chen > > Sr. Software Engineer > > Intelenet Communications, Inc. > > > > Henrik Pettersen wrote: > > > > Larry, > > > > can you achieve this with some css? > > > > <input id="myElementId"...>...</input> > > > > #myElementId input{ > > text-align: right; > > float: right; > > /* etc.*/ > > } > > > > More: > > http://www.cs.tut.fi/~jkorpela/forms/present.html#align > > http://archivist.incutio.com/viewlist/css-discuss/51329 > > > > Hope I understood your question right, and that you find this usefull :-) > > > > Henrik > > > > > > > > On 12/9/06, Larry T. Chen <[hidden email]> wrote: > > > Question for everyone: > > > > > > Is there any way to right-align an input field (for entering numeric > > > data) in XForms? > > > > > > Larry T. Chen > > > Sr. Software Engineer > > > Intelenet Communications, Inc. > > > > > > > > > > > > > > > > > > > > > -- > > > 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 > > > ObjectWeb mailing lists service home page: http://www.objectweb.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 > > ObjectWeb mailing lists service home page: http://www.objectweb.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 > > ObjectWeb mailing lists service home page: http://www.objectweb.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 > ObjectWeb mailing lists service home page: http://www.objectweb.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 > ObjectWeb mailing lists service home page: http://www.objectweb.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 ObjectWeb mailing lists service home page: http://www.objectweb.org/wws |
Administrator
|
In reply to this post by Colin Seaman
Colin,
I see. I thoughts the numbers were literals in the XPath (which wouldn't have been very useful). Try something like this: calculate="xs:integer(../unitprice) * xs:integer(../quantity)" This will force a conversion of the types to integers. You can make it more robust with something like this: calculate="if (../unitprice castable as xs:integer and ../quantity castable as xs:integer) then xs:integer(../unitprice) * xs:integer(../quantity) else 'N/A'" -Erik Colin Seaman wrote: > Hi Erik, > > Please find attached a Sandbox example of this. No matter how I try, I > can't stop the ..E... appearing! > > Colin Seaman > Senior Developer > > Tradocs Ltd, > Tower Point, > 44 North Road, > Brighton, > BN1 1YR > > email: [hidden email] > skype: colin,seaman > telephone: 0870-1417031 > website: http://www.tradocs.net > > This email and any files transmitted with it are confidential > and intended solely for the use of the individual or entity to > whom they are addressed. If you have received this email in > error please contact Tradocs. Please note that any views or > opinions presented in this email are solely those of the author > and do not necessarily represent those of the company. Finally, > the recipient should check this email and any attachments for > the presence of viruses. The company accepts no liability for > any damage caused by any virus transmitted by this email. > This content of this email is without prejudice. > > > > Erik Bruchez wrote: >> Colin, >> >> How exactly are you getting this result? I seem to be getting 99980001 >> as expected. Can you send a file we can run in the sandbox? >> >> -Erik >> >> Colin Seaman wrote: >>> Hi >>> >>> Can anyone tell me how I can display a large number in an XForm field >>> when displaying the result of a calculation. >>> >>> If, for instance, I produced a calculation such as 9999 x 9999, the >>> result will come up as 9.9980001E7. >>> >>> Are there any settings in OPS or indeed XForms which will allow me to >>> specify the length of a returned calculation before it jumps off to a >>> scientific notation/infinity!? >>> >>> The result should surely be 99980001 in this case Orbeon Forms - Web Forms for the Enterprise Done the Right Way http://www.orbeon.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 ObjectWeb mailing lists service home page: http://www.objectweb.org/wws |
Administrator
|
In reply to this post by Larry T. Chen
Larry,
We agree that this needs to be documented! We already had a bug to track this. I just made the description more explicit: http://forge.objectweb.org/tracker/index.php?func=detail&aid=305535&group_id=168&atid=350207 -Erik Larry T. Chen wrote: > Henrik, > > Thank you for the tip. That worked great! It just struck me that CSS > descendant selectors could be very helpful in styling other XForms > components as well, since a lot of the generated HTML elements are > wrapped by <span> elements. > > Suggestion to the Orbeon team: How about adding a CSS styling guide for > XForms to the documentation, summarizing the best practices for styling > the Orbeon implementation of XForms? This topic has come up quite a bit > in this mailing list. To a new Orbeon user, it is one of the more > mysterious aspects of using XForms. > > Larry > > Henrik Pettersen wrote: >> Larry, >> >> best way to do this is to sorround the the xforms:input with a div >> like this: >> >> <xhtml:div id="wrapper"> >> <xforms:input ...>...</xforms:input> >> </xhtml:div> >> >> Then you can reference the xforms:input elements like this in your css: >> >> #wrapper input{ >> >> } >> >> #wrapper span{ >> >> } >> >> Hope that works. >> >> Henrik >> >> On 12/9/06, *Larry T. Chen* <[hidden email] >> <mailto:[hidden email]>> wrote: >> >> Henrik, >> >> Thank you for your reply. Exactly like you suggested, I'm trying >> to apply "text-align: right;" to the input field. However, >> because the Orbeon XForms engine does the translation of >> <xforms:input> into an HTML <input field>, I attempted to assign a >> class to the <xforms:input> element and it showed up in the <span> >> element that wraps the HTML input element instead of the HTML >> <input> element itself when you view the Orbeon-generated HTML. >> Of course applying "text-align:right" to the <span> element has no >> effect. >> >> Basically I need some way of assigning a class or id for the >> generated HTML input field via XForms. >> Any ideas? >> >> Larry T. Chen >> Sr. Software Engineer >> Intelenet Communications, Inc. >> >> Henrik Pettersen wrote: >>> Larry, >>> >>> can you achieve this with some css? >>> >>> <input id="myElementId"...>...</input> >>> >>> #myElementId input{ >>> text-align: right; >>> float: right; >>> /* etc.*/ >>> } >>> >>> More: >>> http://www.cs.tut.fi/~jkorpela/forms/present.html#align >>> <http://www.cs.tut.fi/%7Ejkorpela/forms/present.html#align> >>> http://archivist.incutio.com/viewlist/css-discuss/51329 >>> >>> Hope I understood your question right, and that you find this >>> usefull :-) >>> >>> Henrik >>> >>> >>> On 12/9/06, * Larry T. Chen* <[hidden email] >>> <mailto:[hidden email]>> wrote: >>> >>> Question for everyone: >>> >>> Is there any way to right-align an input field (for entering >>> numeric >>> data) in XForms? >>> >>> Larry T. Chen >>> Sr. Software Engineer >>> Intelenet Communications, Inc. >>> >>> >>> >>> >>> >>> >>> -- >>> You receive this message as a subscriber of the >>> [hidden email] <mailto:[hidden email]> >>> mailing list. >>> To unsubscribe: mailto:[hidden email] >>> <mailto:[hidden email]> >>> For general help: mailto:[hidden email] >>> <mailto:[hidden email]>?subject=help >>> ObjectWeb mailing lists service home page: >>> http://www.objectweb.org/wws >>> >>> >>> >>> ------------------------------------------------------------------------ >>> >>> >>> -- >>> You receive this message as a subscriber of the [hidden email] <mailto:[hidden email]> mailing list. >>> To unsubscribe: >>> mailto:[hidden email] >>> For general help: mailto:[hidden email]?subject=help >>> ObjectWeb mailing lists service home page: http://www.objectweb.org/wws >>> >> >> >> >> -- >> You receive this message as a subscriber of the >> [hidden email] <mailto:[hidden email]> mailing list. >> To unsubscribe: mailto: [hidden email] >> <mailto:[hidden email]> >> For general help: mailto: [hidden email] >> <mailto:[hidden email]>?subject=help >> ObjectWeb mailing lists service home page: >> http://www.objectweb.org/wws <http://www.objectweb.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 >> ObjectWeb mailing lists service home page: http://www.objectweb.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 > ObjectWeb mailing lists service home page: http://www.objectweb.org/wws -- Orbeon Forms - Web Forms for the Enterprise Done the Right Way http://www.orbeon.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 ObjectWeb mailing lists service home page: http://www.objectweb.org/wws |
Administrator
|
In reply to this post by Henrik Pettersen
On 12/11/06, Henrik Pettersen <[hidden email]> wrote:
> I just have one addition: Because the existence and order of elements > in XHTML, as well as the position of the elements in the XML > hierarchy, are important for rendering, it would be great if we had > some sort of templating langauge for how to layout each XForms control > (global, per-page, etc.) in XHTML. Here's an example: In my current > application I do not wish to display the hints as a span, but rather > as a tooltip. That means not using the < help > element and inserting > some fancy javacode, which again breaks the semantics (and universal > device rendering) of the XForms control markup. Henrik, I fully agree: A first step will be to document the current CSS classes and generated HTML, so you can customize the HTML generated by Orbeon Forms with CSS. A second step will be to get a list of the use cases that can't be handled just by changing the CSS, and figure out a way to give you more control so you can customize the generated HTML. Alex -- Blog (XML, Web apps, Open Source): http://www.orbeon.com/blog/ -- 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 ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
--
Follow Orbeon on Twitter: @orbeon Follow me on Twitter: @avernet |
Alex,
that sounds great! For the latter part, I am attempting to integrate this: <a href="http://encytemedia.com/event-selectors/" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)"> http://encytemedia.com/event-selectors/ I like this approach, because it allows you to keep the semantics of the XForms markup when customizing controls, and because it allows you to target individual xforms controls for styling quite easily. No success so far, but something like this should be possible: <xhtml:script> var Rules = { '#testing img:mouseover': function(element, event) { var target = ORBEON.xforms.Events._findParentXFormsControl(YAHOO.util.Event.getTarget(event)); if (target != null) { if (ORBEON.util.Dom.hasClass (target, "xforms-help-image")) { // Show help tool-tip var label = target.nextSibling; while (!ORBEON.util.Dom.isElement(label)) label = target.nextSibling; var control = document.getElementById(label.htmlFor); ORBEON.xforms.Events._showToolTip(event, label, "xforms-help", ORBEON.xforms.Controls.getHelpMessage (control)); } else if (ORBEON.util.Dom.hasClass(target, "xforms-alert-active")) { var control = document.getElementById(target.htmlFor); var message = ORBEON.xforms.Controls.getAlertMessage(control); if (message != "") { // Show alert tool-tip ORBEON.xforms.Events._showToolTip (event, target, "xforms-alert", ORBEON.xforms.Controls.getAlertMessage(control)); } } } } } </xhtml:script> Henrik On 12/20/06, Alessandro Vernet <[hidden email]> wrote: On 12/11/06, Henrik Pettersen <[hidden email]> wrote: -- 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 ObjectWeb mailing lists service home page: http://www.objectweb.org/wws |
Free forum by Nabble | Edit this page |