You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by alesp <al...@gmail.com> on 2008/06/12 16:48:33 UTC

AjaxSubmitLink refreshing problem

Hello!
Ok, this is the problem: I have the following wicket hierarchy:

Panel
   |
    --> Form
            |
             --> WebMarkupContainer (setOutputMarkupId(true))
            |                    |
            |                    --> ListView (with a
LoadableDetachableModel)
            |                              |
            |                               --> { populateItem {
AjaxSubmitLink (to "delete" an element. Updates the WebMarkupContainer) } }
             --> AutoCompleteTextField
            |
             --> AjaxSubmitLink (to "add" an element)

The problem is that the "add" link (the AjaxSubmitLink at the bottom of the
diagram) is working fine, but the "delete" is not, and the code is pretty
the same (calling different methods). When I say it's not working I mean
that I click the "delete" link and nothing happens (internally the element
is removed properly but the page doesn't refresh the changes). The "add"
link works, I press "add" and the list is refreshed with the new element.
Trying to find out what's happening I copied the "onSubmit" method of the
"delete" AjaxSubmitLink to the "add" link and again the list was properly
refreshed, now with a delete action. So, I think that the problem is related
to the location of the links in the hierarchy and something that I'm missing
there.
Any idea?
-- 
View this message in context: http://www.nabble.com/AjaxSubmitLink-refreshing-problem-tp17801832p17801832.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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


Re: AjaxSubmitLink refreshing problem

Posted by alesp <al...@gmail.com>.
Hello jchappelle.
Yes, I'm adding the WebMarkupContainer to the AjaxRequestTarget, but I'm
going to look that method you mentioned, maybe the solution is there.
Thanks.


jchappelle wrote:
> 
> The ListView class has a method called removeLink that returns a Link that
> will remove the item from the list. I have never used it but I just
> figured I would point it out to you. Maybe looking at the source code of
> that method could help.
> 
> Also, make sure you are adding your WebMarkupContainer to the
> AjaxRequestTarget. Otherwise the Ajax call will not update that section of
> your markup.
> 
> Josh
> 
> 
> alesp wrote:
>> 
>> Hello!
>> Ok, this is the problem: I have the following wicket hierarchy:
>> 
>> Panel
>>    |
>>     --> Form
>>             |
>>              --> WebMarkupContainer (setOutputMarkupId(true))
>>             |                    |
>>             |                    --> ListView (with a
>> LoadableDetachableModel)
>>             |                              |
>>             |                               --> { populateItem {
>> AjaxSubmitLink (to "delete" an element. Updates the WebMarkupContainer) }
>> }
>>              --> AutoCompleteTextField
>>             |
>>              --> AjaxSubmitLink (to "add" an element)
>> 
>> The problem is that the "add" link (the AjaxSubmitLink at the bottom of
>> the diagram) is working fine, but the "delete" is not, and the code is
>> pretty the same (calling different methods). When I say it's not working
>> I mean that I click the "delete" link and nothing happens (internally the
>> element is removed properly but the page doesn't refresh the changes).
>> The "add" link works, I press "add" and the list is refreshed with the
>> new element.
>> Trying to find out what's happening I copied the "onSubmit" method of the
>> "delete" AjaxSubmitLink to the "add" link and again the list was properly
>> refreshed, now with a delete action. So, I think that the problem is
>> related to the location of the links in the hierarchy and something that
>> I'm missing there.
>> Any idea?
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/AjaxSubmitLink-refreshing-problem-tp17801832p17802573.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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


Re: AjaxSubmitLink refreshing problem

Posted by jchappelle <jc...@4redi.com>.
The ListView class has a method called removeLink that returns a Link that
will remove the item from the list. I have never used it but I just figured
I would point it out to you. Maybe looking at the source code of that method
could help.

Also, make sure you are adding your WebMarkupContainer to the
AjaxRequestTarget. Otherwise the Ajax call will not update that section of
your markup.

Josh


alesp wrote:
> 
> Hello!
> Ok, this is the problem: I have the following wicket hierarchy:
> 
> Panel
>    |
>     --> Form
>             |
>              --> WebMarkupContainer (setOutputMarkupId(true))
>             |                    |
>             |                    --> ListView (with a
> LoadableDetachableModel)
>             |                              |
>             |                               --> { populateItem {
> AjaxSubmitLink (to "delete" an element. Updates the WebMarkupContainer) }
> }
>              --> AutoCompleteTextField
>             |
>              --> AjaxSubmitLink (to "add" an element)
> 
> The problem is that the "add" link (the AjaxSubmitLink at the bottom of
> the diagram) is working fine, but the "delete" is not, and the code is
> pretty the same (calling different methods). When I say it's not working I
> mean that I click the "delete" link and nothing happens (internally the
> element is removed properly but the page doesn't refresh the changes). The
> "add" link works, I press "add" and the list is refreshed with the new
> element.
> Trying to find out what's happening I copied the "onSubmit" method of the
> "delete" AjaxSubmitLink to the "add" link and again the list was properly
> refreshed, now with a delete action. So, I think that the problem is
> related to the location of the links in the hierarchy and something that
> I'm missing there.
> Any idea?
> 

-- 
View this message in context: http://www.nabble.com/AjaxSubmitLink-refreshing-problem-tp17801832p17802380.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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


Re: AjaxSubmitLink refreshing problem

Posted by Timo Rantalaiho <Ti...@ri.fi>.
On Thu, 12 Jun 2008, alesp wrote:
> Panel
>    |
>     --> Form
>             |
>              --> WebMarkupContainer (setOutputMarkupId(true))
>             |                    |
>             |                    --> ListView (with a
> LoadableDetachableModel)
>             |                              |
>             |                               --> { populateItem {
> AjaxSubmitLink (to "delete" an element. Updates the WebMarkupContainer) } }
>              --> AutoCompleteTextField
>             |
>              --> AjaxSubmitLink (to "add" an element)
> 
> The problem is that the "add" link (the AjaxSubmitLink at the bottom of the
> diagram) is working fine, but the "delete" is not, and the code is pretty

What a cool diagram :) Have you called setReuseItems(true)
for the ListView by any change? (If you have, I understand
you should call removeAll to get the model changes to show:
  http://www.nabble.com/Re%3A-ListViews-in-a-form-question-p17786806.html 
) Have you checked that the stuff that the
LoadableDetachableModel returns for the ListView is correct
after the delete? Have you checked that the ListView reads
the contents from the model on rendering for the ajax update?

Putting a Thread.dumpStack() in the load implementation of
your LoadableDetachableModel will probably show easily when
the ListView refreshes its contents.

Best wishes,
Timo

-- 
Timo Rantalaiho           
Reaktor Innovations Oy    <URL: http://www.ri.fi/ >

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


Re: AjaxSubmitLink refreshing problem

Posted by Mohan Thakare <rs...@gmail.com>.
The image showing the area in which  AjaxSubmitLink is shown.
As the number of links are increasing the scroll bar is work automatically
in Fire Fox.
but its not scrolled in Safari.
In Safari link is added but its not showing the current link which is added
at last.


Mohan Thakare wrote:
> 
> ok. I will explain my problem in detail.
> I have a WebMarkupContainer in which I showing a DataView.
> DataView contains AjaxSubmitLink.
> By clicking a specific button on page a new AjaxSubmitLink containing some
> data is added to the DataView.
> 
>  http://www.nabble.com/file/p19310695/untitled.jpg 
> each time I click on button a new link is added and the focus is on the
> currently added link.
> When the links are more than size of the specified area, the focus is
> still on the current link.
> and the list is scroll down automatically.
> This is happens in Fire Fox. But do not work in Safari.
> I want Safari should show this type of behavior.
> Any solution??
> 
> 
> 
> 
> 
> 
> 
> alesp wrote:
>> 
>> I don't understand what you want to do. Can you explain the situation a
>> little more? What do you mean by 'it' in "I need to make it work in
>> Safari"?
>> 
>> 
>> Mohan Thakare wrote:
>>> 
>>> you discuss in your problem that 
>>> "The problem is that the "add" link (the AjaxSubmitLink at the bottom of
>>> the diagram) is working fine"
>>> 
>>> can you tell how is that possible.
>>> how can I scroll my list and set the focus on current item.
>>> Its possible in Fire Fox but not in Safari.
>>> I need to make it work in Safari
>>> Is there any solution available for this??
>>> 
>>> 
>>> 
>>> alesp wrote:
>>>> 
>>>> Hello!
>>>> Ok, this is the problem: I have the following wicket hierarchy:
>>>> 
>>>> Panel
>>>>    |
>>>>     --> Form
>>>>             |
>>>>              --> WebMarkupContainer (setOutputMarkupId(true))
>>>>             |                    |
>>>>             |                    --> ListView (with a
>>>> LoadableDetachableModel)
>>>>             |                              |
>>>>             |                               --> { populateItem {
>>>> AjaxSubmitLink (to "delete" an element. Updates the WebMarkupContainer)
>>>> } }
>>>>              --> AutoCompleteTextField
>>>>             |
>>>>              --> AjaxSubmitLink (to "add" an element)
>>>> 
>>>> The problem is that the "add" link (the AjaxSubmitLink at the bottom of
>>>> the diagram) is working fine, but the "delete" is not, and the code is
>>>> pretty the same (calling different methods). When I say it's not
>>>> working I mean that I click the "delete" link and nothing happens
>>>> (internally the element is removed properly but the page doesn't
>>>> refresh the changes). The "add" link works, I press "add" and the list
>>>> is refreshed with the new element.
>>>> Trying to find out what's happening I copied the "onSubmit" method of
>>>> the "delete" AjaxSubmitLink to the "add" link and again the list was
>>>> properly refreshed, now with a delete action. So, I think that the
>>>> problem is related to the location of the links in the hierarchy and
>>>> something that I'm missing there.
>>>> Any idea?
>>>> 
>>> 
>>> 
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/AjaxSubmitLink-refreshing-problem-tp17801832p19310892.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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


Re: AjaxSubmitLink refreshing problem

Posted by Mohan Thakare <rs...@gmail.com>.
ok. I will explain my problem in detail.
I have a WebMarkupContainer in which I showing a DataView.
DataView contains AjaxSubmitLink.
By clicking a specific button on page a new AjaxSubmitLink containing some
data is added to the DataView.

http://www.nabble.com/file/p19310695/untitled.jpg 
each time I click on button a new link is added and the focus is on the
currently added link.
When the links are more than size of the specified area, the focus is still
on the current link.
and the list is scroll down automatically.
This is happens in Fire Fox. But do not work in Safari.
I want Safari should show this type of behavior.
Any solution??







alesp wrote:
> 
> I don't understand what you want to do. Can you explain the situation a
> little more? What do you mean by 'it' in "I need to make it work in
> Safari"?
> 
> 
> Mohan Thakare wrote:
>> 
>> you discuss in your problem that 
>> "The problem is that the "add" link (the AjaxSubmitLink at the bottom of
>> the diagram) is working fine"
>> 
>> can you tell how is that possible.
>> how can I scroll my list and set the focus on current item.
>> Its possible in Fire Fox but not in Safari.
>> I need to make it work in Safari
>> Is there any solution available for this??
>> 
>> 
>> 
>> alesp wrote:
>>> 
>>> Hello!
>>> Ok, this is the problem: I have the following wicket hierarchy:
>>> 
>>> Panel
>>>    |
>>>     --> Form
>>>             |
>>>              --> WebMarkupContainer (setOutputMarkupId(true))
>>>             |                    |
>>>             |                    --> ListView (with a
>>> LoadableDetachableModel)
>>>             |                              |
>>>             |                               --> { populateItem {
>>> AjaxSubmitLink (to "delete" an element. Updates the WebMarkupContainer)
>>> } }
>>>              --> AutoCompleteTextField
>>>             |
>>>              --> AjaxSubmitLink (to "add" an element)
>>> 
>>> The problem is that the "add" link (the AjaxSubmitLink at the bottom of
>>> the diagram) is working fine, but the "delete" is not, and the code is
>>> pretty the same (calling different methods). When I say it's not working
>>> I mean that I click the "delete" link and nothing happens (internally
>>> the element is removed properly but the page doesn't refresh the
>>> changes). The "add" link works, I press "add" and the list is refreshed
>>> with the new element.
>>> Trying to find out what's happening I copied the "onSubmit" method of
>>> the "delete" AjaxSubmitLink to the "add" link and again the list was
>>> properly refreshed, now with a delete action. So, I think that the
>>> problem is related to the location of the links in the hierarchy and
>>> something that I'm missing there.
>>> Any idea?
>>> 
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/AjaxSubmitLink-refreshing-problem-tp17801832p19310695.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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


