So the serverside is not called the first time at all? (you have debugged that?)
Then it seems that it is a javascript issue. Look in the browser why
it isnt called.

On 3/31/08, Thomas Kappler <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I'm seeing a strange behavior on one of my pages.  Using
> wicketstuff-scriptaculous, users drag a row from a ListView to another
> component.  This triggers an association between the two model
> objects, which is also persisted via Hibernate.  Relevant code:
>
>             protected void onDrop(Component component,
> AjaxRequestTarget target) {
>               if (component.getModelObject() instanceof Fiche) {
>                       // a fiche being dropped
>                       Fiche f = (Fiche) component.getModelObject();
>                       sense.getFiches().add(f);
>                       DataStaticService.getHibernateSession().flush();
>                       DataStaticService.getHibernateSession().merge(sense);
>       
> DataStaticService.getHibernateSession().getTransaction().commit();
>                       sensesPanel.update(node, target);
>               }
>             }
>
> The update() in the last line triggers a target.addComponent() of the
> panel containing the ListView, which should cause it to remove the
> dropped element, as it has been handled.  (The model backing the
> ListView is the result of a database query getting the Fiches which
> are not associated to a Sense.)
>
> Now, what I see is that the first drop after the page is loaded
> doesn't trigger the update, the ListView stays untouched.  However,
> when I drop the second and more elements, it starts working.  But the
> first dropped element is always displayed, so the ListView is always
> off by one.  A manual page reload again causes the next drop to not
> update the ListView.
>
> What gives?  The fact that it starts working at some time seems to
> indicate my backend/domain logic is correct.  I can post more code,
> but perhaps someone can already give a direction where to look.
>
> Cheers,
> Thomas
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to