Thanks Jc, I employed that.

In addition, the model was inserting a DataTable that was fetching its data
from a DataProvider. So it was necessary to refresh not only the model but
the DataTable; so I separated the initialization of the DataTable as
follows:


        /*
         * Separating the initialization of the DataTable, as it will be 
updated by
Ajax Requests
         */
        public void onInitialize() {
                super.onInitialize();
                Component dataTable = get("productTable");
                if (dataTable != null) {
                        remove(dataTable);
                }
                add(getProductListing("productTable",
(ProductReference)getDefaultModel().getObject()));
        }



..and in the code mentioned pervious for the TODO: now I have:

                                        targetUpdatePanel.setVisible(true);
                                        targetUpdatePanel.modelChanging();
                                        targetUpdatePanel.setDefaultModel(new 
Model(prod));
                                        targetUpdatePanel.modelChanged();
                                        targetUpdatePanel.onInitialize();
                                        target.addComponent(targetUpdatePanel); 


..and It works. Maybe it can be more efficient & clean but its worked out. 
Thanks !
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Ajax-Panel-Update-tp3057421p3057739.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to