Hello everybody. First question from a newbie, sorry if it's stupid. I'm customizing a software that uses wickets, version 1.5.7. I have to add some behavior, and the only way the framework gives me is making me implement two callbacks, one that is supposed to contain the business logic, and one that returns a panel to be displayed. These callbacks are called only once, in this order.
This would be perfect if I only needed to show the results, but I also want to ask for user input, in particular I need modal confirmation dialogs. I tried putting all the business logic in the panel constructor or in a function called after the panel rendering (I know it sucks, but I don't see an alternative), and then using an Ajax Modal dialog. However, the modal dialog show() function requires an AjaxTarget, which is available only after a user action (click on a link, say). (Actually, I found online that I could use RequestCycle.get().find(AjaxRequestTarget.class), but it's not working for me). I can simulate a user clicking, using javascript, so I thought I'd put an invisible link and use that, but again I cannot do so inside the flow of the business logic (I managed only on page load...). What I need is to be able to show a dialog whenever I need, and to wait for a return value. I even tried linking the dialog display to an onchange handler of a hidden checkbox that I change through its model, but the event doesn't get triggered. Can anyone give a hand? :) M.
