You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Josema Alonso <al...@aafunky.com> on 2002/11/09 19:40:31 UTC

XMLForm - xf:repeat tag on DOM Nodes?

Dear all,

I see in thw wizrd demo how the repeat tag is used like this:
<xf:repeat nodeset="favorite[position() &lt;= 3]" id="favorites">
 <xf:textbox ref="." class="info">
  <xf:caption>URL: </xf:caption>
 </xf:textbox>
</xf:repeat>

In the model bean the favorite is implemented as an array list, so you can
iterate through it using the position function and specifying how many items
to display.

Well, now I got a part of my model implmented as a DOM Node. It seems it'w
working right but I can't make the repeat tag to work with it. Let's say I
have something like this:
<product>
    <description lang="en">nice table</description>
    <description lang="es">mesa bonita</description>
</product>

I want to display as many textboxes as descriptions, ok? I have tried this,
but unfortunately it is not working. :
<xf:repeat nodeset="/productNode/product">
 <xf:textbox ref="description/@lang">
  <xf:caption>Language (code):</xf:caption>
  <xf:violations class="error"/>
 </xf:textbox>
 <xf:textbox ref="description">
  <xf:caption>Description:</xf:caption>
  <xf:violations class="error"/>
 </xf:textbox>
</xf:repeat>

If I try to access just one description node outside the repeat tag, I get
the info correctly. Any ideas?

Thanks.


---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>


RE: Dynamic models in XMLForms - was: Re: XMLForm - xf:repeat tag on DOM Nodes?

Posted by Josema Alonso <al...@aafunky.com>.
>It needs further clarification before we can start design.
>Hopefully other people who asked for this feature will add a few more use
>cases.

I know, thank you.

Btw, what about filling a DOM node in the model from outside?
For example, I'm using Xindice, and there's that nice pseudo protocol
working on Cocoon.

I would like to query the DB using the pseudo protocol. It returns me a
collection. Now I want to feed the Form with this collection. A first
approach would be to load the collection in a DOM node for example. But I
can't see how I could do it, maybe with a sitemap parameter? May I load that
result there and then get it in the action in the act method?
The alternative is to query the DB directly inside the model or the action
and load the values, but I think it is a worse approach.

Well, that would be a first step. The second would be to have the model
empty. Then, after loading the coleection, properties would be 'created at
runtime' for every element. I do not know if it would be possible, but it
sounds too hard to me. Just a random idea...

Best.


---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>


Re: Dynamic models in XMLForms - was: Re: XMLForm - xf:repeat tag on DOM Nodes?

Posted by Ivelin Ivanov <iv...@apache.org>.
Thank you.

It needs further clarification before we can start design.
Hopefully other people who asked for this feature will add a few more use
cases.


Ivelin



----- Original Message -----
From: "Josema Alonso" <al...@aafunky.com>
To: "Cocoon-Users" <co...@xml.apache.org>
Sent: Monday, November 11, 2002 10:12 AM
Subject: Dynamic models in XMLForms - was: Re: XMLForm - xf:repeat tag on
DOM Nodes?


> > Yes. This has been requested multiple times.
> > Please open a feature request ticket in Bugzilla and describe with a few
> > detailed use cases, what is it exactly that you would like to have.
> > Others will add their thoughts to the ticket and someone (maybe I) will
> > eventually implement it.
>
> I've done it. I hope I did it well.
> http://nagoya.apache.org/bugzilla/show_bug.cgi?id=14450
>
> Thank you very much for your help.
>
>
>
> ---------------------------------------------------------------------
> Please check that your question  has not already been answered in the
> FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>
>
> To unsubscribe, e-mail:     <co...@xml.apache.org>
> For additional commands, e-mail:   <co...@xml.apache.org>
>


---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>


Dynamic models in XMLForms - was: Re: XMLForm - xf:repeat tag on DOM Nodes?

