You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Sam Hough (JIRA)" <ji...@apache.org> on 2007/09/03 15:55:00 UTC

[jira] Created: (WICKET-921) AbstractRepeater.add(int index, Component c) method

AbstractRepeater.add(int index, Component c) method
---------------------------------------------------

                 Key: WICKET-921
                 URL: https://issues.apache.org/jira/browse/WICKET-921
             Project: Wicket
          Issue Type: New Feature
          Components: wicket
    Affects Versions: 1.3.0-beta3
            Reporter: Sam Hough
            Priority: Minor


The ability to insert a Component into an AbstractRepeater would save having to rebuild the "list" from scratch. Behaviour could/should be like List.add(int index, E element).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WICKET-921) AbstractRepeater.add(int index, Component c) method

Posted by "Sam Hough (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-921?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12525016 ] 

Sam Hough commented on WICKET-921:
----------------------------------

Sorry, should have read around more. However, I'm actually using RepeatingView which does claim to look after the order for me. Make sense to have a add(int i, Component e) method here?

> AbstractRepeater.add(int index, Component c) method
> ---------------------------------------------------
>
>                 Key: WICKET-921
>                 URL: https://issues.apache.org/jira/browse/WICKET-921
>             Project: Wicket
>          Issue Type: New Feature
>          Components: wicket
>    Affects Versions: 1.3.0-beta3
>            Reporter: Sam Hough
>            Assignee: Igor Vaynberg
>            Priority: Minor
>
> The ability to insert a Component into an AbstractRepeater would save having to rebuild the "list" from scratch. Behaviour could/should be like List.add(int index, E element).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WICKET-921) AbstractRepeater.add(int index, Component c) method

Posted by "Sam Hough (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-921?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12525114 ] 

Sam Hough commented on WICKET-921:
----------------------------------

OK. I'll stick with RepeatingView and removing items then adding them back in the order I like. 

I did use ListView for this before but struggled to get the re-use strategy right. In the end it made a seemingly simple task complicated. 

I don't want the view refreshed so think I'll avoid RefreshingView which also seems to make life more complicated than needs be.

Is there a more appropriate component if I just want to fiddle with order of a set of components in an ad-hoc way? Like normal Widget set Panels etc? It would also be nice if the component was valid as an AjaxTarget component. 

Thanks

Sam

> AbstractRepeater.add(int index, Component c) method
> ---------------------------------------------------
>
>                 Key: WICKET-921
>                 URL: https://issues.apache.org/jira/browse/WICKET-921
>             Project: Wicket
>          Issue Type: New Feature
>          Components: wicket
>    Affects Versions: 1.3.0-beta3
>            Reporter: Sam Hough
>            Assignee: Igor Vaynberg
>            Priority: Minor
>
> The ability to insert a Component into an AbstractRepeater would save having to rebuild the "list" from scratch. Behaviour could/should be like List.add(int index, E element).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (WICKET-921) AbstractRepeater.add(int index, Component c) method

Posted by "Igor Vaynberg (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-921?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Igor Vaynberg resolved WICKET-921.
----------------------------------

    Resolution: Won't Fix
      Assignee: Igor Vaynberg

AbstractRepeater.java:66

/**
 * Returns an iterator for the collection of child components to be rendered. Users can override
 * this to change order of rendered children.
 * 
 * @return iterator over child components to be rendered
 */
protected abstract Iterator renderIterator();

wicket does not guarantee internal ordering of components via add() method.

so really what you can do is create your own items that contain the index, and your own insert and renderiterator() method that use that index.

> AbstractRepeater.add(int index, Component c) method
> ---------------------------------------------------
>
>                 Key: WICKET-921
>                 URL: https://issues.apache.org/jira/browse/WICKET-921
>             Project: Wicket
>          Issue Type: New Feature
>          Components: wicket
>    Affects Versions: 1.3.0-beta3
>            Reporter: Sam Hough
>            Assignee: Igor Vaynberg
>            Priority: Minor
>
> The ability to insert a Component into an AbstractRepeater would save having to rebuild the "list" from scratch. Behaviour could/should be like List.add(int index, E element).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WICKET-921) AbstractRepeater.add(int index, Component c) method

Posted by "Igor Vaynberg (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-921?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12525109 ] 

Igor Vaynberg commented on WICKET-921:
--------------------------------------

no, not really. repeatingview is made for very simple cases where you just want to add a bunch of items into the repeater. i do not wish to complicate it to support this usecases because it is pretty rare.

refreshingview has itemreusestrategy which will reuse previously created rows, listview has setreuseitems(true)

> AbstractRepeater.add(int index, Component c) method
> ---------------------------------------------------
>
>                 Key: WICKET-921
>                 URL: https://issues.apache.org/jira/browse/WICKET-921
>             Project: Wicket
>          Issue Type: New Feature
>          Components: wicket
>    Affects Versions: 1.3.0-beta3
>            Reporter: Sam Hough
>            Assignee: Igor Vaynberg
>            Priority: Minor
>
> The ability to insert a Component into an AbstractRepeater would save having to rebuild the "list" from scratch. Behaviour could/should be like List.add(int index, E element).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.