# <netui-data:choiceMethod> Tag

The <netui-data:choiceMethod> tag invokes a decision method on the basis of which a particular <netui-data:choice> tag is rendered.

## Syntax

<netui-data:choiceMethod
[failOnError="boolean_failOnError"]
[method="string_method"]
[object="string_object"]
[resultId="string_resultId"] />

## Description

The <netui-data:choiceMethod> tag invokes a decision method on the basis of which a particular <netui-data:choice> tag is rendered. The <netui-data:choiceMethod> tag makes its decision by invoking a method on an object. (Parameters are passed to the method from nested <netui-data:methodParameter> tags. The value of each of these parameters may be taken from the "current" data item using the expression `{container.item...}`.)

## Attributes

failOnError | Boolean. If set to true, any errors occuring while invoking the control method will be be reported in-line on the JSP page.
Required | Supports runtime expression evaluation | Data bindable
No | No | No
method | The name of the method to invoke
Required | Supports runtime expression evaluation | Data bindable
No | No | No
object | The object which contains the method to invoke.
Required | Supports runtime expression evaluation | Data bindable
No | No | Yes
resultId | The data returned by the method is loaded into the PageContext object, under this property name.
Required | Supports runtime expression evaluation | Data bindable
No | No | No

## Sample

In the following example, the <netui-data:choiceMethod> tag calls the `isItemsOnSale` method, which returns a boolean value. If the return value is true, then the contents of the <netui-data:choice value="true"> tag are rendered; if the return value is false, then the contents of the <netui-data:choice value="false"> tag are rendered.

              <netui-data:repeaterItem>
                 <netui-data:choiceMethod object="{pageFlow}" method="isItemOnSale">
                     <netui-data:methodParameter value="{container.item.quantityavailable}"/>
                 </netui-data:choiceMethod>
                 <netui-data:choice value="true">
                     <tr class="row" bgcolor="#FF9999">
                         <td><netui:label value="{container.item.itemnumber}"/></td>
                         <td><netui:label value="{container.item.itemname}"/></td>
                         <td><netui:label value="{container.item.quantityavailable}"/></td>
                         <td><netui:label value="{container.item.price}"/> Clearance Item</td>
                      </tr>
                 </netui-data:choice>
                 <netui-data:choice value="false">
                     <tr class="row">
                         <td><netui:label value="{container.item.itemnumber}"/></td>
                         <td><netui:label value="{container.item.itemname}"/></td>
                         <td><netui:label value="{container.item.quantityavailable}"/></td>
                         <td><netui:label value="{container.item.price}"/></td>
                     </tr>
                 </netui-data:choice>
              </netui-data:repeaterItem>

## Sample Code

[BEA_HOME]\weblogic81\samples\workshop\SamplesApp\WebApp\tagSamples\netui_databinding\choice

## Related Topics

<netui-data:choice> Tag Sample

<netui-data:choice> Tag

Presenting Complex Data Sets in JSPs (Repeater Tags section)