Posted by Josema Alonso <al...@aafunky.com>.
> Yes. This has been requested multiple times.
> Please open a feature request ticket in Bugzilla and describe with a few
> detailed use cases, what is it exactly that you would like to have.
> Others will add their thoughts to the ticket and someone (maybe I) will
> eventually implement it.

I've done it. I hope I did it well.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=14450

Thank you very much for your help.



---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>


Re: XMLForm - xf:repeat tag on DOM Nodes?

Posted by Ivelin Ivanov <iv...@apache.org>.
----- Original Message -----
From: "Josema Alonso" <al...@aafunky.com>
To: <co...@xml.apache.org>
Sent: Saturday, November 09, 2002 6:32 PM
Subject: Re: XMLForm - xf:repeat tag on DOM Nodes?


> Stupid me, I sent the code snippet before fix it. That's what I meant
> exactly, and it's working good. I just had some incorrect mappings in the
> model.
>
> You know? It took me a lot of time to understand this whole XMLForms
thingie
> of you. Now that it seems I know what I'm doing I must say I really like
> this approach to forms. Thanks you very much for providing it :-)
>
> Btw, some people are missing a dynamic model, I mean, they say you must
> create it before hand. It would be pretty nice to see it in a next
version,
> sometime, but I can say to those, that using DOM nodes and documents and
> manipulating them inside the action, can give a lot of power to make
things
> dynamic :-)


Yes. This has been requested multiple times.
Please open a feature request ticket in Bugzilla and describe with a few
detailed use cases, what is it exactly that you would like to have.
Others will add their thoughts to the ticket and someone (maybe I) will
eventually implement it.


Thanks,

Ivelin



>
> Thanks again.
>
> ----- Original Message -----
> From: "Ivelin Ivanov" <iv...@apache.org>
> To: <co...@xml.apache.org>
> Sent: Saturday, November 09, 2002 8:15 PM
> Subject: Re: XMLForm - xf:repeat tag on DOM Nodes?
>
>
> >
> > You probably meant to use:
> >
> >
> >  <xf:repeat nodeset="/productNode/product/description">
> >   <xf:textbox ref="@lang">
> >    <xf:caption>Language (code):</xf:caption>
> >    <xf:violations class="error"/>
> >   </xf:textbox>
> >   <xf:textbox ref=".">
> >    <xf:caption>Description:</xf:caption>
> >    <xf:violations class="error"/>
> >   </xf:textbox>
> >  </xf:repeat>
> >
> > I would also recommend that you use the standard xml:lang attribute
> instead
> > of a non-qualified one.
> >
> >
> >
> > Ivelin
> >
> >
> >
> >
> > ----- Original Message -----
> > From: "Josema Alonso" <al...@aafunky.com>
> > To: "Cocoon-Users" <co...@xml.apache.org>
> > Sent: Saturday, November 09, 2002 12:40 PM
> > Subject: XMLForm - xf:repeat tag on DOM Nodes?
> >
> >
> > > Dear all,
> > >
> > > I see in thw wizrd demo how the repeat tag is used like this:
> > > <xf:repeat nodeset="favorite[position() &lt;= 3]" id="favorites">
> > >  <xf:textbox ref="." class="info">
> > >   <xf:caption>URL: </xf:caption>
> > >  </xf:textbox>
> > > </xf:repeat>
> > >
> > > In the model bean the favorite is implemented as an array list, so you
> can
> > > iterate through it using the position function and specifying how many
> > items
> > > to display.
> > >
> > > Well, now I got a part of my model implmented as a DOM Node. It seems
> it'w
> > > working right but I can't make the repeat tag to work with it. Let's
say
> I
> > > have something like this:
> > > <product>
> > >     <description lang="en">nice table</description>
> > >     <description lang="es">mesa bonita</description>
> > > </product>
> > >
> > > I want to display as many textboxes as descriptions, ok? I have tried
> > this,
> > > but unfortunately it is not working. :
> > > <xf:repeat nodeset="/productNode/product">
> > >  <xf:textbox ref="description/@lang">
> > >   <xf:caption>Language (code):</xf:caption>
> > >   <xf:violations class="error"/>
> > >  </xf:textbox>
> > >  <xf:textbox ref="description">
> > >   <xf:caption>Description:</xf:caption>
> > >   <xf:violations class="error"/>
> > >  </xf:textbox>
> > > </xf:repeat>
> > >
> > > If I try to access just one description node outside the repeat tag, I
> get
> > > the info correctly. Any ideas?
> > >
> > > Thanks.
> > >
> > >
> > > ---------------------------------------------------------------------
> > > Please check that your question  has not already been answered in the
> > > FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>
> > >
> > > To unsubscribe, e-mail:     <co...@xml.apache.org>
> > > For additional commands, e-mail:   <co...@xml.apache.org>
> > >
> >
> >
> > ---------------------------------------------------------------------
> > Please check that your question  has not already been answered in the
> > FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>
> >
> > To unsubscribe, e-mail:     <co...@xml.apache.org>
> > For additional commands, e-mail:   <co...@xml.apache.org>
> >
>
>
> ---------------------------------------------------------------------
> Please check that your question  has not already been answered in the
> FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>
>
> To unsubscribe, e-mail:     <co...@xml.apache.org>
> For additional commands, e-mail:   <co...@xml.apache.org>
>


