Warren, Unless you are indirectly calling load() yourself, eg by calling getObject(), on your LDM) during form processing it's Wicket converting the selected item (by choice id) to the actual "choice" object, by matching the id against the list of choices, calling load() on your LDM in the process.
This implies that you may be submitting the selected value from the list which is probably unnecessary if that particular submit is designed to just add a value to the choices' backing model (eg the List or table etc... you are deriving your list of choices from). One way to get around your issue would be to have your "Add an item to my list" button and, the associated component where you add that new list object, both on a separate form. Then, after that new form's submit, your LDM's load() should only be called during any rendering, which is probably what you want. Does that do it? Regards - Cemal jWeekend OO & Java Technologies, Wicket Training and Development http://jWeekend.com Warren Bell-3 wrote: > > I have a ListChoice that I add a choice to. I do this in an > AjaxButton#onSubmit(...). The problem is that load() has been called > before onSubmit() and I have to call LoadableDetachableMode#detach() > and have load() called again. This seems like a waste to have load() > called twice in order to get the new choice added to the ListChoice. Is > there a better way of doing this? > > Warren > > -- View this message in context: http://www.nabble.com/LoadableDetachableModel-load%28%29-called-twice-tp25082195p25085222.html Sent from the Wicket - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
