javascript - How to get label value from stripes:options-collection in java script or java -



javascript - How to get label value from stripes:options-collection in java script or java -

i using below code in jsp page. when submit want value label in java code. how this? getting null empname in java.

jsp code:

<stripes:form action="empmanager.action?changemanager" method="post" id="empform" name="changemanager"> <stripes:select class="selectmenu" name="empid" id="empid"> <stripes:option value="" selected="-- emp --">-- emp --</stripes:option> <stripes:options-collection collection="${actionbean.emplist}" label="empname" value="empid" /> </stripes:select> <a href="javascript:changeemp();" class="button right">submit</a> </stripes:form> function changestore() {alert(1); document.getelementbyid("empform").submit(); }

bean class :

@urlbinding("/empmanager.action") public class empactionbean extends basecdcactionbean { private string empid; private string empname; public resolution changemanager() { system.out.println("storeid :"+this.empid); system.out.println("storename :"+this.empname); something..... homecoming new forwardresolution(pages.empboard.getpageurl()); } }

there's not plenty code tell you're doing create emp object , in have id , name fields. simple bean getters , setters 2 fields, , default no-arg constructor constructor id , name. have getters , setters in action bean emp (or collection of emp). in jsp you'd utilize ${emp.name} , ${emp.id} you're using empname , empid.

https://stripesframework.atlassian.net/wiki/display/stripes/indexed+properties

https://stripesframework.atlassian.net/wiki/display/stripes/sample+application

stripes book

javascript jsp stripes

Comments

Popular posts from this blog

xslt - DocBook 5 to PDF transform failing with error: "fo:flow" is missing child elements. Required content model: marker* -

mediawiki - How do I insert tables inside infoboxes on Wikia pages? -

Local Service User Logged into Windows -