Nested fields in form-widgets

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Nested fields in form-widgets

Levenimeux
Hi all,

I'm trying (with my team) to build a new eCommerce webapp using OFBiz, and we're stuck with form-widgets, so here's the problem :

- Need : I have two related tables (many to many), Items and their categories, I need to display Items for each category a part using form-widgets. So definitely I need a nested loop to do so. Here's my question :
   --> How can we Iterate in a single field (in this case category) ?

Illustration :
<field>  //for each row we display all result rows of the inner field
      <field>
      </field>
      <field>
      </field>
</field> 

ThanX in advance :)
Reply | Threaded
Open this post in threaded view
|

Re: Nested fields in form-widgets

BJ Freeman
strikes me that the tree would be a way, maybe not as clean.

=========================
BJ Freeman
http://bjfreeman.elance.com
Strategic Power Office with Supplier Automation  <http://www.businessesnetwork.com/automation/viewforum.php?f=52>
Specialtymarket.com  <http://www.specialtymarket.com/>

Systems Integrator-- Glad to Assist

Chat  Y! messenger: bjfr33man
Linkedin
<http://www.linkedin.com/profile?viewProfile=&key=1237480&locale=en_US&trk=tab_pro>


Levenimeux sent the following on 6/19/2010 3:23 AM:

>
> Hi all,
>
> I'm trying (with my team) to build a new eCommerce webapp using OFBiz, and
> we're stuck with form-widgets, so here's the problem :
>
> - Need : I have two related tables (many to many), Items and their
> categories, I need to display Items for each category a part using
> form-widgets. So definitely I need a nested loop to do so. Here's my
> question :
>     -->  How can we Iterate in a single field (in this case category) ?
>
> Illustration :
> <field>   //for each row we display all result rows of the inner field
>        <field>
>        </field>
>        <field>
>        </field>
> </field>
>
> ThanX in advance :)

Reply | Threaded
Open this post in threaded view
|

Re: Nested fields in form-widgets

Atul Vani
In reply to this post by Levenimeux
Hi Levenimeux,

If you are so stuck with form-widget,
then you might wanna use
<field><display description="${groovy: org.ofbiz.....foo(arg1, arg2,
...)}" also-hidden="false"/></field>
and use some groovy to get your data in whatever format you need,
you can have look at ProductDetail.groovy which creates js code in a
variable and then returns it.

or a better way is to not use form-widget for this.

--
Thanks & Regards
Atul Vani
Enterprise Software Developer
HotWax Media Pvt. Ltd.
http://www.hotwaxmedia.com/
We are the Global Leaders in Apache OFBiz, Google 'ofbiz' and see for yourself.

Levenimeux wrote:

> Hi all,
>
> I'm trying (with my team) to build a new eCommerce webapp using OFBiz, and
> we're stuck with form-widgets, so here's the problem :
>
> - Need : I have two related tables (many to many), Items and their
> categories, I need to display Items for each category a part using
> form-widgets. So definitely I need a nested loop to do so. Here's my
> question :
>    --> How can we Iterate in a single field (in this case category) ?
>
> Illustration :
> <field>  //for each row we display all result rows of the inner field
>       <field>
>       </field>
>       <field>
>       </field>
> </field>  
>
> ThanX in advance :)
>  
Reply | Threaded
Open this post in threaded view
|

Re: Nested fields in form-widgets

Levenimeux
ThanX everyone for your replies, I'll start first by trees to avoid passing through groovy documentation and see, then if the later is the only solution.... I'll try it and let you know :)

Ps : if you have a recommandation for the best groovy eBook let me know (I'm quite familliar with "in action" series)

Thank you for your help, Realy appriciate :)