You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Arjun Dhar <dh...@yahoo.com> on 2011/12/12 14:48:23 UTC

Repainting only newly-created repeater items via ajax

Hi,
with reference to the blog/article:
http://wicketinaction.com/2008/10/repainting-only-newly-created-repeater-items-via-ajax/

I have Code:


...the trouble is that the above allows me to ADD one record, but on the
second it naturally complains "authorizationDetails" is already pard of
'authorizationListView'.

If I try to make the "authorizationListView" dynamic it complains. In the
example, the author has used a RepeaterView, .. here its a ListView and I
cant get the items next Child Id (.. or Can I)?

...The issue here seems to be what value can I put in th Fragment so that it
allows me to ADD more than one row via Ajax!

thanks



-----
Software documentation is like sex: when it is good, it is very, very good; and when it is bad, it is still better than nothing!
--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Repainting-only-newly-created-repeater-items-via-ajax-tp4186028p4186028.html
Sent from the Users forum 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: Repainting only newly-created repeater items via ajax

Posted by vineet semwal <vi...@gmail.com>.
Hi Arjun,
i am glad repeating view worked for you :)
btw in the listiview code,you only need the new item to render at a time so
it should be target.add(li)

though not the problem currently,your js code should be less dependent
on wicket js ,it will be good in the long run
as wicket js might change in the new versions..

On Tue, Dec 13, 2011 at 10:30 AM, Arjun Dhar <dh...@yahoo.com> wrote:
> ok, its official. using "ListView" in this situation is a major
> *Pain_In_The_A*
>
> Using RepeatingView it was smooth.
>
> However, as far as I got with using ListView (for the sake of
> documentation); .. is that the script will need to be modified. I think the
> "li" adds one more level of abstraction. When I replaced "prepend" with
> "append" the "tr" showed up but was blank. (No innerHTML).
>
> Thanks Vineet, you  great help in both your suggestions.
>
>
>
> -----
> Software documentation is like sex: when it is good, it is very, very good; and when it is bad, it is still better than nothing!
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/Repainting-only-newly-created-repeater-items-via-ajax-tp4186028p4188835.html
> Sent from the Users forum 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
>



-- 
thank you,

regards,
Vineet Semwal

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


Re: Repainting only newly-created repeater items via ajax

Posted by Arjun Dhar <dh...@yahoo.com>.
ok, its official. using "ListView" in this situation is a major
*Pain_In_The_A*

Using RepeatingView it was smooth. 

However, as far as I got with using ListView (for the sake of
documentation); .. is that the script will need to be modified. I think the
"li" adds one more level of abstraction. When I replaced "prepend" with
"append" the "tr" showed up but was blank. (No innerHTML).

Thanks Vineet, you  great help in both your suggestions.



-----
Software documentation is like sex: when it is good, it is very, very good; and when it is bad, it is still better than nothing!
--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Repainting-only-newly-created-repeater-items-via-ajax-tp4186028p4188835.html
Sent from the Users forum 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: Repainting only newly-created repeater items via ajax

Posted by Arjun Dhar <dh...@yahoo.com>.
Hi Vineet,
nice suggestion. I worked on it and solved all server side issues; however
on the UI its failing to render. My suspicion is the prepended script may
need to be tweaked.

here is the modified code for reference:


-----
Software documentation is like sex: when it is good, it is very, very good; and when it is bad, it is still better than nothing!
--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Repainting-only-newly-created-repeater-items-via-ajax-tp4186028p4188674.html
Sent from the Users forum 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: Repainting only newly-created repeater items via ajax

Posted by vineet semwal <vi...@gmail.com>.
just checked out your code in nabble,it didnt get through in mail

authorizationdetail should be added to listitem in the button and
listitem shouldbe added to listview in button
listitem id should be the new unique index

On Mon, Dec 12, 2011 at 8:03 PM, vineet semwal
<vi...@gmail.com> wrote:
> repeatingview is actually the better choice for that ..
>
> for listview ,you can write a method which adds the new item to list
> view,you need to provide the index in that case
>
> method should add new ListItem<T>(index, itemModel)
> you can also iterate the children to see if the index isnt repeated
> before adding..
>
>
> On Mon, Dec 12, 2011 at 7:18 PM, Arjun Dhar <dh...@yahoo.com> wrote:
>> Hi,
>> with reference to the blog/article:
>> http://wicketinaction.com/2008/10/repainting-only-newly-created-repeater-items-via-ajax/
>>
>> I have Code:
>>
>>
>> ...the trouble is that the above allows me to ADD one record, but on the
>> second it naturally complains "authorizationDetails" is already pard of
>> 'authorizationListView'.
>>
>> If I try to make the "authorizationListView" dynamic it complains. In the
>> example, the author has used a RepeaterView, .. here its a ListView and I
>> cant get the items next Child Id (.. or Can I)?
>>
>> ...The issue here seems to be what value can I put in th Fragment so that it
>> allows me to ADD more than one row via Ajax!
>>
>> thanks
>>
>>
>>
>> -----
>> Software documentation is like sex: when it is good, it is very, very good; and when it is bad, it is still better than nothing!
>> --
>> View this message in context: http://apache-wicket.1842946.n4.nabble.com/Repainting-only-newly-created-repeater-items-via-ajax-tp4186028p4186028.html
>> Sent from the Users forum 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
>>
>
>
>
> --
> thank you,
>
> regards,
> Vineet Semwal



-- 
thank you,

regards,
Vineet Semwal

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


Re: Repainting only newly-created repeater items via ajax

Posted by vineet semwal <vi...@gmail.com>.
repeatingview is actually the better choice for that ..

for listview ,you can write a method which adds the new item to list
view,you need to provide the index in that case

method should add new ListItem<T>(index, itemModel)
you can also iterate the children to see if the index isnt repeated
before adding..


On Mon, Dec 12, 2011 at 7:18 PM, Arjun Dhar <dh...@yahoo.com> wrote:
> Hi,
> with reference to the blog/article:
> http://wicketinaction.com/2008/10/repainting-only-newly-created-repeater-items-via-ajax/
>
> I have Code:
>
>
> ...the trouble is that the above allows me to ADD one record, but on the
> second it naturally complains "authorizationDetails" is already pard of
> 'authorizationListView'.
>
> If I try to make the "authorizationListView" dynamic it complains. In the
> example, the author has used a RepeaterView, .. here its a ListView and I
> cant get the items next Child Id (.. or Can I)?
>
> ...The issue here seems to be what value can I put in th Fragment so that it
> allows me to ADD more than one row via Ajax!
>
> thanks
>
>
>
> -----
> Software documentation is like sex: when it is good, it is very, very good; and when it is bad, it is still better than nothing!
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/Repainting-only-newly-created-repeater-items-via-ajax-tp4186028p4186028.html
> Sent from the Users forum 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
>



-- 
thank you,

regards,
Vineet Semwal

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