Re: How to add filter to palette component?

2009-06-23 Thread Eyal Golan
BTW, here the whole code of the palette creationg:
private CustomPalette newSelectedSection(final Form form) {
final RolesCoverageDasboard rolesCoverageDasboard =
(RolesCoverageDasboard) getModelObject();
final IChoiceRenderer choiceRenderer = new
ChoiceRenderer("getConfigurationName", "getConfigurationName");
final IModel allConfigurationsModel = new AbstractReadOnlyModel() {
// Model for choices
private static final long serialVersionUID = 1L;

@Override
public Object getObject() {
final List allConfigsFromMap;
if (rolesCoverageDasboard.getUniverse() == null) {
allConfigsFromMap = Collections.emptyList();
return allConfigsFromMap;
}
allConfigsFromMap =
universesConfigurationsMap.get(rolesCoverageDasboard.getUniverse());
final List configsForPalette = new
ArrayList(allConfigsFromMap);

configsForPalette.remove(rolesCoverageDasboard.getMainConfiguration());
return configsForPalette;
}
};
final CustomPalette palette = new CustomPalette("palette", new
PropertyModel(rolesCoverageDasboard,
"comparedConfigurations"), allConfigurationsModel,
choiceRenderer, 10, true);
palette.setOutputMarkupId(true);
form.add(palette);
return palette;
}

It is very similar to yours. (list etc.)

Eyal Golan
egola...@gmail.com

Visit: http://jvdrums.sourceforge.net/
LinkedIn: http://www.linkedin.com/in/egolan74

P  Save a tree. Please don't print this e-mail unless it's really necessary


Re: How to add filter to palette component?

2009-06-23 Thread Eyal Golan
I've just noticed.
I also added this:
palette.setOutputMarkupId(true);


Eyal Golan
egola...@gmail.com

Visit: http://jvdrums.sourceforge.net/
LinkedIn: http://www.linkedin.com/in/egolan74

P  Save a tree. Please don't print this e-mail unless it's really necessary


On Tue, Jun 23, 2009 at 8:58 PM, Rangel Preis  wrote:

> Golan... the object have the correct value in code, but in the page it's
> blank.
>
> 2009/6/23 Eyal Golan :
> > It looks just like what I did.
> > Did you break-point at
> > public Object getObject() {
> >   return this.avaliableList;
> >   }
> >
> > ?
> >
> > or at avaliableList = getNewList();
> >
> > Is the list full?
> >
> > Maybe you should try AjaxSubmitLink (Just a thought. I don't use it that
> > often)?
> >
> >
> > Eyal Golan
> > egola...@gmail.com
> >
> > Visit: http://jvdrums.sourceforge.net/
> > LinkedIn: http://www.linkedin.com/in/egolan74
> >
> > P  Save a tree. Please don't print this e-mail unless it's really
> necessary
> >
> >
> >
> >>
> >
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


Re: How to add filter to palette component?

2009-06-23 Thread Rangel Preis
Golan... the object have the correct value in code, but in the page it's blank.

2009/6/23 Eyal Golan :
> It looks just like what I did.
> Did you break-point at
> public Object getObject() {
>               return this.avaliableList;
>           }
>
> ?
>
> or at avaliableList = getNewList();
>
> Is the list full?
>
> Maybe you should try AjaxSubmitLink (Just a thought. I don't use it that
> often)?
>
>
> Eyal Golan
> egola...@gmail.com
>
> Visit: http://jvdrums.sourceforge.net/
> LinkedIn: http://www.linkedin.com/in/egolan74
>
> P  Save a tree. Please don't print this e-mail unless it's really necessary
>
>
>
>>
>

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



Re: How to add filter to palette component?

2009-06-23 Thread Eyal Golan
It looks just like what I did.
Did you break-point at
public Object getObject() {
   return this.avaliableList;
   }

?

or at avaliableList = getNewList();

Is the list full?

Maybe you should try AjaxSubmitLink (Just a thought. I don't use it that
often)?


Eyal Golan
egola...@gmail.com

