On Thu, Aug 27, 2015 at 12:02 PM, Marco Di Sabatino Di Diodoro < [email protected]> wrote:
> Hi Martin, > > > Il 24/08/2015 22:06, Martin Grigorov ha scritto: > >> Hi, >> >> On Mon, Aug 24, 2015 at 4:05 PM, Marco Di Sabatino Di Diodoro < >> [email protected]> wrote: >> >> Hi Martin, >>> >>> Il 24/08/2015 12:16, Martin Grigorov ha scritto: >>> >>> Hi, >>>> >>>> 1. File an issue so that becomes more user friendly. >>>> >>>> I opened the issue on git >>> >>> 2. You can roll MyModal that extends from Modal and has MyModal.html with >>> >>>> the extra components in header and footer. In MyModal#onInitialize() you >>>> can use get("header").add(anExtraHeaderComponent) >>>> >>>> I followed your suggestion and I added a new button in the footer. At >>> first time I can see my Modal. If I close and reopen I have this >>> exception: >>> org.apache.wicket.markup.MarkupNotFoundException: Failed to find markup >>> file associated >>> >>> If I remove my button, I can open and close without problems. >>> >> Without giving us more information (e.g. code and/or stacktrace) we cannot >> tell you what is wrong. >> > here is my source code. > > public class BaseModal<T> extends Modal<T> { > ... > ... > public BaseModal(final String id) { > super(id); > container = new WebMarkupContainer("container"); > container.add(new EmptyPanel(CONTENT)); > container.setOutputMarkupId(true); > add(container); > } > > @Override > public MarkupContainer addOrReplace(final Component... component) { > return container.addOrReplace(component); > } > > public static String getModalContentId() { > return CONTENT; > } > } > > BaseModal.html > > <html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket=" > http://wicket.apache.org"> > <wicket:panel> > <div class="modal-dialog" wicket:id="dialog"> > <div class="modal-content"> > <div wicket:id="header" class="modal-header"> > <button type="button" class="close" data-dismiss="modal" > aria-hidden="true">×</button> > <h4 wicket:id="header-label" class="modal-title">Modal > header</h4> > </div> > <div class="modal-body"> > <div wicket:id="container"> > <span wicket:id="modalContent">[modalContent]</span> > </div> > </div> > <div class="modal-footer"> > <span wicket:id="footer"> > <wicket:fragment wicket:id="buttons"> > <button type="button" wicket:id="button"></button> > </wicket:fragment> > </span> > </div> > </div> > </div> > </wicket:panel> > </html> > > If I close and reopen I have this exception: > > > org.apache.wicket.markup.MarkupNotFoundException: Failed to find markup > file associated. RealmModalPanel: [RealmModalPanel [Component id = > modalContent]] > The error message says "RealmModalPanel.html" cannot be found. > at > org.apache.wicket.markup.html.panel.AssociatedMarkupSourcingStrategy.getMarkup(AssociatedMarkupSourcingStrategy.java:98) > ~[wicket-core-7.0.0.jar:7.0.0] > at > org.apache.wicket.MarkupContainer.getMarkup(MarkupContainer.java:453) > ~[wicket-core-7.0.0.jar:7.0.0] > at org.apache.wicket.Component.getMarkup(Component.java:755) > ~[wicket-core-7.0.0.jar:7.0.0] > at org.apache.wicket.Component.getMarkupTag(Component.java:1438) > ~[wicket-core-7.0.0.jar:7.0.0] > at > org.apache.wicket.Component.getMarkupAttributes(Component.java:1467) > ~[wicket-core-7.0.0.jar:7.0.0] > at > org.apache.wicket.ajax.form.AjaxFormSubmitBehavior.updateAjaxAttributes(AjaxFormSubmitBehavior.java:148) > ~[wicket-core-7.0.0.jar:7.0.0] > at > org.apache.wicket.ajax.markup.html.form.AjaxSubmitLink$1.updateAjaxAttributes(AjaxSubmitLink.java:103) > ~[wicket-core-7.0.0.jar:7.0.0] > at > org.apache.wicket.ajax.AbstractDefaultAjaxBehavior.getAttributes(AbstractDefaultAjaxBehavior.java:146) > ~[wicket-core-7.0.0.jar:7.0.0] > at > org.apache.wicket.ajax.AbstractDefaultAjaxBehavior.renderExtraHeaderContributors(AbstractDefaultAjaxBehavior.java:119) > ~[wicket-core-7.0.0.jar:7.0.0] > at > org.apache.wicket.ajax.AbstractDefaultAjaxBehavior.renderHead(AbstractDefaultAjaxBehavior.java:104) > ~[wicket-core-7.0.0.jar:7.0.0] > at > org.apache.wicket.ajax.AjaxEventBehavior.renderHead(AjaxEventBehavior.java:90) > ~[wicket-core-7.0.0.jar:7.0.0] > at > org.apache.wicket.Component.internalRenderHead(Component.java:2726) > ~[wicket-core-7.0.0.jar:7.0.0] > at > org.apache.wicket.markup.renderStrategy.ChildFirstHeaderRenderStrategy$1.component(ChildFirstHeaderRenderStrategy.java:85) > ~[wicket-core-7.0.0.jar:7.0.0] > at > org.apache.wicket.markup.renderStrategy.DeepChildFirstVisitor.visit(DeepChildFirstVisitor.java:96) > ~[wicket-core-7.0.0.jar:7.0.0] > at > org.apache.wicket.markup.renderStrategy.DeepChildFirstVisitor.visit(DeepChildFirstVisitor.java:87) > ~[wicket-core-7.0.0.jar:7.0.0] > at > org.apache.wicket.markup.renderStrategy.DeepChildFirstVisitor.visit(DeepChildFirstVisitor.java:87) > ~[wicket-core-7.0.0.jar:7.0.0] > at > org.apache.wicket.markup.renderStrategy.DeepChildFirstVisitor.visit(DeepChildFirstVisitor.java:87) > ~[wicket-core-7.0.0.jar:7.0.0] > at > org.apache.wicket.markup.renderStrategy.DeepChildFirstVisitor.visit(DeepChildFirstVisitor.java:87) > ~[wicket-core-7.0.0.jar:7.0.0] > at > org.apache.wicket.markup.renderStrategy.DeepChildFirstVisitor.visit(DeepChildFirstVisitor.java:87) > ~[wicket-core-7.0.0.jar:7.0.0] > at > org.apache.wicket.markup.renderStrategy.DeepChildFirstVisitor.visit(DeepChildFirstVisitor.java:87) > ~[wicket-core-7.0.0.jar:7.0.0] > at > org.apache.wicket.markup.renderStrategy.DeepChildFirstVisitor.visit(DeepChildFirstVisitor.java:51) > ~[wicket-core-7.0.0.jar:7.0.0] > at > org.apache.wicket.markup.renderStrategy.ChildFirstHeaderRenderStrategy.renderChildHeaders(ChildFirstHeaderRenderStrategy.java:78) > ~[wicket-core-7.0.0.jar:7.0.0] > at > org.apache.wicket.markup.renderStrategy.ChildFirstHeaderRenderStrategy.renderHeader(ChildFirstHeaderRenderStrategy.java:57) > ~[wicket-core-7.0.0.jar:7.0.0] > at > org.apache.wicket.page.PartialPageUpdate.writeHeaderContribution(PartialPageUpdate.java:488) > ~[wicket-core-7.0.0.jar:7.0.0] > at > org.apache.wicket.page.XmlPartialPageUpdate.writeComponent(XmlPartialPageUpdate.java:101) > ~[wicket-core-7.0.0.jar:7.0.0] > at > org.apache.wicket.page.PartialPageUpdate.writeComponents(PartialPageUpdate.java:237) > ~[wicket-core-7.0.0.jar:7.0.0] > at > org.apache.wicket.page.PartialPageUpdate.writeTo(PartialPageUpdate.java:157) > ~[wicket-core-7.0.0.jar:7.0.0] > at > org.apache.wicket.ajax.AjaxRequestHandler.respond(AjaxRequestHandler.java:358) > ~[wicket-core-7.0.0.jar:7.0.0] > at > org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:865) > ~[wicket-core-7.0.0.jar:7.0.0] > at > org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:64) > ~[wicket-request-7.0.0.jar:7.0.0] > at > org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:97) > ~[wicket-request-7.0.0.jar:7.0.0] > at > org.apache.wicket.request.cycle.RequestCycle.execute(RequestCycle.java:265) > ~[wicket-core-7.0.0.jar:7.0.0] > at > org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:222) > ~[wicket-core-7.0.0.jar:7.0.0] > at > org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:293) > ~[wicket-core-7.0.0.jar:7.0.0] > at > org.apache.wicket.protocol.ws.AbstractUpgradeFilter.processRequestCycle(AbstractUpgradeFilter.java:70) > ~[wicket-native-websocket-core-7.0.0.jar:7.0.0] > at > org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:203) > ~[wicket-core-7.0.0.jar:7.0.0] > at > org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:284) > ~[wicket-core-7.0.0.jar:7.0.0] > > In my page > > BaseModal editModal = new BaseModal("editModal"); > editModal.add(new Resizable().withChildSelector(".modal-content")); > editModal.add(new Draggable(new > DraggableConfig().withHandle(".modal-header").withCursor("move"))); > editModal.setUseKeyboard(true).addCloseButton(); > editModal.setFadeIn(true); > > > final AjaxLink<Void> createLink = new > ClearIndicatingAjaxLink<Void>("createLink", getPageReference()) { > > private static final long serialVersionUID = > -7978723352517770644L; > > @Override > protected void onClickInternal(final AjaxRequestTarget target) > { > editModal.addOrReplace(new > RealmModalPanel<>(BaseModal.getModalContentId(), > Realms.this.getPageReference(), editModal, > new RealmTO(), > Realms.this.getCurrentRealm().getFullPath(), Entitlement.REALM_CREATE)); > target.add(editModal); > editModal.show(target); > } > > }; > > I think the problem is in this statment "target.add(editModal)" > > What's wrong? > > Marco > > > >> >> Marco >>> >>> Martin Grigorov >>> >>>> Wicket Training and Consulting >>>> https://twitter.com/mtgrigorov >>>> >>>> On Mon, Aug 24, 2015 at 11:46 AM, Marco Di Sabatino Di Diodoro < >>>> [email protected]> wrote: >>>> >>>> Hi all, >>>> >>>>> I'm using wicket-bootstrap to implement a new console. >>>>> In this moment, I'm implementing my Modal with >>>>> de.agilecoders.wicket.core.markup.html.bootstrap.dialog.Modal >>>>> component. >>>>> >>>>> I would like to add some components in the header or footer, but all >>>>> fields are declared private and the aren't getter and setter methods. >>>>> What can I do? Any suggestions? >>>>> >>>>> Regards >>>>> Marco >>>>> >>>>> -- >>>>> Dott. Marco Di Sabatino Di Diodoro >>>>> Tel. +39 3939065570 >>>>> >>>>> Tirasa S.r.l. >>>>> Viale D'Annunzio 267 - 65127 Pescara >>>>> Tel +39 0859116307 / FAX +39 0859111173 >>>>> http://www.tirasa.net >>>>> >>>>> Apache Syncope PMC Member >>>>> http://people.apache.org/~mdisabatino/ >>>>> >>>>> >>>>> >>>>> -- >>> Dott. Marco Di Sabatino Di Diodoro >>> Tel. +39 3939065570 >>> >>> Tirasa S.r.l. >>> Viale D'Annunzio 267 - 65127 Pescara >>> Tel +39 0859116307 / FAX +39 0859111173 >>> http://www.tirasa.net >>> >>> Apache Syncope PMC Member >>> http://people.apache.org/~mdisabatino/ >>> >>> >>> > -- > Dott. Marco Di Sabatino Di Diodoro > Tel. +39 3939065570 > > Tirasa S.r.l. > Viale D'Annunzio 267 - 65127 Pescara > Tel +39 0859116307 / FAX +39 0859111173 > http://www.tirasa.net > > Apache Syncope PMC Member > http://people.apache.org/~mdisabatino/ > >