Re: AjaxSubmitLink refreshing problem

Posted by alesp <al...@gmail.com>.
I don't understand what you want to do. Can you explain the situation a
little more? What do you mean by 'it' in "I need to make it work in Safari"?


Mohan Thakare wrote:
> 
> you discuss in your problem that 
> "The problem is that the "add" link (the AjaxSubmitLink at the bottom of
> the diagram) is working fine"
> 
> can you tell how is that possible.
> how can I scroll my list and set the focus on current item.
> Its possible in Fire Fox but not in Safari.
> I need to make it work in Safari
> Is there any solution available for this??
> 
> 
> 
> alesp wrote:
>> 
>> Hello!
>> Ok, this is the problem: I have the following wicket hierarchy:
>> 
>> Panel
>>    |
>>     --> Form
>>             |
>>              --> WebMarkupContainer (setOutputMarkupId(true))
>>             |                    |
>>             |                    --> ListView (with a
>> LoadableDetachableModel)
>>             |                              |
>>             |                               --> { populateItem {
>> AjaxSubmitLink (to "delete" an element. Updates the WebMarkupContainer) }
>> }
>>              --> AutoCompleteTextField
>>             |
>>              --> AjaxSubmitLink (to "add" an element)
>> 
>> The problem is that the "add" link (the AjaxSubmitLink at the bottom of
>> the diagram) is working fine, but the "delete" is not, and the code is
>> pretty the same (calling different methods). When I say it's not working
>> I mean that I click the "delete" link and nothing happens (internally the
>> element is removed properly but the page doesn't refresh the changes).
>> The "add" link works, I press "add" and the list is refreshed with the
>> new element.
>> Trying to find out what's happening I copied the "onSubmit" method of the
>> "delete" AjaxSubmitLink to the "add" link and again the list was properly
>> refreshed, now with a delete action. So, I think that the problem is
>> related to the location of the links in the hierarchy and something that
>> I'm missing there.
>> Any idea?
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/AjaxSubmitLink-refreshing-problem-tp17801832p19309030.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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


Re: AjaxSubmitLink refreshing problem

Posted by Mohan Thakare <rs...@gmail.com>.
you discuss in your problem that 
"The problem is that the "add" link (the AjaxSubmitLink at the bottom of the
diagram) is working fine"

