You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Wolfgang (Created) (JIRA)" <ji...@apache.org> on 2011/11/16 17:17:51 UTC

[jira] [Created] (WICKET-4231) Palette - LoadableDetachableModel

Palette - LoadableDetachableModel
---------------------------------

                 Key: WICKET-4231
                 URL: https://issues.apache.org/jira/browse/WICKET-4231
             Project: Wicket
          Issue Type: Improvement
          Components: wicket-extensions
    Affects Versions: 1.5.3
            Reporter: Wolfgang
            Priority: Minor


When using the Palette you get the List of all available Choices from the choicesModel via Constructor

When this Model is a LoadableDetachableModel<List<String>> (so choices are not serialized)
there is a problem when using as follows:

I have a ListModel<String> as model and a LoadableDetachableModel<List<String>> for choicesModel
So from start the model's List has some values which are *not* available in the choicesModel's List.
Theirfor I fetch the available List from database and do an addAll of all Items in the modelList

When you show the Palette for the first time everything is correct as all available Values are in the left List - and the presetted Values are in the right List.
When you change nothing and just press the submit button - the updateModel() Method first clears out the model Values (including the presetted values) and then calls
getRecorderComponent().getSelectedChoices()
Theirfor the presetted Values are gone and the selected Value list is empty



To clear out things:
ModelList contains 'D'
choicesModelList contains ('A','B','C'),
in the load of the choiceModelList i add the D to the choiceModelList
when just submitting form - the updateModel Method clears out the D
and then fetches available Values again where the D already has gone.


Workaround:
Not using a LoadableDetachableModel but a normal ListModel works but Choices then get serialized which is not optimal.

Prob. Solution:
I tested with just move the line 
Iterator<T> it = getRecorderComponent().getSelectedChoices();
at the top of the Method
from 501 to 495
then it works as expected.

org/apache/wicket/extensions/markup/html/form/palette/Palette.java 
Line 498


Please comment your 2 cents on this.
Greetings

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (WICKET-4231) allow palette's choicesModel to take current selection into account

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

Sven Meier updated WICKET-4231:
-------------------------------

    Affects Version/s: 1.6.0
              Summary: allow palette's choicesModel to take current selection into account  (was: Palette - LoadableDetachableModel)
    
> allow palette's choicesModel to take current selection into account
> -------------------------------------------------------------------
>
>                 Key: WICKET-4231
>                 URL: https://issues.apache.org/jira/browse/WICKET-4231
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket-extensions
>    Affects Versions: 1.5.3, 1.6.0
>            Reporter: Wolfgang
>            Assignee: Sven Meier
>            Priority: Minor
>         Attachments: myproject.tar.gz
>
>   Original Estimate: 5m
>  Remaining Estimate: 5m
>
> When using the Palette you get the List of all available Choices from the choicesModel via Constructor
> When this Model is a LoadableDetachableModel<List<String>> (so choices are not serialized)
> there is a problem when using as follows:
> I have a ListModel<String> as model and a LoadableDetachableModel<List<String>> for choicesModel
> So from start the model's List has some values which are *not* available in the choicesModel's List.
> Theirfor I fetch the available List from database and do an addAll of all Items in the modelList
> When you show the Palette for the first time everything is correct as all available Values are in the left List - and the presetted Values are in the right List.
> When you change nothing and just press the submit button - the updateModel() Method first clears out the model Values (including the presetted values) and then calls
> getRecorderComponent().getSelectedChoices()
> Theirfor the presetted Values are gone and the selected Value list is empty
> To clear out things:
> ModelList contains 'D'
> choicesModelList contains ('A','B','C'),
> in the load of the choiceModelList i add the D to the choiceModelList
> when just submitting form - the updateModel Method clears out the D
> and then fetches available Values again where the D already has gone.
> Workaround:
> Not using a LoadableDetachableModel but a normal ListModel works but Choices then get serialized which is not optimal.
> Prob. Solution:
> I tested with just move the line 
> Iterator<T> it = getRecorderComponent().getSelectedChoices();
> at the top of the Method
> from 501 to 495
> then it works as expected.
> org/apache/wicket/extensions/markup/html/form/palette/Palette.java 
> Line 498
> Please comment your 2 cents on this.
> Greetings

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (WICKET-4231) Palette - LoadableDetachableModel

Posted by "Sven Meier (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-4231?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13151894#comment-13151894 ] 

Sven Meier commented on WICKET-4231:
------------------------------------

Your pseudo code is hard to follow, could you please provide a quickstart?
                