---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>


Re: XMLForm - xf:repeat tag on DOM Nodes?

Posted by Josema Alonso <al...@aafunky.com>.
Stupid me, I sent the code snippet before fix it. That's what I meant
exactly, and it's working good. I just had some incorrect mappings in the
model.

You know? It took me a lot of time to understand this whole XMLForms thingie
of you. Now that it seems I know what I'm doing I must say I really like
this approach to forms. Thanks you very much for providing it :-)

Btw, some people are missing a dynamic model, I mean, they say you must
create it before hand. It would be pretty nice to see it in a next version,
sometime, but I can say to those, that using DOM nodes and documents and
manipulating them inside the action, can give a lot of power to make things
dynamic :-)

Thanks again.

----- Original Message -----
From: "Ivelin Ivanov" <iv...@apache.org>
To: <co...@xml.apache.org>
Sent: Saturday, November 09, 2002 8:15 PM
Subject: Re: XMLForm - xf:repeat tag on DOM Nodes?


>
> You probably meant to use:
>
>
>  <xf:repeat nodeset="/productNode/product/description">
>   <xf:textbox ref="@lang">
>    <xf:caption>Language (code):</xf:caption>
>    <xf:violations class="error"/>
>   </xf:textbox>
>   <xf:textbox ref=".">
>    <xf:caption>Description:</xf:caption>
>    <xf:violations class="error"/>
>   </xf:textbox>
>  </xf:repeat>
>
> I would also recommend that you use the standard xml:lang attribute
instead
> of a non-qualified one.
>
>
>
> Ivelin
>
>
>
>
> ----- Original Message -----
> From: "Josema Alonso" <al...@aafunky.com>
> To: "Cocoon-Users" <co...@xml.apache.org>
> Sent: Saturday, November 09, 2002 12:40 PM
> Subject: XMLForm - xf:repeat tag on DOM Nodes?
>
>
> > Dear all,
> >
> > I see in thw wizrd demo how the repeat tag is used like this:
> > <xf:repeat nodeset="favorite[position() &lt;= 3]" id="favorites">
> >  <xf:textbox ref="." class="info">
> >   <xf:caption>URL: </xf:caption>
> >  </xf:textbox>
> > </xf:repeat>
> >
> > In the model bean the favorite is implemented as an array list, so you
can
> > iterate through it using the position function and specifying how many
> items
> > to display.
> >
> > Well, now I got a part of my model implmented as a DOM Node. It seems
it'w
> > working right but I can't make the repeat tag to work with it. Let's say
I
> > have something like this:
> > <product>
> >     <description lang="en">nice table</description>
> >     <description lang="es">mesa bonita</description>
> > </product>
> >
> > I want to display as many textboxes as descriptions, ok? I have tried
> this,
> > but unfortunately it is not working. :
> > <xf:repeat nodeset="/productNode/product">
> >  <xf:textbox ref="description/@lang">
> >   <xf:caption>Language (code):</xf:caption>
> >   <xf:violations class="error"/>
> >  </xf:textbox>
> >  <xf:textbox ref="description">
> >   <xf:caption>Description:</xf:caption>
> >   <xf:violations class="error"/>
> >  </xf:textbox>
> > </xf:repeat>
> >
> > If I try to access just one description node outside the repeat tag, I
get
> > the info correctly. Any ideas?
> >
> > Thanks.
> >
> >
> > ---------------------------------------------------------------------
> > Please check that your question  has not already been answered in the
> > FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>
> >
> > To unsubscribe, e-mail:     <co...@xml.apache.org>
> > For additional commands, e-mail:   <co...@xml.apache.org>
> >
>
>
> ---------------------------------------------------------------------
> Please check that your question  has not already been answered in the
> FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>
>
> To unsubscribe, e-mail:     <co...@xml.apache.org>
> For additional commands, e-mail:   <co...@xml.apache.org>
>


