You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ofbiz.apache.org by Jacques Le Roux <ja...@les7arts.com> on 2006/10/11 09:44:07 UTC

Form-widget validation

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

Re: Forms question

Posted by Chris Howe <cj...@yahoo.com>.
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 <am...@amicontech.com> 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
> 
> 
> 


Forms question

Posted by Amit Shinde <am...@amicontech.com>.
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



Re: Form-widget validation

Posted by Jacques Le Roux <ja...@les7arts.com>.
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
> >


Re: Form-widget validation

Posted by Jacopo Cappellato <ti...@sastau.it>.
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
>