> Palette - LoadableDetachableModel
> ---------------------------------
>
>                 Key: WICKET-4231
>                 URL: https://issues.apache.org/jira/browse/WICKET-4231
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket-extensions
>    Affects Versions: 1.5.3
>            Reporter: Wolfgang
>            Priority: Minor
>   Original Estimate: 5m
>  Remaining Estimate: 5m
>
> When using the Palette you get the List of all available Choices from the choicesModel via Constructor
> When this Model is a LoadableDetachableModel<List<String>> (so choices are not serialized)
> there is a problem when using as follows:
> I have a ListModel<String> as model and a LoadableDetachableModel<List<String>> for choicesModel
> So from start the model's List has some values which are *not* available in the choicesModel's List.
> Theirfor I fetch the available List from database and do an addAll of all Items in the modelList
> When you show the Palette for the first time everything is correct as all available Values are in the left List - and the presetted Values are in the right List.
> When you change nothing and just press the submit button - the updateModel() Method first clears out the model Values (including the presetted values) and then calls
> getRecorderComponent().getSelectedChoices()
> Theirfor the presetted Values are gone and the selected Value list is empty
> To clear out things:
> ModelList contains 'D'
> choicesModelList contains ('A','B','C'),
> in the load of the choiceModelList i add the D to the choiceModelList
> when just submitting form - the updateModel Method clears out the D
> and then fetches available Values again where the D already has gone.
> Workaround:
> Not using a LoadableDetachableModel but a normal ListModel works but Choices then get serialized which is not optimal.
> Prob. Solution:
> I tested with just move the line 
> Iterator<T> it = getRecorderComponent().getSelectedChoices();
> at the top of the Method
> from 501 to 495
> then it works as expected.
> org/apache/wicket/extensions/markup/html/form/palette/Palette.java 
> Line 498
> Please comment your 2 cents on this.
> Greetings

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Issue Comment Edited] (WICKET-4231) Palette - LoadableDetachableModel

Posted by "Wolfgang (Issue Comment Edited) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-4231?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13151962#comment-13151962 ] 

Wolfgang edited comment on WICKET-4231 at 11/17/11 10:04 AM:
-------------------------------------------------------------

added myproject.tar.gz
small project - 3 pages - just press the submit button and see the difference

added a todo marker for easier finding in the MyPalette Class.

Should have done this from beginning - to make things clearer ;-)
                
      was (Author: wolfman22):
    small project - 3 pages - just press the submit button and see the difference

added a todo marker for easier finding in the MyPalette Class.

Should have done this from beginning - to make things clearer ;-)
                  
> Palette - LoadableDetachableModel
> ---------------------------------
>
>                 Key: WICKET-4231
>                 URL: https://issues.apache.org/jira/browse/WICKET-4231
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket-extensions
>    Affects Versions: 1.5.3
>            Reporter: Wolfgang
>            Priority: Minor
>         Attachments: myproject.tar.gz
>
>   Original Estimate: 5m
>  Remaining Estimate: 5m
>
> When using the Palette you get the List of all available Choices from the choicesModel via Constructor
> When this Model is a LoadableDetachableModel<List<String>> (so choices are not serialized)
> there is a problem when using as follows:
> I have a ListModel<String> as model and a LoadableDetachableModel<List<String>> for choicesModel
> So from start the model's List has some values which are *not* available in the choicesModel's List.
> Theirfor I fetch the available List from database and do an addAll of all Items in the modelList
> When you show the Palette for the first time everything is correct as all available Values are in the left List - and the presetted Values are in the right List.
> When you change nothing and just press the submit button - the updateModel() Method first clears out the model Values (including the presetted values) and then calls
> getRecorderComponent().getSelectedChoices()
> Theirfor the presetted Values are gone and the selected Value list is empty
> To clear out things:
> ModelList contains 'D'
> choicesModelList contains ('A','B','C'),
> in the load of the choiceModelList i add the D to the choiceModelList
> when just submitting form - the updateModel Method clears out the D
> and then fetches available Values again where the D already has gone.
> Workaround:
> Not using a LoadableDetachableModel but a normal ListModel works but Choices then get serialized which is not optimal.
> Prob. Solution:
> I tested with just move the line 
> Iterator<T> it = getRecorderComponent().getSelectedChoices();
> at the top of the Method
> from 501 to 495
> then it works as expected.
> org/apache/wicket/extensions/markup/html/form/palette/Palette.java 
> Line 498
> Please comment your 2 cents on this.
> Greetings

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (WICKET-4231) Palette - LoadableDetachableModel

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

Wolfgang updated WICKET-4231:
-----------------------------

    Attachment: myproject.tar.gz

