Dear list,
I would very much like to build an application where (sane and trained) users make their own xforms and models and place them in a database. I can successfully select a model and a view from a database and then use them in a view for output on the screen. I still have to use the view to select parts of the db_selected_view something like so: <xsl:stylesheet version="1.0" xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" > <xsl:template match="/"> <xhtml:html> <xhtml:head> <xforms:model id="main-model"> <!-- main instance --> <xforms:instance id="instance"> <xsl:copy-of select="/model/mymodel"/> </xforms:instance> <!-- validation rules --> <xforms:bind nodeset="instance('instance')"> <xsl:copy-of select="/view/xhtml:html/xhtml:head/xforms:model/xforms:bind"/> </xforms:bind> <xforms:instance id="blah"> <xsl:copy-of select="/view/xhtml:html/xhtml:head/xforms:model/xforms:instance[@id = 'blah']/blah"/> </xforms:instance> </xforms:model> </xhtml:head> <xhtml:body> <xsl:copy-of select="/view/xhtml:html/xhtml:body"/> </xhtml:body> </xhtml:html> </xsl:template> </xsl:stylesheet> I would however like to forward (maybe using redirect?) my model and view to a page object that can directly use them. Now I have only seen 'files' used as model and view in the documentation: <page id="nop" path-info="/nop" model="mymod.xpl" view="myview.xsl"/> Whereas I would like to do: <page id="nop" path-info="/nop" model="/stuff/mymod" view="/stuff/myview"/> Wherein stuff would be data forwarded to page="nop" by an empty action using an xu:update statement. Is it possible to use ehrm . . . . 'page-flow-pipelines' ? Or something to that extent? Or is there a solution under my nose that I am missing? Cheers, Michiel Roos netcreators.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 |
Michiel,
If you are posting the data to this page, you should be able to use the stylesheet method you have shown putting this as the @view in the page entry of the page flow If you want to get it out of a database, you could use a sequence of processors in the XPL to build the input for your view, that XPL can then go into @model of the page-flow. As far as I know you can only specify files as values of view and model, I can't see how this would help you to provide a url? Ryan Ryan Puddephatt Software Engineer Teleflex Group - IT UK 1 Michaelson Square Livingston West Lothian Scotland EH54 7DP e> [hidden email] t> +44(0)1506 407 110 f> +44(0)1506 407 108 >-----Original Message----- >From: Michiel Roos [mailto:[hidden email]] >Sent: 21 November 2006 15:31 >To: [hidden email] >Subject: [ops-users] dynamic view and model loading? > >Dear list, > >I would very much like to build an application where (sane and >trained) users make their own xforms and models and place them >in a database. > >I can successfully select a model and a view from a database >and then use them in a view for output on the screen. > >I still have to use the view to select parts of the >db_selected_view something like so: > ><xsl:stylesheet version="1.0" > xmlns:xforms="http://www.w3.org/2002/xforms" > xmlns:xhtml="http://www.w3.org/1999/xhtml" > xmlns:xi="http://www.w3.org/2001/XInclude" > xmlns:xsl="http://www.w3.org/1999/XSL/Transform" > > <xsl:template match="/"> > <xhtml:html> > <xhtml:head> > <xforms:model id="main-model"> > > <!-- main instance --> > <xforms:instance id="instance"> > <xsl:copy-of select="/model/mymodel"/> > </xforms:instance> > > <!-- validation rules --> > <xforms:bind nodeset="instance('instance')"> > <xsl:copy-of >select="/view/xhtml:html/xhtml:head/xforms:model/xforms:bind"/> > </xforms:bind> > > <xforms:instance id="blah"> > <xsl:copy-of >select="/view/xhtml:html/xhtml:head/xforms:model/xforms:instanc >e[@id = 'blah']/blah"/> > </xforms:instance> > > </xforms:model> > </xhtml:head> > <xhtml:body> > <xsl:copy-of select="/view/xhtml:html/xhtml:body"/> > </xhtml:body> > </xhtml:html> > </xsl:template> ></xsl:stylesheet> > >I would however like to forward (maybe using redirect?) my >model and view to a page object that can directly use them. > >Now I have only seen 'files' used as model and view in the >documentation: ><page id="nop" path-info="/nop" model="mymod.xpl" view="myview.xsl"/> > >Whereas I would like to do: ><page id="nop" path-info="/nop" model="/stuff/mymod" >view="/stuff/myview"/> Wherein stuff would be data forwarded >to page="nop" by an empty action using an xu:update statement. > >Is it possible to use ehrm . . . . 'page-flow-pipelines' ? > >Or something to that extent? Or is there a solution under my >nose that I am missing? > >Cheers, > > >Michiel Roos >netcreators.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 |
Ryan Puddephatt wrote:
Indeed, this already works. This is how it is currently set up.Michiel, If you are posting the data to this page, you should be able to use the stylesheet method you have shown putting this as the @view in the page entry of the page flow Yes, this is what I am doing currently. I read a model and view from the database and merge them using the snippet below.If you want to get it out of a database, you could use a sequence of processors in the XPL to build the input for your view, that XPL can then go into @model of the page-flow. So . . . bugger! ;-)As far as I know you can only specify files as values of view and model, I can't see how this would help you to provide a url? Sill looking for a solution. Cheers, Michiel Ryan Ryan Puddephatt Software Engineer Teleflex Group - IT UK 1 Michaelson Square Livingston West Lothian Scotland EH54 7DP e> [hidden email] t> +44(0)1506 407 110 f> +44(0)1506 407 108-----Original Message----- From: Michiel Roos [[hidden email]] Sent: 21 November 2006 15:31 To: [hidden email] Subject: [ops-users] dynamic view and model loading? Dear list, I would very much like to build an application where (sane and trained) users make their own xforms and models and place them in a database. I can successfully select a model and a view from a database and then use them in a view for output on the screen. I still have to use the view to select parts of the db_selected_view something like so: <xsl:stylesheet version="1.0" xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" > <xsl:template match="/"> <xhtml:html> <xhtml:head> <xforms:model id="main-model"> <!-- main instance --> <xforms:instance id="instance"> <xsl:copy-of select="/model/mymodel"/> </xforms:instance> <!-- validation rules --> <xforms:bind nodeset="instance('instance')"> <xsl:copy-of select="/view/xhtml:html/xhtml:head/xforms:model/xforms:bind"/> </xforms:bind> <xforms:instance id="blah"> <xsl:copy-of select="/view/xhtml:html/xhtml:head/xforms:model/xforms:instanc e[@id = 'blah']/blah"/> </xforms:instance> </xforms:model> </xhtml:head> <xhtml:body> <xsl:copy-of select="/view/xhtml:html/xhtml:body"/> </xhtml:body> </xhtml:html> </xsl:template> </xsl:stylesheet> I would however like to forward (maybe using redirect?) my model and view to a page object that can directly use them. Now I have only seen 'files' used as model and view in the documentation: <page id="nop" path-info="/nop" model="mymod.xpl" view="myview.xsl"/> Whereas I would like to do: <page id="nop" path-info="/nop" model="/stuff/mymod" view="/stuff/myview"/> Wherein stuff would be data forwarded to page="nop" by an empty action using an xu:update statement. Is it possible to use ehrm . . . . 'page-flow-pipelines' ? Or something to that extent? Or is there a solution under my nose that I am missing? Cheers, Michiel Roos netcreators.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
|
Michiel Roos wrote:
> Yes, this is what I am doing currently. I read a model and view from the > database and merge them using the snippet below. >> As far as I know you can only specify files as values of view and model, I >> can't see how this would help you to provide a url? >> > So . . . bugger! ;-) In fact, you can use URLs in @model and @view, and even use the result of URL matchers to configure them. E.g. you should be able to write: model="http://example.org/something/${1}.xpl" -Erik -- Orbeon Forms - XForms Everywhere 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 |
TWO CENTS: I too am interested in a solution to this problem.
Todd Gochenour
On 11/22/06, Erik Bruchez <[hidden email]> wrote:
Michiel Roos 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 |
Hi,
I may be missing the point or details of this issue, and doubtless vastly over simplifying, but is this not a possible solution... Have a generic model that is initiated from the page flow In the pipeline select and load the appropriate model and view And "execute" them from there hth Colin On Nov 25, 2006, at 10:21 PM, Todd Gochenour 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 |
Hi,
I have a need to show/hide table rows using xforms:group based on the existence of an optional element in the data instance. For example: <table> <xforms:group ref=".[Optional_Element]"> <tr> ..... </tr> </xforms:group> <xforms:group ref=".[not(Optional_Element)]"> <tr> ..... </tr> </xforms:group> </table> The reason for this is that based on the existence of the Optional_Element, the row/cell layout is different (rowspans and colspans are different). The problem I'm having is that the Orbeon Forms engine generates a <span> for each <xforms:group> tag within the table to control visibility of the table rows, which unfortunately doesn't work in Firefox or IE. It appears that the reliable way to hide table rows in Firefox and IE is to have a <tbody style="display:none;"> around the rows to be hidden. So my question/proposal is: can we generate a <tbody> tag with the appropriate xforms CSS classes instead of a <span> whenever an <xforms:group> tag is embedded within a table? Or please enlighten me if there's an alternative way to reliably show/hide table rows. Thanks in advance. 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 |
I tend to hide the contents of the cells (<td>), and leave the
table markup alone. Generally an empty table cell doesn't take up any
space.
ADrian Larry T. Chen wrote: Hi, I have a need to show/hide table rows using xforms:group based on the existence of an optional element in the data instance. For example: <table> <xforms:group ref=".[Optional_Element]"> <tr> ..... </tr> </xforms:group> <xforms:group ref=".[not(Optional_Element)]"> <tr> ..... </tr> </xforms:group> </table> The reason for this is that based on the existence of the Optional_Element, the row/cell layout is different (rowspans and colspans are different). The problem I'm having is that the Orbeon Forms engine generates a <span> for each <xforms:group> tag within the table to control visibility of the table rows, which unfortunately doesn't work in Firefox or IE. It appears that the reliable way to hide table rows in Firefox and IE is to have a <tbody style="display:none;"> around the rows to be hidden. So my question/proposal is: can we generate a <tbody> tag with the appropriate xforms CSS classes instead of a <span> whenever an <xforms:group> tag is embedded within a table? Or please enlighten me if there's an alternative way to reliably show/hide table rows. Thanks in advance. 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 |
Administrator
|
In reply to this post by Larry T. Chen
Larry,
As you noticed, this won't work and is not supported at the moment. The only thing you should consider supported around <xhtml:tr> is <xforms:repeat>. (Note that XForms, in principle, does not even intend to support <xforms:repeat> around <xhtml:tr>, because the XHTML DTD does not support anything between <xhtml:table> or <xhtml:tbody> and <xhtml:tr>. This explains why the XForms repeat attributes were introduced. But there is a debate around this, and in particular at Orbeon we don't think any of this makes much sense.) I see two workarounds for the moment: control visibility from within <xhtml:td> (which has the drawback that the <xhtml:tr> is probably still visible), or play with the relevance of repeat iterations: <xforms:bind nodeset="some-element" relevant="some-condition"/> <xforms:repeat nodeset="some-element"> <xhtml:tr> ... -Erik Larry T. Chen wrote: > Hi, > > I have a need to show/hide table rows using xforms:group based on the > existence of an optional element in the data instance. For example: > > <table> > <xforms:group ref=".[Optional_Element]"> > <tr> ..... </tr> > </xforms:group> > > <xforms:group ref=".[not(Optional_Element)]"> > <tr> ..... </tr> > </xforms:group> > </table> > > The reason for this is that based on the existence of the > Optional_Element, the row/cell layout is different (rowspans and > colspans are different). > > The problem I'm having is that the Orbeon Forms engine generates a > <span> for each <xforms:group> tag within the table to control > visibility of the table rows, which unfortunately doesn't work in > Firefox or IE. It appears that the reliable way to hide table rows in > Firefox and IE is to have a <tbody style="display:none;"> around the > rows to be hidden. > > So my question/proposal is: can we generate a <tbody> tag with the > appropriate xforms CSS classes instead of a <span> whenever an > <xforms:group> tag is embedded within a table? Or please enlighten me > if there's an alternative way to reliably show/hide table rows. Thanks > in advance. > > Larry T. Chen > Sr. Software Engineer > Intelenet Communications, Inc. Orbeon Forms - XForms Everywhere 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 |
Erik and Adrian,
Thank you for your replies. Based on your suggestions, I came up with a way to get it to work exactly how I want it (i.e. within the same table, having alternate row layouts for each element in a nodeset based on some condition), using the following: <xforms:repeat nodeset="some-element"> <xforms:repeat nodeset=".[some-condition]"> <xhtml:tr> .... </xhtml:tr> </xforms:repeat> <xforms:repeat nodeset=".[not (some-condition)]"> <xhtml:tr> .... </xhtml:tr> </xforms:repeat> </xforms:repeat> Larry Erik Bruchez 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 All,
This is a continuation of my earlier attempt to implement a table capable of rendering alternate row layouts for each element in a repeat nodeset based on some condition using this structure: <xforms:repeat nodeset="some-element"> <xforms:repeat nodeset=".[some-condition]"> <xhtml:tr> .... </xhtml:tr> </xforms:repeat> <xforms:repeat nodeset=".[not (some-condition)]"> <xhtml:tr> .... </xhtml:tr> </xforms:repeat> </xforms:repeat> I've implemented a sample form that uses this concept (see attached). However it appears to cause major problems when doing inserts. The form is designed to insert sections consisting of multiple table rows that have different layouts into a table. If you load up the form in the XForms Sandbox, you'll see that I made one section blue and the other section red. By pressing the "Add Invoice Item without Overage" button it should insert a blue section, and likewise by pressing the "Add Invoice Item with Overage" button it should insert a red section. However, when you press the Add buttons it also inserts extraneous junk, although it appears that the underlying XML is correct. (I've examined the submitted XML and it appears sound.) Unfortunately, the form becomes completely broken after you do the insert. The delete buttons don't seem to work either. According to earlier comments by Erik, this form should work since it's only using xf:repeat within xhtml:table. I really really need this to work. Please make this work Orbeon Gods! :-) 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 xforms-test.xhtml (7K) Download Attachment |
Administrator
|
Larry,
I was able to reproduce this. Here the corresponding bug entry: http://forge.objectweb.org/tracker/index.php?func=detail&aid=306456&group_id=168&atid=350207 Alex On 12/1/06, Larry T. Chen <[hidden email]> wrote: > Hi All, > > This is a continuation of my earlier attempt to implement a table > capable of rendering alternate row layouts for each element in a repeat > nodeset based on some condition using this structure: > > <xforms:repeat nodeset="some-element"> > > <xforms:repeat nodeset=".[some-condition]"> > <xhtml:tr> .... </xhtml:tr> > </xforms:repeat> > > <xforms:repeat nodeset=".[not (some-condition)]"> > <xhtml:tr> .... </xhtml:tr> > </xforms:repeat> > > </xforms:repeat> > > I've implemented a sample form that uses this concept (see attached). > However it appears to cause major problems when doing inserts. The form > is designed to insert sections consisting of multiple table rows that > have different layouts into a table. If you load up the form in the > XForms Sandbox, you'll see that I made one section blue and the other > section red. By pressing the "Add Invoice Item without Overage" button > it should insert a blue section, and likewise by pressing the "Add > Invoice Item with Overage" button it should insert a red section. > However, when you press the Add buttons it also inserts extraneous junk, > although it appears that the underlying XML is correct. (I've examined > the submitted XML and it appears sound.) Unfortunately, the form > becomes completely broken after you do the insert. The delete buttons > don't seem to work either. > > According to earlier comments by Erik, this form should work since it's > only using xf:repeat within xhtml:table. > > I really really need this to work. Please make this work Orbeon Gods! > :-) > > 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 > > > > -- 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 |
Administrator
|
Larry,
This bug is now fixed. -Erik Alessandro Vernet wrote: > Larry, > > I was able to reproduce this. Here the corresponding bug entry: > > http://forge.objectweb.org/tracker/index.php?func=detail&aid=306456&group_id=168&atid=350207 > > > Alex > > On 12/1/06, Larry T. Chen <[hidden email]> wrote: >> Hi All, >> >> This is a continuation of my earlier attempt to implement a table >> capable of rendering alternate row layouts for each element in a repeat >> nodeset based on some condition using this structure: >> >> <xforms:repeat nodeset="some-element"> >> >> <xforms:repeat nodeset=".[some-condition]"> >> <xhtml:tr> .... </xhtml:tr> >> </xforms:repeat> >> >> <xforms:repeat nodeset=".[not (some-condition)]"> >> <xhtml:tr> .... </xhtml:tr> >> </xforms:repeat> >> >> </xforms:repeat> >> >> I've implemented a sample form that uses this concept (see attached). >> However it appears to cause major problems when doing inserts. The form >> is designed to insert sections consisting of multiple table rows that >> have different layouts into a table. If you load up the form in the >> XForms Sandbox, you'll see that I made one section blue and the other >> section red. By pressing the "Add Invoice Item without Overage" button >> it should insert a blue section, and likewise by pressing the "Add >> Invoice Item with Overage" button it should insert a red section. >> However, when you press the Add buttons it also inserts extraneous junk, >> although it appears that the underlying XML is correct. (I've examined >> the submitted XML and it appears sound.) Unfortunately, the form >> becomes completely broken after you do the insert. The delete buttons >> don't seem to work either. >> >> According to earlier comments by Erik, this form should work since it's >> only using xf:repeat within xhtml:table. >> >> I really really need this to work. Please make this work Orbeon Gods! >> :-) >> >> Larry T. Chen >> Sr. Software Engineer >> Intelenet Communications, Inc. 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 |
Free forum by Nabble | Edit this page |