can you tell how is that possible.
how can I scroll my list and set the focus on current item.
Its possible in Fire Fox but not in Safari.
I need to make it work in Safari
Is there any solution available for this??



alesp wrote:
> 
> Hello!
> Ok, this is the problem: I have the following wicket hierarchy:
> 
> Panel
>    |
>     --> Form
>             |
>              --> WebMarkupContainer (setOutputMarkupId(true))
>             |                    |
>             |                    --> ListView (with a
> LoadableDetachableModel)
>             |                              |
>             |                               --> { populateItem {
> AjaxSubmitLink (to "delete" an element. Updates the WebMarkupContainer) }
> }
>              --> AutoCompleteTextField
>             |
>              --> AjaxSubmitLink (to "add" an element)
> 
> The problem is that the "add" link (the AjaxSubmitLink at the bottom of
> the diagram) is working fine, but the "delete" is not, and the code is
> pretty the same (calling different methods). When I say it's not working I
> mean that I click the "delete" link and nothing happens (internally the
> element is removed properly but the page doesn't refresh the changes). The
> "add" link works, I press "add" and the list is refreshed with the new
> element.
> Trying to find out what's happening I copied the "onSubmit" method of the
> "delete" AjaxSubmitLink to the "add" link and again the list was properly
> refreshed, now with a delete action. So, I think that the problem is
> related to the location of the links in the hierarchy and something that
> I'm missing there.
> Any idea?
> 

-- 
View this message in context: http://www.nabble.com/AjaxSubmitLink-refreshing-problem-tp17801832p19309003.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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