small project - 3 pages - just press the submit button and see the difference

added a todo marker for easier finding in the MyPalette Class.

Should have done this from beginning - to make things clearer ;-)
                
> Palette - LoadableDetachableModel
> ---------------------------------
>
>                 Key: WICKET-4231
>                 URL: https://issues.apache.org/jira/browse/WICKET-4231
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket-extensions
>    Affects Versions: 1.5.3
>            Reporter: Wolfgang
>            Priority: Minor
>         Attachments: myproject.tar.gz
>
>   Original Estimate: 5m
>  Remaining Estimate: 5m
>
> When using the Palette you get the List of all available Choices from the choicesModel via Constructor
> When this Model is a LoadableDetachableModel<List<String>> (so choices are not serialized)
> there is a problem when using as follows:
> I have a ListModel<String> as model and a LoadableDetachableModel<List<String>> for choicesModel
> So from start the model's List has some values which are *not* available in the choicesModel's List.
> Theirfor I fetch the available List from database and do an addAll of all Items in the modelList
> When you show the Palette for the first time everything is correct as all available Values are in the left List - and the presetted Values are in the right List.
> When you change nothing and just press the submit button - the updateModel() Method first clears out the model Values (including the presetted values) and then calls
> getRecorderComponent().getSelectedChoices()
> Theirfor the presetted Values are gone and the selected Value list is empty
> To clear out things:
> ModelList contains 'D'
> choicesModelList contains ('A','B','C'),
> in the load of the choiceModelList i add the D to the choiceModelList
> when just submitting form - the updateModel Method clears out the D
> and then fetches available Values again where the D already has gone.
> Workaround:
> Not using a LoadableDetachableModel but a normal ListModel works but Choices then get serialized which is not optimal.
> Prob. Solution:
> I tested with just move the line 
> Iterator<T> it = getRecorderComponent().getSelectedChoices();
> at the top of the Method
> from 501 to 495
> then it works as expected.
> org/apache/wicket/extensions/markup/html/form/palette/Palette.java 
> Line 498
> Please comment your 2 cents on this.
> Greetings

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Issue Comment Edited] (WICKET-4231) Palette - LoadableDetachableModel

Posted by "Wolfgang (Issue Comment Edited) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-4231?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13151962#comment-13151962 ] 

Wolfgang edited comment on WICKET-4231 at 11/17/11 10:09 AM:
-------------------------------------------------------------

added myproject.tar.gz
small project - 3 pages - just press the submit button and see the difference

added a todo marker for easier finding in the MyPalette Class.

Should have added a quickstart like this from beginning - sorry
                
      was (Author: wolfman22):
    added myproject.tar.gz
small project - 3 pages - just press the submit button and see the difference

added a todo marker for easier finding in the MyPalette Class.

Should have done this from beginning - to make things clearer ;-)
                  
> Palette - LoadableDetachableModel
> ---------------------------------
>
>                 Key: WICKET-4231
>                 URL: https://issues.apache.org/jira/browse/WICKET-4231
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket-extensions
>    Affects Versions: 1.5.3
>            Reporter: Wolfgang
>            Priority: Minor
>         Attachments: myproject.tar.gz
>
>   Original Estimate: 5m
>  Remaining Estimate: 5m
>
> When using the Palette you get the List of all available Choices from the choicesModel via Constructor
> When this Model is a LoadableDetachableModel<List<String>> (so choices are not serialized)
> there is a problem when using as follows:
> I have a ListModel<String> as model and a LoadableDetachableModel<List<String>> for choicesModel
> So from start the model's List has some values which are *not* available in the choicesModel's List.
> Theirfor I fetch the available List from database and do an addAll of all Items in the modelList
> When you show the Palette for the first time everything is correct as all available Values are in the left List - and the presetted Values are in the right List.
> When you change nothing and just press the submit button - the updateModel() Method first clears out the model Values (including the presetted values) and then calls
> getRecorderComponent().getSelectedChoices()
> Theirfor the presetted Values are gone and the selected Value list is empty
> To clear out things:
> ModelList contains 'D'
> choicesModelList contains ('A','B','C'),
> in the load of the choiceModelList i add the D to the choiceModelList
> when just submitting form - the updateModel Method clears out the D
> and then fetches available Values again where the D already has gone.
> Workaround:
> Not using a LoadableDetachableModel but a normal ListModel works but Choices then get serialized which is not optimal.
> Prob. Solution:
> I tested with just move the line 
> Iterator<T> it = getRecorderComponent().getSelectedChoices();
> at the top of the Method
> from 501 to 495
> then it works as expected.
> org/apache/wicket/extensions/markup/html/form/palette/Palette.java 
> Line 498
> Please comment your 2 cents on this.
> Greetings

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (WICKET-4231) allow palette's choicesModel to take current selection into account

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

