I'm using dynamic objects. In the first way based on the some event (e.g. tree node selection) I want to setup this MagicObject in home page, and then to show panel. Between these two there should be a call of getMagicObject() from the panel.
How can I set this happen in appropriate moment?
In the third example, I'm not sure how I can send a Model to the Panel. Can you give me some small example?
> I'm using dynamic objects. In the first way based on the some event (e.g.
> tree node selection) I want to setup this MagicObject in home page, and then
> to show panel. Between these two there should be a call of getMagicObject()
> from the panel.
> How can I set this happen in appropriate moment?
I don't understand what you mean with appropriate moment if you do it
sequentially assuming there is only one thread operating.
> In the third example, I'm not sure how I can send a Model to the Panel. Can
> you give me some small example?
I can give you an example, but currently I don't exactly understand
your use-case. What is your use case?
Is the modal panel on home page? In that case home page is the one
that opens the modal panel so you can pass (set/constructor
argument/override getter) anything when you open the modal panel and
when you close the modal panel you can get the result if you need it.
If it is a longer term data you can store it into the session.
A modal panel can be treated same way as any other wicket component,
label for example. How to pass model to label? Simply
new Label("wicket-id", dynamicModel);
For modal window it is the same. You create the modal window panel
when you open it. If you want to create the panel before opening it
then you must pass it a dynamicModel whose value is correct when it is
opened (it is set somewhere) or you must appropriately set it in the
open-event. What is the open event? Yes, it is when you call
modalWindow.show(); so you can then call
I hope this helps ;) If you give an exact use case I can answer more precisely.
That's what I have tried first, but for some reason it didn't worked than so I started to work on some other more complex solution.
Now I turned again to this simple idea and it works.