Form-widget validation

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

Form-widget validation

Jacques Le Roux
Administrator
Despite that http://issues.apache.org/jira/browse/OFBIZ-147 is closed there is still a problem when a store is set with "Show Prices With Vat Tax" and there is no Tax Auhority set (or/and no Tax Geo Id I presume).
Willing to close this problem at source I'm searching for a way to prevent validation of the store param form if "Show Prices With Vat Tax" is set and there is no Tax Auhority or/and no Tax Geo Id set.
I agree that the problem above is not a big problem (setting stores is not a common task), actually I'm also looking for a more general solution for form-widget validation when fields are dependent of each other...

I looked in OpenSource Strategies form-widget cookbook but did not find an answer. Is there a trivial solution ?

Jacques
Reply | Threaded
Open this post in threaded view
|

Re: Form-widget validation

Jacopo Cappellato
Jacques,

I'd prefer to see this kind of validation done at service level
(create/updateProductStore).

Jacopo

Jacques Le Roux wrote:
> Despite that http://issues.apache.org/jira/browse/OFBIZ-147 is closed there is still a problem when a store is set with "Show Prices With Vat Tax" and there is no Tax Auhority set (or/and no Tax Geo Id I presume).
> Willing to close this problem at source I'm searching for a way to prevent validation of the store param form if "Show Prices With Vat Tax" is set and there is no Tax Auhority or/and no Tax Geo Id set.
> I agree that the problem above is not a big problem (setting stores is not a common task), actually I'm also looking for a more general solution for form-widget validation when fields are dependent of each other...
>
> I looked in OpenSource Strategies form-widget cookbook but did not find an answer. Is there a trivial solution ?
>
> Jacques
>

Reply | Threaded
Open this post in threaded view
|

Re: Form-widget validation

Jacques Le Roux
Administrator
Yes you are right !

Jacques

> Jacques,
>
> I'd prefer to see this kind of validation done at service level
> (create/updateProductStore).
>
> Jacopo
>
> Jacques Le Roux wrote:
> > Despite that http://issues.apache.org/jira/browse/OFBIZ-147 is closed there is still a problem when a store is set with "Show
Prices With Vat Tax" and there is no Tax Auhority set (or/and no Tax Geo Id I presume).
> > Willing to close this problem at source I'm searching for a way to prevent validation of the store param form if "Show Prices
With Vat Tax" is set and there is no Tax Auhority or/and no Tax Geo Id set.
> > I agree that the problem above is not a big problem (setting stores is not a common task), actually I'm also looking for a more
general solution for form-widget validation when fields are dependent of each other...
> >
> > I looked in OpenSource Strategies form-widget cookbook but did not find an answer. Is there a trivial solution ?
> >
> > Jacques
> >

Reply | Threaded
Open this post in threaded view
|

Forms question

Amit Shinde
Hello,
        I am using a form to display a list of items in a data grid. All items
under "Name" column in the grid are supposed to be a hyperlink. We need
different hyperlinks for each row depending on the type. Is there an if-else
ability in forms?

        Currently it is this way -

        <form type="list" name="products" list-name="productList"
default-title-style="tableheadtext" default-tooltip-style="tabletext"
                default-widget-style="table" paginate-target="ListProducts">

                <field name="productName" title="Name"
header-link="ListProducts?orderByField=productName&amp;productTypeId=OTHERS"
>
                        <hyperlink  description="${productName}"
target="EditProduct?productId=${productId}"/>
                </field>

        </form>


        Can we have something like this -

        <form type="list" name="products" list-name="productList"
default-title-style="tableheadtext" default-tooltip-style="tabletext"
                default-widget-style="table" paginate-target="ListProducts">

                <field name="productName" title="Name"
header-link="ListProducts?orderByField=productName&amp;productTypeId=OTHERS"
>
                        <if some condition>
                                <hyperlink  description="${productName}"
target="EditProduct?productId=${productId}"/>
                        <else>
                                <hyperlink  description="${productName}"
target="EditPrototype?productId=${productId}"/>
                        </else>
                        </if>
                </field>

        </form>

        Any pointers will be appreciated.


Thanks,
Amit Shinde


Reply | Threaded
Open this post in threaded view
|

Re: Forms question

cjhowe
there's a "use-when" attribute for fields.  There are
plenty of examples throughout the code.  otherwise you
can do a <row-action element to set variables so that
both cases can be written the same way.

--- Amit Shinde <[hidden email]> wrote:

> Hello,
> I am using a form to display a list of items in a
> data grid. All items
> under "Name" column in the grid are supposed to be a
> hyperlink. We need
> different hyperlinks for each row depending on the
> type. Is there an if-else
> ability in forms?
>
> Currently it is this way -
>
> <form type="list" name="products"
> list-name="productList"
> default-title-style="tableheadtext"
> default-tooltip-style="tabletext"
> default-widget-style="table"
> paginate-target="ListProducts">
>
> <field name="productName" title="Name"
>
header-link="ListProducts?orderByField=productName&amp;productTypeId=OTHERS"

> >
> <hyperlink  description="${productName}"
> target="EditProduct?productId=${productId}"/>
> </field>
>
> </form>
>
>
> Can we have something like this -
>
> <form type="list" name="products"
> list-name="productList"
> default-title-style="tableheadtext"
> default-tooltip-style="tabletext"
> default-widget-style="table"
> paginate-target="ListProducts">
>
> <field name="productName" title="Name"
>
header-link="ListProducts?orderByField=productName&amp;productTypeId=OTHERS"

> >
> <if some condition>
> <hyperlink  description="${productName}"
> target="EditProduct?productId=${productId}"/>
> <else>
> <hyperlink  description="${productName}"
> target="EditPrototype?productId=${productId}"/>
> </else>
> </if>
> </field>
>
> </form>
>
> Any pointers will be appreciated.
>
>
> Thanks,
> Amit Shinde
>
>
>