tags:

views:

54

answers:

1

I have Search Criteria, like seachOn dropdown, matchoption dropdown, seachcontent text box, then find button. In this if i click find these criteria is used to fetch the results from the database. Bu i need to add some more criteria by clicking addFilter link..It seems like adding multiple seach critera by dynamic. How could i achieve this? and idea? Only Struts2,Jquery.i can use display tag if necessary.

    <s:action name="getFilterOptionsDropDown" id="actFilOption"></s:action>
    <s:action name="getPropertyInfoDropDown" id="actPropertyInfo"></s:action>

    <s:select cssClass="drop" name="filterCondtion.attributeName"
            list="#actPropertyInfo.lstEntities" listKey="code" listValue="value"></s:select>&nbsp;

<s:select cssClass="drop" name="filterCondtion.filterOption"
            list="#actFilOption.lstEntities" listKey="code" listValue="value"></s:select>&nbsp;

<s:textfield name="filterCondtion.attributeValue" cssClass="textbx" />&nbsp; 
    <a href="#"><strong><s:text name="common.addFilter" /></strong></a>&nbsp;

<s:submit cssClass="btn" name="button.find" key="button.find" />
<input type="reset" value="<s:text name="button.reset"/>" class=btn />

Please help on this.It is very urgent.

A: 
<td id="filters"><s:iterator id="filterCondtion" status="status"
                value="filterCondtion">
                <s:select cssClass="drop"
                    name="filterCondtion[%{#status.index}].attributeName"
                    list="#actPropertyInfo.lstEntities" listKey="code"
                    listValue="value"></s:select> &nbsp; <s:select cssClass="drop"
                    name="filterCondtion[%{#status.index}].filterOption"
                    list="#actFilOption.lstEntities" listKey="code" listValue="value"></s:select>
                    &nbsp; <s:textfield
                    name="filterCondtion[%{#status.index}].attributeValue"
                    cssClass="textbx" />&nbsp;

                        </s:iterator>

And List filterCondtion property in action with normat getters and setters method.

Jothi