Hi all,
I'm trying to register a custom property editor in my controller for a .jsp text input field with a name attribute that changes... and I'm having trouble writing the binder.registerCustomEditor() statement:
These code samples should help explain:
My .jsp:
Essentially the field name changes based on the index and becomesCode:<c:forEach var="buyerSeller" items="${BlockTrade.buyerSellers}" varStatus="status"> Broker: <input type="text" name="buyerSellers[<c:out value="${status.index}"/>].broker" value="some value" /></br> </p> </c:forEach>
buyerSellers[0].broker,
buyerSellers[1].broker,
buyerSellers[2].broker,
etc.,
etc.
The only binder.registerCustomEditor() statement I have gotten to work is as following:
Is there a way to register the custom property editor to the field in a single statement?Code:binder.registerCustomEditor(Broker.class, "buyerSellers[0].broker", customBrokerEditor); binder.registerCustomEditor(Broker.class, "buyerSellers[1].broker", customBrokerEditor); etc. etc. etc.


Reply With Quote