Hi all,
As I need a solution for this as soon as possible I'm now offering a cash bounty of $100 for the first person who can send me a working set of changes to enable the feature described below. Payment will be made by PayPal immediately after I have been able to test and verify the solution. If you're planning to try for the bounty can you drop me a quick email to let me know that there's someone out there looking at it. To clarify the requirements for what is needed to receive the bounty:
Hope this is of interest to someone out there. You'll be helping me out, and as the changes will be submitted back to the project as well you'll be getting paid to help the community too! Many thanks, Simon ---------- Forwarded message ---------- From: Simon Goodchild <[hidden email]> Date: 2009/8/7 Subject: Re: [ops-users] Re: Re: Re: Re: Re: Control to add block of read-only text (in Form Builder) To: [hidden email] In case anyone has any ideas, below are the configuration entries I'm currently using: For the XBL definition of the new component: <xbl:binding id="fb-mloutput" element="xforms|mloutput"> <!-- Orbeon Form Builder Component Metadata --> <metadata xmlns="http://orbeon.org/oxf/xml/form-builder"> <display-name lang="en">Multi-line Text Output</display-name> <display-name lang="fr">Sortie texte</display-name> <icon lang="en"> <small-icon>/apps/fr/style/images/silk/text_align_left.png</small-icon> <large-icon>/apps/fr/style/images/silk/text_align_left.png</large-icon> </icon> <datatype>xs:string</datatype> <template> <xforms:mloutput id="" ref="" xmlns=""> <xforms:label ref=""/> <xforms:help ref=""/> <!-- No hint? --> <xforms:alert ref="$fr-resources/detail/labels/alert"/> </xforms:mloutput> </template> </metadata> </xbl:binding> Within grid-cell-editor.xml to map the mloutput component to a textarea for inplace editing: <xforms:group ref="xforms:mloutput[not(@mediatype)]"> <!-- In-place text --> <xforms:textarea id="fb-xforms-mloutput-text-input" ref="$instance-holder" appearance="fr:in-place" incremental="false" /> </xforms:group> The results from these changes are that the new control appears in the left menu, and correctly invokes the inplace editing using a textarea. The problem comes when you preview the form, where nothing is displayed in the block for that control. I think it must be a problem with a lack of a binding to view the output outside of the form builder, but I don't know enough about how things are configured to be able to trace where to add this. One thing I've noted is that the standard fb-output control is mapped to an xforms:output element, whereas I have defined my own mloutput element. Maybe this is the wrong way to do it, but I can't find a way to map the textarea and normal output control together. Any help would be much appeciated. Simon 2009/8/2 Simon Goodchild <[hidden email]>: > Hi Erik, > > It does appear in the Form Builder interface (in the compenent menu on > the left and within the actual builder), and allows me to view/edit > the text that is displayed. But when I save and preview the form I > just get a blank space where that component should appear. All the > other components in my test form appear around this, so I just get a > blank space in the form. > > I can provide the source for the changes I have made if that helps - I > was going to contribute it back to the project once it's working > anyway. > > Many thanks, > > Simon > > 2009/8/2 Erik Bruchez <[hidden email]>: >> Simon, >> >> Does your component appears in the Form Builder toolbox? >> >> It should also work at runtime then! >> >> -Erik >> >> On Fri, Jul 31, 2009 at 6:40 AM, Simon Goodchild<[hidden email]> wrote: >>> Thanks for the hint Erik. I now how the new group defined within >>> grid-cell-editor.xml, an my custom XBL component setup, so that I can >>> add the control in using the Form Builder. The textarea correctly >>> appears in the formbuilder for editing, but there is nothing displayed >>> when I actually test the form output. I'm assuming there's another >>> config file somewhere whih will map my new component to a view whe the >>> form is run, but haven't found anything yet. Any ideas to help me do >>> this? >>> >>> Many thanks, >>> >>> Simon >>> >>> 2009/7/28 Erik Bruchez <[hidden email]>: >>>> I don't think it's *very* difficult to do, but again it requires a >>>> change to Form Builder. If you look at grid-cell-editor.xml in the >>>> source, you will see the following match for the text output control: >>>> >>>> <xforms:group ref="xforms:output[not(@mediatype)]"> >>>> >>>> This is where Form Builder decides to place an input field to edit the text. >>>> >>>> Something similar would be needed to place a textarea for your control. >>>> >>>> -Erik >>>> >>>> On Tue, Jul 21, 2009 at 1:00 PM, Simon Goodchild<[hidden email]> wrote: >>>>> Yes, I was thinking that a simple textarea was all that would be >>>>> needed on the Form Builder side, so I just need a way to transform >>>>> that content into a static text block in the generated form. I tried >>>>> doing this using an xsl transformation in a new XBL component, but >>>>> couldn't find a way to retrieve the content from the textarea for >>>>> display. I was hoping it would be fairly easy to do, as the 'Text >>>>> Output' control is doing almost the same thing with a text field, but >>>>> maybe it's more difficult :-) >>>>> >>>>> Simon >>>>> >>>>> 2009/7/21 Erik Bruchez <[hidden email]>: >>>>>> Simon, >>>>>> >>>>>> Currently, XBL components do not actually have a WYSIWYG appearance in >>>>>> Form Builder itself, so I think this will require a change to Form >>>>>> Builder, because you will want a textarea to enter the text, right? >>>>>> >>>>>> -Erik >>>>>> >>>>>> On Tue, Jul 21, 2009 at 9:58 AM, Simon Goodchild<[hidden email]> wrote: >>>>>>> Hi, >>>>>>> >>>>>>> I'm building a solution using the Form Builder, and need my end-users >>>>>>> to be able to add blocks of read-only descriptive text to the forms >>>>>>> they create. None of the standard controls seem to give this option - >>>>>>> the 'Text Output' control only allows 1 line of text, and making the >>>>>>> standard 'Multi-Line Text' control read-only isn't very user-friendly. >>>>>>> >>>>>>> I've tried creating my own control in XBL (baed on the Multi-Line Text >>>>>>> control), but have had a lot of trouble with it and am not sure if >>>>>>> there is a better way. >>>>>>> >>>>>>> Soes anyone have any suggestions or examples of how I might do this? >>>>>>> >>>>>>> Thanks for your help, >>>>>>> >>>>>>> Simon >>>>>>> >>>>>>> >>>>>>> -- >>>>>>> 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 >>>>> >>>>> >>>> >>>> >>>> -- >>>> 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 >> >> > -- 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 |
Hi Simon,
I think this is the solution that you need. I am using the latest nightly download from Orbeon. Orbeon Forms dev-post-3.7.1.200907182000 Unzip the download, goto webapps/orbeon/WEB-INF/lib folder, you need to copy out orbeon-form-builder.jar to a temporary folder, unzip the jar and then copy the contents back into webapps/orbeon/WEB-INF/resources/forms/orbeon The edit "grid-cell-editor.xml" and paste this code in it... <xforms:group ref="xforms:textarea"> <xforms:textarea id="fb-xforms-mloutput-text-input" ref="$instance-holder" appearance="fr:in-place" incremental="false"> <xforms:hint ref="$form-resources/enter-text/label"/> </xforms:textarea> </xforms:group> Then for the XBL, you need to edit, "text-controls.xbl" located in webapps/orbeon/WEB-INF/resources/forms/orbeon/builder/xbl and paste this code in it... <xbl:binding id="fb-mloutput" element="xforms|textarea"> <metadata xmlns="http://orbeon.org/oxf/xml/form-builder"> <display-name lang="en">Multi-line Text Output</display-name> <display-name lang="fr">Sortie texte</display-name> <icon lang="en"> <small-icon>/apps/fr/style/images/silk/text_align_left.png</small-icon> <large-icon>/apps/fr/style/images/silk/text_align_left.png</large-icon> </icon> <datatype>xs:string</datatype> <template> <xforms:textarea id="" ref="" xmlns=""> <xforms:label ref=""/> <xforms:help ref=""/> <xforms:alert ref="$fr-resources/detail/labels/alert"/> </xforms:textarea> </template> </metadata> </xbl:binding> When you author this control in your form, you can set the validation readonly property to "true()", this way when view in form runner it will be gray out text and cannot edit. To make it nice, you have to put in your own CSS. If this works out well for you, please donate the $100 to http://www.utbf.org/en/support/donations/donate_intl.php Best Regards. Hoi Chong
|
Thanks for replying Hoi. I've tested what you've sent over, but it's not quite what I was looking for. I'll still donate some of the money for your work, but you might want to give it another go for the full amount.
The issue with this solution is that it's really just a copy of the existing textarea control, which has 2 problems:
Regards, Simon 2009/8/14 hoichong <[hidden email]>
-- 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 |
In reply to this post by Simon Goodchild
Hi Simon,
Please use the following binding in: text-controls.xbl <xbl:binding id="fb-mloutput" element="xforms|textarea"> <metadata xmlns="http://orbeon.org/oxf/xml/form-builder"> <display-name lang="en">Multi-line Text Output</display-name> <display-name lang="fr">Sortie texte</display-name> <icon lang="en"> <small-icon>/apps/fr/style/images/silk/text_align_left.png</small-icon> <large-icon>/apps/fr/style/images/silk/text_align_left.png</large-icon> </icon> <datatype>xs:string</datatype> <template> <xforms:textarea id="" ref="" xmlns="" appearance="xxforms:autosize" class="fr-mloutput"> <xforms:alert ref="$fr-resources/detail/labels/alert"/> </xforms:textarea> </template> </metadata> </xbl:binding> Also you will need to unjar "orbeon-form-runner.jar" into webapps\orbeon\WEB-INF\resources\apps remove the "orbeon-form-runner.jar" from the lib folder. and in: webapps\orbeon\WEB-INF\resources\apps\fr\style edit form-runner-base.css put in the following css into the file .fr-grid-td .fr-grid-content .fr-mloutput { overflow: visible; border: none } You can customize how the textarea & content in textarea appears by tweaking the above CSS. Please create a new form using this latest changes. Regards. Hoi Chong
|
Free forum by Nabble | Edit this page |