---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>


Re: XMLForm - xf:repeat tag on DOM Nodes?

Posted by Ivelin Ivanov <iv...@apache.org>.
You probably meant to use:


 <xf:repeat nodeset="/productNode/product/description">
  <xf:textbox ref="@lang">
   <xf:caption>Language (code):</xf:caption>
   <xf:violations class="error"/>
  </xf:textbox>
  <xf:textbox ref=".">
   <xf:caption>Description:</xf:caption>
   <xf:violations class="error"/>
  </xf:textbox>
 </xf:repeat>

I would also recommend that you use the standard xml:lang attribute instead
of a non-qualified one.



Ivelin




----- Original Message -----
From: "Josema Alonso" <al...@aafunky.com>
To: "Cocoon-Users" <co...@xml.apache.org>
Sent: Saturday, November 09, 2002 12:40 PM
Subject: XMLForm - xf:repeat tag on DOM Nodes?


> Dear all,
>
> I see in thw wizrd demo how the repeat tag is used like this:
> <xf:repeat nodeset="favorite[position() &lt;= 3]" id="favorites">
>  <xf:textbox ref="." class="info">
>   <xf:caption>URL: </xf:caption>
>  </xf:textbox>
> </xf:repeat>
>
> In the model bean the favorite is implemented as an array list, so you can
> iterate through it using the position function and specifying how many
items
> to display.
>
> Well, now I got a part of my model implmented as a DOM Node. It seems it'w
> working right but I can't make the repeat tag to work with it. Let's say I
> have something like this:
> <product>
>     <description lang="en">nice table</description>
>     <description lang="es">mesa bonita</description>
> </product>
>
> I want to display as many textboxes as descriptions, ok? I have tried
this,
> but unfortunately it is not working. :
> <xf:repeat nodeset="/productNode/product">
>  <xf:textbox ref="description/@lang">
>   <xf:caption>Language (code):</xf:caption>
>   <xf:violations class="error"/>
>  </xf:textbox>
>  <xf:textbox ref="description">
>   <xf:caption>Description:</xf:caption>
>   <xf:violations class="error"/>
>  </xf:textbox>
> </xf:repeat>
>
> If I try to access just one description node outside the repeat tag, I get
> the info correctly. Any ideas?
>
> Thanks.
>
>
> ---------------------------------------------------------------------
> Please check that your question  has not already been answered in the
> FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>
>
> To unsubscribe, e-mail:     <co...@xml.apache.org>
> For additional commands, e-mail:   <co...@xml.apache.org>
>


---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>