Sven Meier resolved WICKET-4231.
--------------------------------

       Resolution: Fixed
    Fix Version/s: 1.6.0
                   1.5.4

changed updateModel as suggested
                
> allow palette's choicesModel to take current selection into account
> -------------------------------------------------------------------
>
>                 Key: WICKET-4231
>                 URL: https://issues.apache.org/jira/browse/WICKET-4231
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket-extensions
>    Affects Versions: 1.5.3, 1.6.0
>            Reporter: Wolfgang
>            Assignee: Sven Meier
>            Priority: Minor
>             Fix For: 1.5.4, 1.6.0
>
>         Attachments: myproject.tar.gz
>
>   Original Estimate: 5m
>  Remaining Estimate: 5m
>
> When using the Palette you get the List of all available Choices from the choicesModel via Constructor
> When this Model is a LoadableDetachableModel<List<String>> (so choices are not serialized)
> there is a problem when using as follows:
> I have a ListModel<String> as model and a LoadableDetachableModel<List<String>> for choicesModel
> So from start the model's List has some values which are *not* available in the choicesModel's List.
> Theirfor I fetch the available List from database and do an addAll of all Items in the modelList
> When you show the Palette for the first time everything is correct as all available Values are in the left List - and the presetted Values are in the right List.
> When you change nothing and just press the submit button - the updateModel() Method first clears out the model Values (including the presetted values) and then calls
> getRecorderComponent().getSelectedChoices()
> Theirfor the presetted Values are gone and the selected Value list is empty
> To clear out things:
> ModelList contains 'D'
> choicesModelList contains ('A','B','C'),
> in the load of the choiceModelList i add the D to the choiceModelList
> when just submitting form - the updateModel Method clears out the D
> and then fetches available Values again where the D already has gone.
> Workaround:
> Not using a LoadableDetachableModel but a normal ListModel works but Choices then get serialized which is not optimal.
> Prob. Solution:
> I tested with just move the line 
> Iterator<T> it = getRecorderComponent().getSelectedChoices();
> at the top of the Method
> from 501 to 495
> then it works as expected.
> org/apache/wicket/extensions/markup/html/form/palette/Palette.java 
> Line 498
> Please comment your 2 cents on this.
> Greetings

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Assigned] (WICKET-4231) Palette - LoadableDetachableModel

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

Sven Meier reassigned WICKET-4231:
----------------------------------

    Assignee: Sven Meier
    
> Palette - LoadableDetachableModel
> ---------------------------------
>
>                 Key: WICKET-4231
>                 URL: https://issues.apache.org/jira/browse/WICKET-4231
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket-extensions
>    Affects Versions: 1.5.3
>            Reporter: Wolfgang
>            Assignee: Sven Meier
>            Priority: Minor
>         Attachments: myproject.tar.gz
>
>   Original Estimate: 5m
>  Remaining Estimate: 5m
>
> When using the Palette you get the List of all available Choices from the choicesModel via Constructor
> When this Model is a LoadableDetachableModel<List<String>> (so choices are not serialized)
> there is a problem when using as follows:
> I have a ListModel<String> as model and a LoadableDetachableModel<List<String>> for choicesModel
> So from start the model's List has some values which are *not* available in the choicesModel's List.
> Theirfor I fetch the available List from database and do an addAll of all Items in the modelList
> When you show the Palette for the first time everything is correct as all available Values are in the left List - and the presetted Values are in the right List.
> When you change nothing and just press the submit button - the updateModel() Method first clears out the model Values (including the presetted values) and then calls
> getRecorderComponent().getSelectedChoices()
> Theirfor the presetted Values are gone and the selected Value list is empty
> To clear out things:
> ModelList contains 'D'
> choicesModelList contains ('A','B','C'),
> in the load of the choiceModelList i add the D to the choiceModelList
> when just submitting form - the updateModel Method clears out the D
> and then fetches available Values again where the D already has gone.
> Workaround:
> Not using a LoadableDetachableModel but a normal ListModel works but Choices then get serialized which is not optimal.
> Prob. Solution:
> I tested with just move the line 
> Iterator<T> it = getRecorderComponent().getSelectedChoices();
> at the top of the Method
> from 501 to 495
> then it works as expected.
> org/apache/wicket/extensions/markup/html/form/palette/Palette.java 
> Line 498
> Please comment your 2 cents on this.
> Greetings

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira