why is DefaultNestedTree component treated as property within PropertyResolver ?
Hi, I'm trying to display a DefaultNestedTree (id="dataTreeView") within a Bootstrap Modal Instances of Service contain an ID that I use for retrieving a recursive data structure from database. The recursive structure is realized by instances of "RecursiveData" . See line 15 and method onModelChanged(). RecursiveData contains self referencing properties "parent" and "children" 00 import com.example.Service 00 01 public class DataViewDialog extends Modal 02 { 03 private static final long serialVersionUID = 7766394608644043929L; 04 05 @SpringBean 06 private RecursiveDataBean dataBean; 07 08 private RecursiveDataTreeProvider treeProvider; 09 10 public DataViewDialog(String id, IModel model) 11 { 12 super(id, model); 13 14 Service service = model.getObject(); 15 List data = dataBean.getRootDataByServiceId(service.getServiceId()); 16 17 BootstrapForm form = new BootstrapForm<>("form"); 18 add(form); 19 20 treeProvider = new RecursiveDataTreeProvider(data); 21 22 DefaultNestedTree tree = 23 new DefaultNestedTree("dataTreeView" 24 , treeProvider) 25 { 26 private static final long serialVersionUID = -7659715973883984412L; 27 28 @Override 29 protected Component newContentComponent(String id1 30 , IModel node) 31 { 32 return super.newContentComponent(id1, node); 33 } 34 }; 35 36 form.add(tree); 37 38 BootstrapAjaxButton close = new BootstrapAjaxButton("close" 39 , Model.of("schließen"), Buttons.Type.Primary) 40 { 41 private static final long serialVersionUID = 7877084020329862442L; 42 43 @Override 44 protected void onSubmit(AjaxRequestTarget target, Form form) 45 { 46 super.onSubmit(target, form); 47 appendCloseDialogJavaScript(target); 48 } 49 }; 50 form.add(close); 51 } 52 53 @Override 54 protected void onModelChanged() 55 { 56 super.onModelChanged(); 57 String serviceId = getModel().getObject().getServiceId(); 58 List newDataList = dataBean.getRootDataByServiceId(serviceId); 59 treeProvider.setRecursiveData(newDataList); 60 } 61 } I know from debugging that my implementation of ITreeProvider is working well, also after execution of "onModelChanged()". But when the tree is rendered, this error occurs: org.apache.wicket.WicketRuntimeException: Property could not be resolved for class: class com.example.Service expression: dataTreeView at org.apache.wicket.core.util.lang.PropertyResolver.getGetAndSet(PropertyResolver.java:393) at org.apache.wicket.core.util.lang.PropertyResolver.getObjectWithGetAndSet(PropertyResolver.java:355) at org.apache.wicket.core.util.lang.PropertyResolver.getObjectWithGetAndSet(PropertyResolver.java:261) at org.apache.wicket.core.util.lang.PropertyResolver.getValue(PropertyResolver.java:111) at org.apache.wicket.model.AbstractPropertyModel.getObject(AbstractPropertyModel.java:86) at org.apache.wicket.extensions.markup.html.repeater.tree.AbstractTree.getModelObject(AbstractTree.java:161) at org.apache.wicket.extensions.markup.html.repeater.tree.AbstractTree.getState(AbstractTree.java:240) at org.apache.wicket.extensions.markup.html.repeater.tree.nested.Subtree.isVisible(Subtree.java:136) Why does Wicket try to resolve a property that doesn't exist within "Service" ? I've tried a version without a BootstrapForm within the Modal, where "dataTreeView" is attached to the Modal directly. Same problem. Mit freundlichen Grüßen Ulrich Knaack Landesamt für Geoinformation und Landesvermessung Niedersachsen (LGLN) - Landesvermessung und Geobasisinformation - Landesbetrieb - Fachgebiet 224 - Geodateninfrastruktur Podbielskistraße 331, 30659 Hannover Tel.:+49 511 64609-287 Fax: +49 511 64609-161 mailto:ulrich.kna...@lgln.niedersachsen.de www.lgln.niedersachsen.de - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
reusable Panel with Delete-Button and Confirmation Dialog (Bootstrap Modal), issue with page refresh
Hi, I've created a reusable panel (DeleteObjectPanel.java) which contains a BootstrapAjaxButton for deleting database entries. After clicking the button, a Bootstrap Modal (ConfirmDeleteModal.java) appears for confirmation. Both are in the package example.confirm. MCVE is here: https://gitlab.com/UlrichK/pageRefreshAfterConfirmation.gitStart of application via test/java/example/Start.java I need this because in my application I have some BootstrapDefaultDataTables with deletion functionality. The DeleteObjectPanel is used in Customer3.java line 131 , during creation of a AbstractColumn. After the deletion is performed, the datatable is refreshed. But the hole page is disabled!!! See screenshot. If a replace target.add(filterForm); with target.add(filterForm, getPage()); the page gets refreshed, but I want to understand what is wrong in my code. This is were I use DeleteObjectPanel (The DataTable is a child component of filterForm"): columns.add( new AbstractColumn(new Model<>("Löschen")) { private static final long serialVersionUID = 1L; @Override public void populateItem(Item> cellItem, String componentId, IModel customerModel) { Customer customer = customerModel.getObject(); String customerInfo = "Kunde:\n" + customer.getName(); cellItem.add(new DeleteObjectPanel(componentId, customerInfo) { private static final long serialVersionUID = 2408937138549967444L; @Override protected void performDeletion(AjaxRequestTarget target) { //customerBean.deleteByUuid(customer.getBopUuid()); DatabaseLocator.getDatabase().delete(customerModel.getObject()); // Page is "disabled" completely target.add(filterForm); // THIS WORKS //target.add(filterForm, getPage()); } }); } }); Mit freundlichen Grüßen Ulrich Knaack Landesamt für Geoinformation und Landesvermessung Niedersachsen (LGLN) - Landesvermessung und Geobasisinformation - Landesbetrieb - Fachgebiet 224 - Geodateninfrastruktur Podbielskistraße 331, 30659 Hannover Tel.:+49 511 64609-287 Fax: +49 511 64609-161 mailto:ulrich.kna...@lgln.niedersachsen.de www.lgln.niedersachsen.de - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Modal dialog, form validation in AjaxBootstrapTabbedPanel
Hi Martin, sorry for late replying. Issues in another project prevented me from testing your hint. Using ClientSideBootstrapTabbedPanel solved my problem completely. I simply replaced "class MyAjaxTabbedPanel extends AjaxBootstrapTabbedPanel" with "class MyAjaxTabbedPanel extends ClientSideBootstrapTabbedPanel " and removed unnecessary methods. Then, wicket gave me useful hints related to a ClassCastException and to a missing call to tabbedPanel.setOutputMarkupId(true) . Thank you for quick response. Regards, Ulrich Knaack > -Ursprüngliche Nachricht- > Von: Martin Grigorov [mailto:mgrigo...@apache.org] > Gesendet: Mittwoch, 3. Mai 2017 15:04 > An: users@wicket.apache.org > Betreff: Re: Modal dialog, form validation in AjaxBootstrapTabbedPanel > > Hi, > > I think I see the problem. > When using AjaxBootstrapTabbedPanel the tabs' content is loaded one at a > time. This makes it hard to validate the complete form because not all > fields are available at any time. > You may need to use > https://github.com/l0rdn1kk0n/wicket-bootstrap/blob/wicket- > 7.x/bootstrap- > core/src/main/java/de/agilecoders/wicket/core/markup/html/bootstrap/ta > bs/ClientSideBootstrapTabbedPanel.java > instead. It will switch the tabs > via JavaScript and make the validation once you use the submit button. > If this doesn't help you then I'll try to take a look at your application > after work! > > Martin Grigorov > Wicket Training and Consulting > https://twitter.com/mtgrigorov > - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Modal dialog, form validation in AjaxBootstrapTabbedPanel - solved
Hi Martin, sorry for late replying. Issues in another project prevented me from testing your hint. Using ClientSideBootstrapTabbedPanel solved my problem completely. I simply replaced "class MyAjaxTabbedPanel extends AjaxBootstrapTabbedPanel" with "class MyAjaxTabbedPanel extends ClientSideBootstrapTabbedPanel " and removed unnecessary methods. Then, wicket gave me useful hints related to a ClassCastException and to a missing call to tabbedPanel.setOutputMarkupId(true) . Thank you for quick response. Regards, Ulrich Knaack > -Ursprüngliche Nachricht- > Von: Martin Grigorov [mailto:mgrigo...@apache.org] > Gesendet: Mittwoch, 3. Mai 2017 15:04 > An: users@wicket.apache.org > Betreff: Re: Modal dialog, form validation in AjaxBootstrapTabbedPanel > > Hi, > > I think I see the problem. > When using AjaxBootstrapTabbedPanel the tabs' content is loaded one at a > time. This makes it hard to validate the complete form because not all > fields are available at any time. > You may need to use > https://github.com/l0rdn1kk0n/wicket-bootstrap/blob/wicket- > 7.x/bootstrap- > core/src/main/java/de/agilecoders/wicket/core/markup/html/bootstrap/ta > bs/ClientSideBootstrapTabbedPanel.java > instead. It will switch the tabs > via JavaScript and make the validation once you use the submit button. > If this doesn't help you then I'll try to take a look at your application > after work! > > Martin Grigorov > Wicket Training and Consulting > https://twitter.com/mtgrigorov > - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org