You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Jan Kriesten (JIRA)" <ji...@apache.org> on 2007/10/24 16:25:50 UTC

[jira] Created: (WICKET-1099) ChoiceFilteredPropertyColumn: access to the DropDownChoice

ChoiceFilteredPropertyColumn: access to the DropDownChoice
----------------------------------------------------------

                 Key: WICKET-1099
                 URL: https://issues.apache.org/jira/browse/WICKET-1099
             Project: Wicket
          Issue Type: Improvement
          Components: wicket-extensions
    Affects Versions: 1.3.0-beta4
         Environment: any
            Reporter: Jan Kriesten


To have the ChoiceFilter use a DropDown with setNullValid( true ) (for resetting the filter again in my case), I have to construct a complex new Filter like this:

new ChoiceFilteredPropertyColumn( new Model( "type" ), "property_type", "type", new Model( (Serializable) propertiesDao.getPropertyTypes() ) )
    {
      private static final long serialVersionUID = 1L;

      public Component getFilter( String componentId, FilterForm filterForm )
      {
        ChoiceFilter filter = new ChoiceFilter( componentId, getFilterModel( filterForm ), filterForm,
                getFilterChoices(), enableAutoSubmit() )
        {
          protected DropDownChoice newDropDownChoice( String id, IModel model, IModel choices,
                                                      IChoiceRenderer renderer )
          {
            DropDownChoice dropdown = new DropDownChoice( id, model, choices, renderer );
            dropdown.setNullValid( true );
            return dropdown;
          }
        };

        IChoiceRenderer renderer = getChoiceRenderer();
        if( renderer != null )
        {
          filter.getChoice().setChoiceRenderer( renderer );
        }
        return filter;
      }

This is much of copy-paste from the original sources just to do a simple "dropdown.setNullValid( true );" - it would be nice, if one could get hold of the dropdown in a more decent way.



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


[jira] Resolved: (WICKET-1099) ChoiceFilteredPropertyColumn: access to the DropDownChoice

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

Igor Vaynberg resolved WICKET-1099.
-----------------------------------

    Resolution: Won't Fix
      Assignee: Igor Vaynberg

this is already possible like so:

new ChoiceFilteredPropertyColumn(...) {
  Component getFilter(id,form) {
     ChoiceFilter filter=super.getFilter(id,form);
     filter.getchoice().setnullvalid(true);
    return filter;
  }
}


> ChoiceFilteredPropertyColumn: access to the DropDownChoice
> ----------------------------------------------------------
>
>                 Key: WICKET-1099
>                 URL: https://issues.apache.org/jira/browse/WICKET-1099
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket-extensions
>    Affects Versions: 1.3.0-beta4
>         Environment: any
>            Reporter: Jan Kriesten
>            Assignee: Igor Vaynberg
>
> To have the ChoiceFilter use a DropDown with setNullValid( true ) (for resetting the filter again in my case), I have to construct a complex new Filter like this:
> new ChoiceFilteredPropertyColumn( new Model( "type" ), "property_type", "type", new Model( (Serializable) propertiesDao.getPropertyTypes() ) )
>     {
>       private static final long serialVersionUID = 1L;
>       public Component getFilter( String componentId, FilterForm filterForm )
>       {
>         ChoiceFilter filter = new ChoiceFilter( componentId, getFilterModel( filterForm ), filterForm,
>                 getFilterChoices(), enableAutoSubmit() )
>         {
>           protected DropDownChoice newDropDownChoice( String id, IModel model, IModel choices,
>                                                       IChoiceRenderer renderer )
>           {
>             DropDownChoice dropdown = new DropDownChoice( id, model, choices, renderer );
>             dropdown.setNullValid( true );
>             return dropdown;
>           }
>         };
>         IChoiceRenderer renderer = getChoiceRenderer();
>         if( renderer != null )
>         {
>           filter.getChoice().setChoiceRenderer( renderer );
>         }
>         return filter;
>       }
> This is much of copy-paste from the original sources just to do a simple "dropdown.setNullValid( true );" - it would be nice, if one could get hold of the dropdown in a more decent way.

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