You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ofbiz.apache.org by Amit Shinde <am...@amicontech.com> on 2006/10/11 14:43:57 UTC

Forms question

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: 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
> 
> 
>