You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Shelli Orton <Sh...@sjrb.ca> on 2010/10/07 00:05:01 UTC

Processing Flow for Button onSubmit and LDM load

Hi,

Again, thanks to all who have been helping me as I am new to Wicket.  I
am splitting out two issues I am dealing with to try to keep things
clear.

I am trying to write a simple app that does CRUD operations on database
records.  The goal is for the app to make use of a tab panel where each
tab encapsulates one table from the database.  Each tab panel has two
groups (WebMarkupContainer).  The first, selectGroup, displays a list
(DDC) of the current items, and three buttons, add, edit and delete.
The DDC uses a LDM to get the list of records so that changes to the
records are reflected on each request.  

When the save button is clicked the onSubmit method is called, then the
LDM load method and then the detach method (twice).  Therefore the
changes are reflected in the list when the page refreshes.

However, when the delete button is clicked, the LDM load and detach
methods are called and then the button's onSubmit.  Therefore the
changes are not reflected in the list.  This same flow is followed by
the cancel and add buttons, but since there are no changes made, it
doesn't make a practical difference in those cases.

Is it weird that the onSubmit is called before the LDM load and detach
methods for one button and after for another?  Which is the expected
processing flow?  Is there any way to change it so that the delete
process matches the save process?

Thanks in advance!

Shelli

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


Re: Processing Flow for Button onSubmit and LDM load

Posted by Igor Vaynberg <ig...@gmail.com>.
the ldm's load() is called whenever ldm's getobject() is called, which
is called whenever *your* code uses the model. you are free to call
detach() on the ldm yourself if you need it to reload the value at
some point.

-igor

On Wed, Oct 6, 2010 at 3:05 PM, Shelli Orton <Sh...@sjrb.ca> wrote:
> Hi,
>
> Again, thanks to all who have been helping me as I am new to Wicket.  I
> am splitting out two issues I am dealing with to try to keep things
> clear.
>
> I am trying to write a simple app that does CRUD operations on database
> records.  The goal is for the app to make use of a tab panel where each
> tab encapsulates one table from the database.  Each tab panel has two
> groups (WebMarkupContainer).  The first, selectGroup, displays a list
> (DDC) of the current items, and three buttons, add, edit and delete.
> The DDC uses a LDM to get the list of records so that changes to the
> records are reflected on each request.
>
> When the save button is clicked the onSubmit method is called, then the
> LDM load method and then the detach method (twice).  Therefore the
> changes are reflected in the list when the page refreshes.
>
> However, when the delete button is clicked, the LDM load and detach
> methods are called and then the button's onSubmit.  Therefore the
> changes are not reflected in the list.  This same flow is followed by
> the cancel and add buttons, but since there are no changes made, it
> doesn't make a practical difference in those cases.
>
> Is it weird that the onSubmit is called before the LDM load and detach
> methods for one button and after for another?  Which is the expected
> processing flow?  Is there any way to change it so that the delete
> process matches the save process?
>
> Thanks in advance!
>
> Shelli
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

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


RE: Processing Flow for Button onSubmit and LDM load

Posted by Shelli Orton <Sh...@sjrb.ca>.
Again, does nobody have any suggestions?  If I can't get this fixed, I'm
going to have to write the app in another framework (possibly GWT) and
I'd really rather not have to do that.

Shelli

-----Original Message-----
From: Shelli Orton 
Sent: Wednesday, October 06, 2010 4:05 PM
To: users@wicket.apache.org
Subject: Processing Flow for Button onSubmit and LDM load

Hi,

Again, thanks to all who have been helping me as I am new to Wicket.  I
am splitting out two issues I am dealing with to try to keep things
clear.

I am trying to write a simple app that does CRUD operations on database
records.  The goal is for the app to make use of a tab panel where each
tab encapsulates one table from the database.  Each tab panel has two
groups (WebMarkupContainer).  The first, selectGroup, displays a list
(DDC) of the current items, and three buttons, add, edit and delete.
The DDC uses a LDM to get the list of records so that changes to the
records are reflected on each request.  

When the save button is clicked the onSubmit method is called, then the
LDM load method and then the detach method (twice).  Therefore the
changes are reflected in the list when the page refreshes.

However, when the delete button is clicked, the LDM load and detach
methods are called and then the button's onSubmit.  Therefore the
changes are not reflected in the list.  This same flow is followed by
the cancel and add buttons, but since there are no changes made, it
doesn't make a practical difference in those cases.

Is it weird that the onSubmit is called before the LDM load and detach
methods for one button and after for another?  Which is the expected
processing flow?  Is there any way to change it so that the delete
process matches the save process?

Thanks in advance!

Shelli

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


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