Visit: http://jvdrums.sourceforge.net/
LinkedIn: http://www.linkedin.com/in/egolan74

P  Save a tree. Please don't print this e-mail unless it's really necessary



>


Re: How to add filter to palette component?

2009-06-23 Thread Rangel Preis
Thanks Fernando and Eyal.
But it's not work.

I try the code below, when I change the value of avaliable itens the
itens in the screen became blank , and don't show the new value.



Custem Palette

class MyPalette extends Palette {

private Component externalizedChoiceComponent;

@Override
protected Component newChoicesComponent() {
final Component result = super.newChoicesComponent();
this.externalizedChoiceComponent = result;
this.externalizedChoiceComponent.setOutputMarkupId(true);
return result;
}

public Component getExternalizedChoiceComponent() {
return this.externalizedChoiceComponent;
}
}


final IModel avaliableModel = new AbstractReadOnlyModel() {
@Override
public Object getObject() {
return this.avaliableList;
}
};

Palette creation

final MyPalette palette = new MyPalette("palette", inUseModel,
avaliableModel, renderer, 10, true);

this.form.add(new AjaxLink("btFind") {

@Override
public void onClick(final AjaxRequestTarget target) {
try {
  avaliableList = getNewList();
} catch (final Exception e) {
log.error(e);
}

target.addComponent(palette.getExternalizedChoiceComponent());
}

});

Anyone have another tip?

Thanks.


