Announcement Announcement Module
Collapse
No announcement yet.
onChange event for dropdown combo in select.tagx Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • onChange event for dropdown combo in select.tagx

    Hi there,

    I'm new in Spring Roo and encounter some problem. On the form I have combo(dropdown) field with values, which should be used for filtering on list.jspx. but I need to filter the list dynamically after choosing the value from select combo(without pushing find_button). My code is:

    list.jspx

    <form:find finderName="ByFilters" path="/userdata" z="" id="ff_context_user_UserData">
    <field:select field="isBlocked" disableFormBinding="true" addEmptyItem="true" required="false"
    itemValue="status" itemLabel="description" items="${userdatastatuses}" onChange="true"
    path="/userdatastatuses" z="" id="f_context_user_user_UserData_status"/>
    </form:find>

    select.tagx:

    <jsp:directive.attribute name="onChange" type="java.lang.Boolean" required="false" rtexprvalue="true" description="Default false. Add submit for onChange event" />

    <c:if test="${empty onChange}">
    <c:set value="false" var="onChange" />
    </c:if>

    <c:choose>
    <c:when test="${multiple == false}">
    <c:choose>
    <c:when test="${onChange}">
    <script type="text/javascript">
    Spring.addDecoration(new Spring.ElementDecoration({
    elementId : '_${sec_field}_id',
    widgetType: 'dijit.form.FilteringSelect',
    widgetAttrs : {hasDownArrow : true ,onChange:
    function(newValue){
    alert('onChange is running');
    }
    }}));
    </script>
    </c:when>
    </c:choose>
    <c:otherwise>
    <script type="text/javascript">Spring.addDecoration(new Spring.ElementDecoration({elementId : '_${sec_field}_id', widgetType: 'dijit.form.FilteringSelect', widgetAttrs : {hasDownArrow : true}})); </script>
    </c:otherwise>
    </c:when>
    </c:choose>

    So alert is executed, but I need the action like find_button:
    find.tagx

    <spring:message code="button_find" var="find_button" htmlEscape="false" />
    <script type="text/javascript">Spring.addDecoration(new Spring.ValidateAllDecoration({elementId:'proceed', event:'onclick'}));</script>
    <input id="proceed" type="submit" value="${fn:escapeXml(find_button)}"/>

    Could anybody help me?
    Thanks,
    Yuri T.
Working...
X