Re: Issues with refreshing panel with form

2020-08-04 Thread Martin Terra
Did you debug clearinput and model detach whether they occur expectedly?
Snipplet is too small to see the big picture, and at the same time it seems
too complex to get the big picture quickly from code (maybe you could share
a 15 line pseudocode spec for the form, what it's intended to do)?

**
Martin

ti 4. elok. 2020 klo 15.43 Zimen, Michal (michal.zi...@anasoft.com)
kirjoitti:

> 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 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 list = new ArrayList();
>
> 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 
> 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  >
>
> 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 mailto:mgrigo...@apache.org
> >>
>
> > Sent: Tuesday, August 4, 2020 10:31 AM
>
> > To: users@wicket.apache.org
>
> > Subject: Re: Issues with refreshing panel with form
>
> >
>
> > Hi,
>
> >
>
> > On Mon, Aug 3, 2020 at 2:53 PM Zimen, Michal
>
> > 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

RE: Issues with refreshing panel with form

2020-08-04 Thread Zimen, Michal
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 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 list = new ArrayList();

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 
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 
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 mailto:mgrigo...@apache.org>>

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

> To: users@wicket.apache.org

> Subject: Re: Issues with refreshing panel with form

>

> Hi,

>

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

> 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

> >

> >

>


Re: Issues with refreshing panel with form

2020-08-04 Thread Martin Grigorov
On Tue, Aug 4, 2020 at 2:53 PM Zimen, Michal 
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 
> Sent: Tuesday, August 4, 2020 10:31 AM
> To: users@wicket.apache.org
> Subject: Re: Issues with refreshing panel with form
>
> Hi,
>
> On Mon, Aug 3, 2020 at 2:53 PM Zimen, Michal 
> 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
> >
> >
>


RE: Issues with refreshing panel with form

2020-08-04 Thread Zimen, Michal
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. 

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  
Sent: Tuesday, August 4, 2020 10:31 AM
To: users@wicket.apache.org
Subject: Re: Issues with refreshing panel with form

Hi,

On Mon, Aug 3, 2020 at 2:53 PM Zimen, Michal 
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
>
>


Re: Issues with refreshing panel with form

2020-08-04 Thread Martin Grigorov
Hi,

On Mon, Aug 3, 2020 at 2:53 PM Zimen, Michal 
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
>
>


Re: Wicket and Vue.js synergy

2020-08-04 Thread Илья Нарыжный
Thank you, Martin!

If somebody interested, work has begun in the following repository:
https://github.com/OrienteerBAP/vuecket
Features which I plan to add soon:

1) Support of Data Channel: channels for synchronization of data on
Vue side and named Models on wicket side. 1 way sync, 2 way sync, one
time, runtime, websocket.
2) Support of subscriptions to vue events.
3) Support of storing Vue code as Json (plain String is Java), *.vue
files, reference to NPM package

Btw, recently we released JNPM (https://github.com/OrienteerBAP/JNPM)
- native java API for work with NPM. Idea is to use JNPM for more
fluent and runtime integration with NPM registry and NPM packages. For
example, to allow quickly link wicket component to the corresponding
implementation in NPM package, add data channels and event listeners.
Ideally with minimal "wrapping" JS code.
Ultimate goal is to make our product (Orienteer) even more rapid for
applications development due to reinforcement of front-end support.

Thanks,
Ilya
-
Orienteer(http://orienteer.org) - open source Business Application Platform

On Fri, May 8, 2020 at 6:18 AM Martin Grigorov  wrote:
>
> Hi Илья,
>
> 7 years ago I've made a (small) integration with Ractive.js:
> https://github.com/martin-g/wicket-ractive and blogged about it
> https://wicketinaction.com/2013/08/surgical-ajax-updates-with-ractive-js/
> IMO Vue.js has started as a fork from Ractive.js but Rich Harris says it
> just influenced it: https://twitter.com/mtgrigorov/status/806531052743311360
>  :-)
> I like them both a lot!
> You can use wicket-ractive as an inspiration! It just uses Ractive.js for
> the Ajax updates (instead of Wicket's XML approach). I didn't go any
> deeper, like integrating on component level
>
> Have fun!
>
> On Thu, May 7, 2020 at 6:40 AM Илья Нарыжный  wrote:
>
> > Hello,
> >
> > I code on Wicket for around 10 years and on Vue JS for a few months
> > and found a lot of in common between these frameworks. There are 100
> > and 1 ways in Wicket how to integrate a front-end framework. But with
> > pre-created Wicket library - integration might be even deeper and lead
> > to a synergy effect.
> >
> > I've started to collect some ideas and "design notes" about the
> > library which allows integrating Wicket and Vue on another level. I
> > will really appreciate any feedback and more ideas and comments. Here
> > is this document:
> >
> > https://docs.google.com/document/d/1Lj4LqebeZFkYGsfyC2K7upUl8VpBeAE49Q-BLtvhpFM/edit?usp=sharing
> > Feel free to comment, edit or reply to this email.
> >
> >
> > P.S. If you use telegram: lets chat in the group around Wicket -
> > https://t.me/apache_wicket
> > P.P.S. Reminder: here is a curated list of "awesome things" around
> > Wicket: https://github.com/PhantomYdn/awesome-wicket . If you have
> > something to propose: please feel free to make a PR or an issue.
> >
> > Thanks,
> > Ilya
> > -
> > Orienteer(http://orienteer.org) - open source Business Application
> > Platform
> >
> > -
> > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> > For additional commands, e-mail: users-h...@wicket.apache.org
> >
> >

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org