Best practices creating forms for multiple entities

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

Best practices creating forms for multiple entities

Matheus Eduardo Machado Moreira-3
    Hi, ofbiz community!

    I need some tips about best practices in creating forms (listing and
editing) for multiple entities. The context is the following. I use a
"clean" installation of ofbiz (don't use any features, entities or services
defined by applications and specialpurpose components). I defined two simple
entities: Product and Good. Good is a kind of Product and have a relation
(one) that maps its PK (Good.productId) to Product's PK (Product.productId).
Currently Good has only one field (its pk) and Product has other fields like
productName, supportDiscontinuationDate, etc.

    Given these entities, I want to create forms for listing and editing
Goods. What is the best approach? Do I have to create a view-entity for the
listing form? And what about the editing form? I'm thinking about placing
all the fields (Good and Product fields) into a single form and invoke a
createGood (or updateGood) service that uses similar services to create and
update Products.

    I use the framework's Example component as a reference to build my own
component. So, fell free to point some resources on that component and in
other components as well (I don't use applications and specialpurpose
components but their sources are available to me).

    Thanks in advance,

Matheus Eduardo Machado Moreira
[hidden email]

"Violence is the last refuge of the incompetent."
        Salvor Hardin (The Foundation, Isaac Asimov)
Reply | Threaded
Open this post in threaded view
|

Re: Best practices creating forms for multiple entities

BJ Freeman
not sure why you re-inventing the wheel.
however look at entity-view examples.
look in the products folder to see how what you are doing is accomplished.

Matheus Eduardo Machado Moreira sent the following on 11/13/2007 3:55 AM:

>     Hi, ofbiz community!
>
>     I need some tips about best practices in creating forms (listing and
> editing) for multiple entities. The context is the following. I use a
> "clean" installation of ofbiz (don't use any features, entities or services
> defined by applications and specialpurpose components). I defined two simple
> entities: Product and Good. Good is a kind of Product and have a relation
> (one) that maps its PK (Good.productId) to Product's PK (Product.productId).
> Currently Good has only one field (its pk) and Product has other fields like
> productName, supportDiscontinuationDate, etc.
>
>     Given these entities, I want to create forms for listing and editing
> Goods. What is the best approach? Do I have to create a view-entity for the
> listing form? And what about the editing form? I'm thinking about placing
> all the fields (Good and Product fields) into a single form and invoke a
> createGood (or updateGood) service that uses similar services to create and
> update Products.
>
>     I use the framework's Example component as a reference to build my own
> component. So, fell free to point some resources on that component and in
> other components as well (I don't use applications and specialpurpose
> components but their sources are available to me).
>
>     Thanks in advance,
>
> Matheus Eduardo Machado Moreira
> [hidden email]
>
> "Violence is the last refuge of the incompetent."
>         Salvor Hardin (The Foundation, Isaac Asimov)
>
Reply | Threaded
Open this post in threaded view
|

Re: Best practices creating forms for multiple entities

Matheus Eduardo Machado Moreira-3
    Thanks, BJ!

    Atenciosamente,

Matheus Eduardo Machado Moreira
[hidden email]

"Violence is the last refuge of the incompetent."
        Salvor Hardin (The Foundation, Isaac Asimov)

2007/11/13, BJ Freeman <[hidden email]>:

>
> not sure why you re-inventing the wheel.
> however look at entity-view examples.
> look in the products folder to see how what you are doing is accomplished.
>
> Matheus Eduardo Machado Moreira sent the following on 11/13/2007 3:55 AM:
> >     Hi, ofbiz community!
> >
> >     I need some tips about best practices in creating forms (listing and
> > editing) for multiple entities. The context is the following. I use a
> > "clean" installation of ofbiz (don't use any features, entities or
> services
> > defined by applications and specialpurpose components). I defined two
> simple
> > entities: Product and Good. Good is a kind of Product and have a
> relation
> > (one) that maps its PK (Good.productId) to Product's PK (
> Product.productId).
> > Currently Good has only one field (its pk) and Product has other fields
> like
> > productName, supportDiscontinuationDate, etc.
> >
> >     Given these entities, I want to create forms for listing and editing
> > Goods. What is the best approach? Do I have to create a view-entity for
> the
> > listing form? And what about the editing form? I'm thinking about
> placing
> > all the fields (Good and Product fields) into a single form and invoke a
> > createGood (or updateGood) service that uses similar services to create
> and
> > update Products.
> >
> >     I use the framework's Example component as a reference to build my
> own
> > component. So, fell free to point some resources on that component and
> in
> > other components as well (I don't use applications and specialpurpose
> > components but their sources are available to me).
> >
> >     Thanks in advance,
> >
> > Matheus Eduardo Machado Moreira
> > [hidden email]
> >
> > "Violence is the last refuge of the incompetent."
> >         Salvor Hardin (The Foundation, Isaac Asimov)
> >
>