java - Displaying dropdown list depends on selected value from other list -
i working on project in spring mvc 4 , should display 3 dropdown lists second list depends on selected value first list , third on selected value in second list.
i have defined enum:
public enum type{ a{ getlistofsubtypes(){...}; getlistofobjectsbysubtype(objectlist subtype){...}; }, b{ getlistofsubtypes(){...}; getlistofobjectsbysubtype(objectlist subtype){...}; c{ getlistofsubtypes(){...}; getlistofobjectsbysubtype(objectlist subtype){...}; } };
getlistofsubtypes produce list of sub types. getlistofobjectsbysubtype produce list of objects sub types.
is there way fetch directly in jsp file subtypes , objects type accordingly chosen type? or should have perform conversions in model?
the first dropdown displays "a,b,c" list expected by:
<form:select class="form-control input-sm" path="task.type"> <form:options items="${types}"/> </form:select>
means, page have 3 dropdons: type: a,b,c -> user choose type b. subtypes: in case of type 'b', list 4,5,6 objects: in case of sub type '6', list o7,o8.
thanks in advance, mike
Comments
Post a Comment