Hi,


The dialogB(without nested form) of panelB uses this snippet to update the 
models of the components in the root panel.
It works perfectly unless other nested form is submitted in advance.

   onClose(.... target) {
            mandatePayerEditPanel.detachModels(); // this is the reference to 
the root panels compoent, which needs to be updated.
                                                  // It’s passed via 
constructor in the
            final Person productIsPerson = (Person) productIsClient.getParty();
            final PersonImpl person = (PersonImpl) 
mandatePayerEditPanel.getPersonModel().getObject();

            person.setPersonName(productIsPerson.getPersonName().copy());      
// sets the new value

            final IModel<Address> domesticAddressModel = 
mandatePayerEditPanel.getAddressPersonPanel().getDomesticAddressModel();
            domesticAddressModel.detach();

            
domesticAddressModel.setObject(productIsPerson.getContact().getAddress().copy());
 // sets the new value

            // now comes the stuff for refreshing components with ajax response
            target.add(componentsToRefreshOnVerificationFill);
            List<Component> list = new ArrayList<Component>();
            
mandatePayerEditPanel.addComponentsToRefreshOnVerificationFill(list);
            mandatePayerEditPanel.setOutputMarkupId(true);
            mandatePayerEditPanel.setOutputMarkupPlaceholderTag(true);
            mandatePayerEditPanel.markRendering(true);
            mandatePayerEditPanel.setVisibilityAllowed(true);
            mandatePayerEditPanel.modelChanged();
            mandatePayerEditPanel.configure();
            target.add(mandatePayerEditPanel);
    }





m.



-----Original Message-----
From: Martin Grigorov <mgrigo...@apache.org>
Sent: Tuesday, August 4, 2020 2:25 PM
To: users@wicket.apache.org
Subject: Re: Issues with refreshing panel with form



On Tue, Aug 4, 2020 at 2:53 PM Zimen, Michal 
<michal.zi...@anasoft.com<mailto:michal.zi...@anasoft.com>>

wrote:



> Thanks,

>

>  Well, snippets from source code might come later. My concerns are,

> that the issue I’m facing is related to this

> https://issues.apache.org/jira/browse/WICKET-6041

> None weird logs have been found on both sides.

>

> DialogA with a nested form uses POST to update its stuff, but the

> dialogB handle its work through GET only(no form submission).

>

> I was trying to catch the root form submission in form.onSubmit(), but

> I found out, that this is not called, since the

> wantSubmitOnNestedFormSubmit() returns false.

> Therefore I conclude, that after POST request, other references among

> components are broken.

>



What do you mean with this ?





>

> The question might be: How to "refresh" or keep these references after

> nested form is submitted?

>

> Thanks a lot,

>

>

>  M.

>

> -----Original Message-----

> From: Martin Grigorov <mgrigo...@apache.org<mailto:mgrigo...@apache.org>>

> Sent: Tuesday, August 4, 2020 10:31 AM

> To: users@wicket.apache.org<mailto:users@wicket.apache.org>

> Subject: Re: Issues with refreshing panel with form

>

> Hi,

>

> On Mon, Aug 3, 2020 at 2:53 PM Zimen, Michal

> <michal.zi...@anasoft.com<mailto:michal.zi...@anasoft.com>>

> wrote:

>

> > Hi Wicket Users,

> >

> >

> >    I've just started to learn the Wicket by fixing some issues in

> > our legacy backlog repository.

> >

> > Therefore, I need some clarification to manage my blockpoints.

> > Having spent enough time to fix it by myself, I finally must turn

> > out to this help.

> >

> > The weird problem could be described following:

> >

> >

> >   1.  A base form contains components and links to

> > AbstractFormDialog(Jquery-ui) for user inputs.

> >   2.  When the formDialogA is submitted, some parent components are

> > updated, some remain empty, as it is expected.

> >   3.  Another modal formDialogB is open and submitted and expecting

> > components are not updated.

> >

> > When this procedure is done in swapped sequence - firstly

> > formDialogB and then formDialogA is opened, everything works ok.

> >

> > Seems as if, the submitting formDialogA breaks the references for

> > submission formDialogB.

> >

> > Could you please clarify me, what should be checked to avoid this

> problem?

> >

>

> I'd suggest these two things:

> 1) check for errors both in the server logs and in the browser

> 2) use a FeedbackPanel to show any validation errors in all Forms.

> I.e. if you override #onSubmit()/#onUpdate() then make sure you also

> override

> #onError() and if you use Ajax then add the FeedbackPanel to the

> AjaxRequestTarget

>

>

> >

> > Thanks,

> >

> >        M.

> >

> >

> >

> > Michal Zimen

> > e-mail: michal.zi...@anasoft.com<mailto:michal.zi...@anasoft.com>

> >

> >

>

Reply via email to