2009/6/23 Eyal Golan :
> Here what I did:
> choiceComponent in the original Palette is private, so in my custom palette
> I externalized it:
>
> private Component externalizedChoiceComponent;
>
> Then, I overridden the method newChoicesComponent :
>   �...@override
>    protected Component newChoicesComponent() {
>        final Component result = super.newChoicesComponent();
>        externalizedChoiceComponent = result;
>        externalizedChoiceComponent.setOutputMarkupId(true);
>        return result;
>    }
>
>    public Component getExternalizedChoiceComponent() {
>        return this.externalizedChoiceComponent;
>    }
>
> My situation was that I wanted to change the choices with a DropDown
> component.
> We have a custom DropDown that is ajaxified:
>        final DropDownChoice configurationChoice = new
> DropDownChoiceWithAjaxIndicator("mainConfiguration",
>                getConfigurationsModel(), new
> ChoiceRenderer("configurationName", "configurationName")) {
>            private static final long serialVersionUID = 1L;
>
>           �...@override
>            public void updateOnChange(AjaxRequestTarget target) {
>
> target.addComponent(palette.getExternalizedChoiceComponent());
>            }
>        };
>
> Below is the IModel for the palette that needs to be changed:
>        final IModel allConfigurationsModel = new AbstractReadOnlyModel() {
>            private static final long serialVersionUID = 1L;
>
>           �...@override
>            public Object getObject() {
>               // Do whatever you want to get the correct choices
>            }
>        };
> And this is the Palette creation:
>        final CustomPalette palette = new CustomPalette("palette", new
> PropertyModel(rolesCoverageDasboard,
>                "comparedConfigurations"), allConfigurationsModel,
> choiceRenderer, 10, true);
>
> Is this what you need?
>
> BTW,
> I think I'll have a look at the Recorder, though I'm not sure I can use it.
>
> Maybe we should open a JIRA to have getChoicesComponent() in the Palette?
> (we use 1.3.6)
>
> Eyal Golan
> egola...@gmail.com
>
> Visit: http://jvdrums.sourceforge.net/
> LinkedIn: http://www.linkedin.com/in/egolan74
>
> P  Save a tree. Please don't print this e-mail unless it's really necessary
>
>
> On Mon, Jun 22, 2009 at 11:57 PM, Rangel Preis  wrote:
>
>> Sorry Fernando but it's not helpful.
>>
>> When i click in my search button (a button out of palette)  i want to
>> change all data from the left side of palette (Available itens).
>> I don't want to interact with the palette buttons i want to use a
>> button out of the component.
>>
>> Using
>> PropertyModel availableItens = new PropertyModel(this, "listDirector");
>> or
>> Model availableItens = new Model((Serializable)
>> this.listDirector);
>>
>> ..
>>
>> form.add(new Palette("palette", selectedItens, availableItens,
>> renderer, 10, true));
>>
>> form.add(new(AjaxLink btFilterPaletteContent = new
>> AjaxLink("btFilterPaletteContent"){
>>
>>   @Override
>>   public void onClick(AjaxRequestTarget target) {
>>        What i can put here to change my avaliable itens (the palette left
>> list)?
>>       target.addComponent(this.form);
>>   }
>> };)
>>
>>
>>
>>
>> 2009/6/22 Fernando Wermus :
>> > If I understood correctly you would want to do this (which It can be
>> found
>> > at Palette comments at the begining)
>> >
>> >  Ajaxifying the palette: The palette itself cannot be
>> > ajaxified because it is a
>> >  panel and therefore does not receive a

Re: How to add filter to palette component?

2009-06-23 Thread Eyal Golan
Here what I did:
choiceComponent in the original Palette is private, so in my custom palette
I externalized it:

private Component externalizedChoiceComponent;

Then, I overridden the method newChoicesComponent :
@Override
protected Component newChoicesComponent() {
final Component result = super.newChoicesComponent();
externalizedChoiceComponent = result;
externalizedChoiceComponent.setOutputMarkupId(true);
return result;
}

public Component getExternalizedChoiceComponent() {
return this.externalizedChoiceComponent;
}

My situation was that I wanted to change the choices with a DropDown
component.
We have a custom DropDown that is ajaxified:
final DropDownChoice configurationChoice = new
DropDownChoiceWithAjaxIndicator("mainConfiguration",
getConfigurationsModel(), new
ChoiceRenderer("configurationName", "configurationName")) {
private static final long serialVersionUID = 1L;

@Override
public void updateOnChange(AjaxRequestTarget target) {

target.addComponent(palette.getExternalizedChoiceComponent());
}
};

Below is the IModel for the palette that needs to be changed:
final IModel allConfigurationsModel = new AbstractReadOnlyModel() {
private static final long serialVersionUID = 1L;

@Override
public Object getObject() {
   // Do whatever you want to get the correct choices
}
};
And this is the Palette creation:
final CustomPalette palette = new CustomPalette("palette", new
PropertyModel(rolesCoverageDasboard,
"comparedConfigurations"), allConfigurationsModel,
choiceRenderer, 10, true);

Is this what you need?

BTW,
I think I'll have a look at the Recorder, though I'm not sure I can use it.

Maybe we should open a JIRA to have getChoicesComponent() in the Palette?
(we use 1.3.6)

Eyal Golan
egola...@gmail.com

Visit: http://jvdrums.sourceforge.net/
LinkedIn: http://www.linkedin.com/in/egolan74

P  Save a tree. Please don't print this e-mail unless it's really necessary


On Mon, Jun 22, 2009 at 11:57 PM, Rangel Preis  wrote:

> Sorry Fernando but it's not helpful.
>
> When i click in my search button (a button out of palette)  i want to
> change all data from the left side of palette (Available itens).
> I don't want to interact with the palette buttons i want to use a
> button out of the component.
>
> Using
> PropertyModel availableItens = new PropertyModel(this, "listDirector");
> or
> Model availableItens = new Model((Serializable)
> this.listDirector);
>
> ..
>
> form.add(new Palette("palette", selectedItens, availableItens,
> renderer, 10, true));
>
> form.add(new(AjaxLink btFilterPaletteContent = new
> AjaxLink("btFilterPaletteContent"){
>
>   @Override
>   public void onClick(AjaxRequestTarget target) {
>What i can put here to change my avaliable itens (the palette left
> list)?
>   target.addComponent(this.form);
>   }
> };)
>
>
>
>
> 2009/6/22 Fernando Wermus :
> > If I understood correctly you would want to do this (which It can be
> found
> > at Palette comments at the begining)
> >
> >  Ajaxifying the palette: The palette itself cannot be
> > ajaxified because it is a
> >  panel and therefore does not receive any javascript events. Instead ajax
> > behaviors can be
> >  attached to the recorder component which supports the javascript
> > onchange event. The
> >  recorder component can be retrieved via a call to {...@link
> > #getRecorderComponent()}.
> >
> >  Example:
> >
> >  
> >  Form form=new Form(...);
> >  Palette palette=new Palette(...);
> >  palette.getRecorderComponent().add(new
> > AjaxFormComponentUpdatingBehavior("onchange") {...});
> >
> > Then when someone click in any of the buttons you can take a decision
> over
> > the selected items or choiced items. You can do this without ajax
> replacing
> > the newUp, new newDown protected methods.
> >
> > I hope I help you a bit.
> >
> > On Mon, Jun 22, 2009 at 12:08 PM, Rangel Preis 
> wrote:
> >
> >> Hi, how can i filter the possible choices in the palette component i
> >> read the topics below put it not helpful for me.
> >>
> >>
> >>
> http://www.nabble.com/how-to-add-filter-for-Palette-choice-td23269578.html#a23269578
> >>
> >>
> http://www.nabble.com/changing-choices-component-in-Palette-td23982514.html#a23982514
> >>
> >> I have this:
> >>
> >> final IChoiceRenderer renderer = new
> >> ChoiceRenderer("name", "name");
> >> form.add(new Palette("paletteDiretores", selectedItens,
> >> availableItens, renderer, 10, true));
> >>
> >> And a button:
> >>
> >> AjaxLink btFilterPaletteContent = new
> AjaxLink("btFilterPaletteContent"){
> >>
> >>@Override
> >>public void onClick(AjaxRequestTarget target) {
> >>availableItens = search new itens
> >>}
> >> };
> >>
> >> I try this and don't work, if i inspect the objet the value is OK, but
>

Re: How to add filter to palette component?

2009-06-22 Thread Rangel Preis
Sorry Fernando but it's not helpful.

When i click in my search button (a button out of palette)  i want to
change all data from the left side of palette (Available itens).
I don't want to interact with the palette buttons i want to use a
button out of the component.

Using
PropertyModel availableItens = new PropertyModel(this, "listDirector");
or
Model availableItens = new Model((Serializable)
this.listDirector);

..

form.add(new Palette("palette", selectedItens, availableItens,
renderer, 10, true));

form.add(new(AjaxLink btFilterPaletteContent = new
AjaxLink("btFilterPaletteContent"){

   @Override
   public void onClick(AjaxRequestTarget target) {
   What i can put here to change my avaliable itens (the palette left list)?
   target.addComponent(this.form);
   }
};)




2009/6/22 Fernando Wermus :
> If I understood correctly you would want to do this (which It can be found
> at Palette comments at the begining)
>
>  Ajaxifying the palette: The palette itself cannot be
> ajaxified because it is a
>  panel and therefore does not receive any javascript events. Instead ajax
> behaviors can be
>  attached to the recorder component which supports the javascript
> onchange event. The
>  recorder component can be retrieved via a call to {...@link
> #getRecorderComponent()}.
>
>  Example:
>
>  
>          Form form=new Form(...);
>          Palette palette=new Palette(...);
>          palette.getRecorderComponent().add(new
> AjaxFormComponentUpdatingBehavior("onchange") {...});
>
> Then when someone click in any of the buttons you can take a decision over
> the selected items or choiced items. You can do this without ajax replacing
> the newUp, new newDown protected methods.
>
> I hope I help you a bit.
>
> On Mon, Jun 22, 2009 at 12:08 PM, Rangel Preis  wrote:
>
>> Hi, how can i filter the possible choices in the palette component i
>> read the topics below put it not helpful for me.
>>
>>
>> http://www.nabble.com/how-to-add-filter-for-Palette-choice-td23269578.html#a23269578
>>
>> http://www.nabble.com/changing-choices-component-in-Palette-td23982514.html#a23982514
>>
>> I have this:
>>
>> final IChoiceRenderer renderer = new
>> ChoiceRenderer("name", "name");
>> form.add(new Palette("paletteDiretores", selectedItens,
>> availableItens, renderer, 10, true));
>>
>> And a button:
>>
>> AjaxLink btFilterPaletteContent = new AjaxLink("btFilterPaletteContent"){
>>
>>   �...@override
>>    public void onClick(AjaxRequestTarget target) {
>>        availableItens = search new itens
>>    }
>> };
>>
>> I try this and don't work, if i inspect the objet the value is OK, but
>> in the screen the palette become blank.
>>
>> i try to use propertymodel to avaliableitens... don't work too..
>> I just want to chance the content of the avaliable itens in the panel
>> without affect the selecteds itens.
>>
>> Anyone can help me?
>>
>> Thanks.
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>>
>
>
> --
> Fernando Wermus.
>
> www.linkedin.com/in/fernandowermus
>

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



Re: How to add filter to palette component?

2009-06-22 Thread Fernando Wermus
If I understood correctly you would want to do this (which It can be found
at Palette comments at the begining)

 Ajaxifying the palette: The palette itself cannot be
ajaxified because it is a
 panel and therefore does not receive any javascript events. Instead ajax
behaviors can be
 attached to the recorder component which supports the javascript
onchange event. The
 recorder component can be retrieved via a call to {...@link
#getRecorderComponent()}.

  Example:

  
  Form form=new Form(...);
  Palette palette=new Palette(...);
  palette.getRecorderComponent().add(new
AjaxFormComponentUpdatingBehavior("onchange") {...});

Then when someone click in any of the buttons you can take a decision over
the selected items or choiced items. You can do this without ajax replacing
the newUp, new newDown protected methods.

I hope I help you a bit.

On Mon, Jun 22, 2009 at 12:08 PM, Rangel Preis  wrote:

> Hi, how can i filter the possible choices in the palette component i
> read the topics below put it not helpful for me.
>
>
> http://www.nabble.com/how-to-add-filter-for-Palette-choice-td23269578.html#a23269578
>
> http://www.nabble.com/changing-choices-component-in-Palette-td23982514.html#a23982514
>
> I have this:
>
> final IChoiceRenderer renderer = new
> ChoiceRenderer("name", "name");
> form.add(new Palette("paletteDiretores", selectedItens,
> availableItens, renderer, 10, true));
>
> And a button:
>
> AjaxLink btFilterPaletteContent = new AjaxLink("btFilterPaletteContent"){
>
>@Override
>public void onClick(AjaxRequestTarget target) {
>availableItens = search new itens
>}
> };
>
> I try this and don't work, if i inspect the objet the value is OK, but
> in the screen the palette become blank.
>
> i try to use propertymodel to avaliableitens... don't work too..
> I just want to chance the content of the avaliable itens in the panel
> without affect the selecteds itens.
>
> Anyone can help me?
>
> Thanks.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


-- 
Fernando Wermus.

www.linkedin.com/in/fernandowermus


How to add filter to palette component?

2009-06-22 Thread Rangel Preis
Hi, how can i filter the possible choices in the palette component i
read the topics below put it not helpful for me.

http://www.nabble.com/how-to-add-filter-for-Palette-choice-td23269578.html#a23269578
http://www.nabble.com/changing-choices-component-in-Palette-td23982514.html#a23982514

I have this:

final IChoiceRenderer renderer = new
ChoiceRenderer("name", "name");
form.add(new Palette("paletteDiretores", selectedItens,
availableItens, renderer, 10, true));

And a button:

AjaxLink btFilterPaletteContent = new AjaxLink("btFilterPaletteContent"){

@Override
public void onClick(AjaxRequestTarget target) {
availableItens = search new itens
}
};

I try this and don't work, if i inspect the objet the value is OK, but
in the screen the palette become blank.

i try to use propertymodel to avaliableitens... don't work too..
I just want to chance the content of the avaliable itens in the panel
without affect the selecteds itens.

Anyone can help me?

Thanks.

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