You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Brian Topping (JIRA)" <ji...@apache.org> on 2007/03/03 06:47:50 UTC

[jira] Created: (WICKET-348) Propose removing 'final' modifier to AbstractSingleSelectChoice.convertValue()

Propose removing 'final' modifier to AbstractSingleSelectChoice.convertValue()
------------------------------------------------------------------------------

                 Key: WICKET-348
                 URL: https://issues.apache.org/jira/browse/WICKET-348
             Project: Wicket
          Issue Type: Improvement
          Components: wicket
    Affects Versions: 2.0
            Reporter: Brian Topping


While creating a subclass of DropDownChoice, I wanted to write a specialized reverse mapping function that would allow the option value to be used as the primary key for direct lookup of the object.  Unfortunately, AbstractSingleSelectChoice.convertValue() is has a 'final' modifier.  (I'm guessing this is an inside joke because it does a linear search... ;-))

Any chance of removing the final modifier?


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


[jira] Resolved: (WICKET-348) Propose removing 'final' modifier to AbstractSingleSelectChoice.convertValue()

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

Igor Vaynberg resolved WICKET-348.
----------------------------------

       Resolution: Fixed
    Fix Version/s: 1.3.0-beta2

i have factored out some stuff into convertChoiceIdToChoice that is overridable. overriding convertValue() directly would be cumbersome as you need to mess with string arrays, etc.

basically this is useful for a direct id->choice lookup because right now our ichoicerenderer does a linear O(n) search, and if you have 100+ entries it will get slow as you need to load each choice and then retrieve its id for comparison.

johan what do you think? any objections? it would be nice if this was part of ichoicerenderer, then we can put the linear lookup into choicerenderer implements ichoicerenderer.

> Propose removing 'final' modifier to AbstractSingleSelectChoice.convertValue()
> ------------------------------------------------------------------------------
>
>                 Key: WICKET-348
>                 URL: https://issues.apache.org/jira/browse/WICKET-348
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket
>    Affects Versions: 2.0 branch (discontinued)
>            Reporter: Brian Topping
>            Assignee: Igor Vaynberg
>             Fix For: 1.3.0-beta2
>
>
> While creating a subclass of DropDownChoice, I wanted to write a specialized reverse mapping function that would allow the option value to be used as the primary key for direct lookup of the object.  Unfortunately, AbstractSingleSelectChoice.convertValue() is has a 'final' modifier.  (I'm guessing this is an inside joke because it does a linear search... ;-))
> Any chance of removing the final modifier?

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


[jira] Updated: (WICKET-348) Propose removing 'final' modifier to AbstractSingleSelectChoice.convertValue()

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

Alastair Maw updated WICKET-348:
--------------------------------

    Assignee: Igor Vaynberg

Igor - can we close this?

> Propose removing 'final' modifier to AbstractSingleSelectChoice.convertValue()
> ------------------------------------------------------------------------------
>
>                 Key: WICKET-348
>                 URL: https://issues.apache.org/jira/browse/WICKET-348
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket
>    Affects Versions: 2.0 branch (discontinued)
>            Reporter: Brian Topping
>            Assignee: Igor Vaynberg
>
> While creating a subclass of DropDownChoice, I wanted to write a specialized reverse mapping function that would allow the option value to be used as the primary key for direct lookup of the object.  Unfortunately, AbstractSingleSelectChoice.convertValue() is has a 'final' modifier.  (I'm guessing this is an inside joke because it does a linear search... ;-))
> Any chance of removing the final modifier?

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


[jira] Commented: (WICKET-348) Propose removing 'final' modifier to AbstractSingleSelectChoice.convertValue()

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

Johan Compagner commented on WICKET-348:
----------------------------------------

why can't you use IChoiceRenderer for this?

> Propose removing 'final' modifier to AbstractSingleSelectChoice.convertValue()
> ------------------------------------------------------------------------------
>
>                 Key: WICKET-348
>                 URL: https://issues.apache.org/jira/browse/WICKET-348
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket
>    Affects Versions: 2.0
>            Reporter: Brian Topping
>
> While creating a subclass of DropDownChoice, I wanted to write a specialized reverse mapping function that would allow the option value to be used as the primary key for direct lookup of the object.  Unfortunately, AbstractSingleSelectChoice.convertValue() is has a 'final' modifier.  (I'm guessing this is an inside joke because it does a linear search... ;-))
> Any chance of removing the final modifier?

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


[jira] Commented: (WICKET-348) Propose removing 'final' modifier to AbstractSingleSelectChoice.convertValue()

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

Igor Vaynberg commented on WICKET-348:
--------------------------------------

because ichoicerenderer only does object->id, he wants a custom id->object lookup

> Propose removing 'final' modifier to AbstractSingleSelectChoice.convertValue()
> ------------------------------------------------------------------------------
>
>                 Key: WICKET-348
>                 URL: https://issues.apache.org/jira/browse/WICKET-348
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket
>    Affects Versions: 2.0
>            Reporter: Brian Topping
>
> While creating a subclass of DropDownChoice, I wanted to write a specialized reverse mapping function that would allow the option value to be used as the primary key for direct lookup of the object.  Unfortunately, AbstractSingleSelectChoice.convertValue() is has a 'final' modifier.  (I'm guessing this is an inside joke because it does a linear search... ;-))
> Any chance of removing the final modifier?

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


[jira] Commented: (WICKET-348) Propose removing 'final' modifier to AbstractSingleSelectChoice.convertValue()

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

Igor Vaynberg commented on WICKET-348:
--------------------------------------

i dont think the interface would become much more polluted. we would have an abstract choice renderer class to extend from instead of implementing the interface directly in case you do not care, so this change would be pretty much transparent in a lot of cases.

i patched listmultiplechoice and added convertChoiceIdsToChoices

> Propose removing 'final' modifier to AbstractSingleSelectChoice.convertValue()
> ------------------------------------------------------------------------------
>
>                 Key: WICKET-348
>                 URL: https://issues.apache.org/jira/browse/WICKET-348
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket
>    Affects Versions: 2.0 branch (discontinued)
>            Reporter: Brian Topping
>            Assignee: Igor Vaynberg
>             Fix For: 1.3.0-beta2
>
>
> While creating a subclass of DropDownChoice, I wanted to write a specialized reverse mapping function that would allow the option value to be used as the primary key for direct lookup of the object.  Unfortunately, AbstractSingleSelectChoice.convertValue() is has a 'final' modifier.  (I'm guessing this is an inside joke because it does a linear search... ;-))
> Any chance of removing the final modifier?

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


[jira] Commented: (WICKET-348) Propose removing 'final' modifier to AbstractSingleSelectChoice.convertValue()

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

Johan Compagner commented on WICKET-348:
----------------------------------------

then the interface would be come much more poluted and harder to implement.

Also what about ListMultipleChoice.convertValue() ?
that works a little bit different. you can't have the convertChoiceIdToChoice but convertChoicesIdToChoices?

i think the current way is fine (except maybe also refactor the ListMultiplyChoice.convertValue)

> Propose removing 'final' modifier to AbstractSingleSelectChoice.convertValue()
> ------------------------------------------------------------------------------
>
>                 Key: WICKET-348
>                 URL: https://issues.apache.org/jira/browse/WICKET-348
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket
>    Affects Versions: 2.0 branch (discontinued)
>            Reporter: Brian Topping
>            Assignee: Igor Vaynberg
>             Fix For: 1.3.0-beta2
>
>
> While creating a subclass of DropDownChoice, I wanted to write a specialized reverse mapping function that would allow the option value to be used as the primary key for direct lookup of the object.  Unfortunately, AbstractSingleSelectChoice.convertValue() is has a 'final' modifier.  (I'm guessing this is an inside joke because it does a linear search... ;-))
> Any chance of removing the final modifier?

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


[jira] Commented: (WICKET-348) Propose removing 'final' modifier to AbstractSingleSelectChoice.convertValue()

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

Johan Compagner commented on WICKET-348:
----------------------------------------

huh? IChoiceRenderer works both ways convertValue impl we now have does id-> object.


> Propose removing 'final' modifier to AbstractSingleSelectChoice.convertValue()
> ------------------------------------------------------------------------------
>
>                 Key: WICKET-348
>                 URL: https://issues.apache.org/jira/browse/WICKET-348
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket
>    Affects Versions: 2.0
>            Reporter: Brian Topping
>
> While creating a subclass of DropDownChoice, I wanted to write a specialized reverse mapping function that would allow the option value to be used as the primary key for direct lookup of the object.  Unfortunately, AbstractSingleSelectChoice.convertValue() is has a 'final' modifier.  (I'm guessing this is an inside joke because it does a linear search... ;-))
> Any chance of removing the final modifier?

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