Re: changing choices component in Palette
Fernando,I just saw your reply... What I eventually did was overriding Wicket's palette and gave access to each of the sub components. (and of course, we decided to change the whole appearance of the page so we don't need it any more :) ) 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 Thu, Jun 25, 2009 at 6:00 PM, Fernando Wermus wrote: > Eyal, > I observed that when you add some items to the selected component (in > construction time), you would need to add these same items to the choice > component to be rendered. I wanted to make an example for declaring a bug > about this, but I didn't have the time. I still need to confirm this. Maybe > it is this the problem you are having. > > On Tue, Jun 16, 2009 at 10:54 AM, Fernando Wermus < > fernando.wer...@gmail.com > > wrote: > > > Hi Eyal, > > > > First: > > if you wanna change the components, you will see that you can > override > > the new protected method for that. > > > > Second: > > There are many cases where you dont want to give public access to > your > > component because of implementation reasons. If you wanna change its > > behavior then extended and be responsable for the implementation. > > > > For instance, I saw some cases where the construction of some nested > > components (of a main component) are done at rendering time. (I think I > saw > > something like this in wizard component). > > > > > > > > > > On Sun, Jun 14, 2009 at 11:23 AM, Eyal Golan wrote: > > > >> any 1 > >> > >> ? > >> > >> 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 Fri, Jun 12, 2009 at 7:13 AM, Eyal Golan wrote: > >> > >> > BTW, > >> > we use Wicket 1.3.6 > >> > > >> > I will try to rephrase my original question: > >> > why are getChoicesComponent and getSelectionComponent() private? > >> > Can I add a Wish in Jira to make them public? > >> > > >> > > >> > 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 Thu, Jun 11, 2009 at 5:30 PM, Eyal Golan > wrote: > >> > > >> >> Hi, > >> >> I have a situation that I want to change possible choices in a > palette > >> >> according to a DropDown. > >> >> I added to the DropDown the Ajax Updating > >> >> add(new AjaxFormComponentUpdatingBehavior("onchange") {...} > >> >> I have this palette: > >> >> final CustomPalette palette = new CustomPalette("palette", new > >> >> PropertyModel(rolesCoverage, "comparedConfigurations"), > >> >> allConfigurationsModel, choiceRenderer, 10, true); > >> >> and: > >> >> final IModel allConfigurationsModel = new > >> AbstractReadOnlyModel() > >> >> { > >> >> private static final long serialVersionUID = 1L; > >> >> > >> >> @Override > >> >> public Object getObject() { > >> >> final List allConfigs = > >> >> sageDal.getConfigurations(); > >> >> > >> allConfigs.remove(rolesCoverage.getMainConfiguration()); > >> >> return allConfigs; > >> >> } > >> >> }; > >> >> The page uses CompoundPropertModel: super(id, new > >> >> CompoundPropertyModel(rolesCoverage)); in the constructor. > >> >> The problem that I encountered is that if I added to the target of > the > >> >> DropDown the palette, it kept remembering my selected values. > >> >> > >> >> In order to change that I hacked a bit with our CustomPalette: > >> >> @Override > >> >> protected Component newChoicesComponent() { > >> >> final Component result = super.newChoicesComponent(); > >> >> externalizedChoiceComponent = result; > >> >> externalizedChoiceComponent.setOutputMarkupId(true); > >> >> return result; > >> >> } > >> >> > >> >> public Component getExternalizedChoiceComponent() { > >> >> return this.externalizedChoiceComponent; > >> >> } > >> >> > >> >> And in the DropDown, instead of adding the palette, I used > >> >> target.addComponent(customPalette.getExternalizedChoiceComponent()); > >> >> > >> >> It works. > >> >> > >> >> My question is if this is the correct way? Is there a better way > doing > >> >> that? > >> >> > >> >> 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 > >> >> > >> > > >> > > >> > > > > > > > > -- > > Fernando Wermus. > > > > www.linkedin.com/in/fernandowermus > > > > > > -- > Fernando
Re: changing choices component in Palette
Eyal, I observed that when you add some items to the selected component (in construction time), you would need to add these same items to the choice component to be rendered. I wanted to make an example for declaring a bug about this, but I didn't have the time. I still need to confirm this. Maybe it is this the problem you are having. On Tue, Jun 16, 2009 at 10:54 AM, Fernando Wermus wrote: > Hi Eyal, > > First: > if you wanna change the components, you will see that you can override > the new protected method for that. > > Second: > There are many cases where you dont want to give public access to your > component because of implementation reasons. If you wanna change its > behavior then extended and be responsable for the implementation. > > For instance, I saw some cases where the construction of some nested > components (of a main component) are done at rendering time. (I think I saw > something like this in wizard component). > > > > > On Sun, Jun 14, 2009 at 11:23 AM, Eyal Golan wrote: > >> any 1 >> >> ? >> >> 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 Fri, Jun 12, 2009 at 7:13 AM, Eyal Golan wrote: >> >> > BTW, >> > we use Wicket 1.3.6 >> > >> > I will try to rephrase my original question: >> > why are getChoicesComponent and getSelectionComponent() private? >> > Can I add a Wish in Jira to make them public? >> > >> > >> > 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 Thu, Jun 11, 2009 at 5:30 PM, Eyal Golan wrote: >> > >> >> Hi, >> >> I have a situation that I want to change possible choices in a palette >> >> according to a DropDown. >> >> I added to the DropDown the Ajax Updating >> >> add(new AjaxFormComponentUpdatingBehavior("onchange") {...} >> >> I have this palette: >> >> final CustomPalette palette = new CustomPalette("palette", new >> >> PropertyModel(rolesCoverage, "comparedConfigurations"), >> >> allConfigurationsModel, choiceRenderer, 10, true); >> >> and: >> >> final IModel allConfigurationsModel = new >> AbstractReadOnlyModel() >> >> { >> >> private static final long serialVersionUID = 1L; >> >> >> >> @Override >> >> public Object getObject() { >> >> final List allConfigs = >> >> sageDal.getConfigurations(); >> >> >> allConfigs.remove(rolesCoverage.getMainConfiguration()); >> >> return allConfigs; >> >> } >> >> }; >> >> The page uses CompoundPropertModel: super(id, new >> >> CompoundPropertyModel(rolesCoverage)); in the constructor. >> >> The problem that I encountered is that if I added to the target of the >> >> DropDown the palette, it kept remembering my selected values. >> >> >> >> In order to change that I hacked a bit with our CustomPalette: >> >> @Override >> >> protected Component newChoicesComponent() { >> >> final Component result = super.newChoicesComponent(); >> >> externalizedChoiceComponent = result; >> >> externalizedChoiceComponent.setOutputMarkupId(true); >> >> return result; >> >> } >> >> >> >> public Component getExternalizedChoiceComponent() { >> >> return this.externalizedChoiceComponent; >> >> } >> >> >> >> And in the DropDown, instead of adding the palette, I used >> >> target.addComponent(customPalette.getExternalizedChoiceComponent()); >> >> >> >> It works. >> >> >> >> My question is if this is the correct way? Is there a better way doing >> >> that? >> >> >> >> 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 >> >> >> > >> > >> > > > > -- > Fernando Wermus. > > www.linkedin.com/in/fernandowermus > -- Fernando Wermus. www.linkedin.com/in/fernandowermus
Re: changing choices component in Palette
Hi Eyal, First: if you wanna change the components, you will see that you can override the new protected method for that. Second: There are many cases where you dont want to give public access to your component because of implementation reasons. If you wanna change its behavior then extended and be responsable for the implementation. For instance, I saw some cases where the construction of some nested components (of a main component) are done at rendering time. (I think I saw something like this in wizard component). On Sun, Jun 14, 2009 at 11:23 AM, Eyal Golan wrote: > any 1 > > ? > > 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 Fri, Jun 12, 2009 at 7:13 AM, Eyal Golan wrote: > > > BTW, > > we use Wicket 1.3.6 > > > > I will try to rephrase my original question: > > why are getChoicesComponent and getSelectionComponent() private? > > Can I add a Wish in Jira to make them public? > > > > > > 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 Thu, Jun 11, 2009 at 5:30 PM, Eyal Golan wrote: > > > >> Hi, > >> I have a situation that I want to change possible choices in a palette > >> according to a DropDown. > >> I added to the DropDown the Ajax Updating > >> add(new AjaxFormComponentUpdatingBehavior("onchange") {...} > >> I have this palette: > >> final CustomPalette palette = new CustomPalette("palette", new > >> PropertyModel(rolesCoverage, "comparedConfigurations"), > >> allConfigurationsModel, choiceRenderer, 10, true); > >> and: > >> final IModel allConfigurationsModel = new > AbstractReadOnlyModel() > >> { > >> private static final long serialVersionUID = 1L; > >> > >> @Override > >> public Object getObject() { > >> final List allConfigs = > >> sageDal.getConfigurations(); > >> allConfigs.remove(rolesCoverage.getMainConfiguration()); > >> return allConfigs; > >> } > >> }; > >> The page uses CompoundPropertModel: super(id, new > >> CompoundPropertyModel(rolesCoverage)); in the constructor. > >> The problem that I encountered is that if I added to the target of the > >> DropDown the palette, it kept remembering my selected values. > >> > >> In order to change that I hacked a bit with our CustomPalette: > >> @Override > >> protected Component newChoicesComponent() { > >> final Component result = super.newChoicesComponent(); > >> externalizedChoiceComponent = result; > >> externalizedChoiceComponent.setOutputMarkupId(true); > >> return result; > >> } > >> > >> public Component getExternalizedChoiceComponent() { > >> return this.externalizedChoiceComponent; > >> } > >> > >> And in the DropDown, instead of adding the palette, I used > >> target.addComponent(customPalette.getExternalizedChoiceComponent()); > >> > >> It works. > >> > >> My question is if this is the correct way? Is there a better way doing > >> that? > >> > >> 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 > >> > > > > > -- Fernando Wermus. www.linkedin.com/in/fernandowermus
Re: changing choices component in Palette
any 1 ? 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 Fri, Jun 12, 2009 at 7:13 AM, Eyal Golan wrote: > BTW, > we use Wicket 1.3.6 > > I will try to rephrase my original question: > why are getChoicesComponent and getSelectionComponent() private? > Can I add a Wish in Jira to make them public? > > > 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 Thu, Jun 11, 2009 at 5:30 PM, Eyal Golan wrote: > >> Hi, >> I have a situation that I want to change possible choices in a palette >> according to a DropDown. >> I added to the DropDown the Ajax Updating >> add(new AjaxFormComponentUpdatingBehavior("onchange") {...} >> I have this palette: >> final CustomPalette palette = new CustomPalette("palette", new >> PropertyModel(rolesCoverage, "comparedConfigurations"), >> allConfigurationsModel, choiceRenderer, 10, true); >> and: >> final IModel allConfigurationsModel = new AbstractReadOnlyModel() >> { >> private static final long serialVersionUID = 1L; >> >> @Override >> public Object getObject() { >> final List allConfigs = >> sageDal.getConfigurations(); >> allConfigs.remove(rolesCoverage.getMainConfiguration()); >> return allConfigs; >> } >> }; >> The page uses CompoundPropertModel: super(id, new >> CompoundPropertyModel(rolesCoverage)); in the constructor. >> The problem that I encountered is that if I added to the target of the >> DropDown the palette, it kept remembering my selected values. >> >> In order to change that I hacked a bit with our CustomPalette: >> @Override >> protected Component newChoicesComponent() { >> final Component result = super.newChoicesComponent(); >> externalizedChoiceComponent = result; >> externalizedChoiceComponent.setOutputMarkupId(true); >> return result; >> } >> >> public Component getExternalizedChoiceComponent() { >> return this.externalizedChoiceComponent; >> } >> >> And in the DropDown, instead of adding the palette, I used >> target.addComponent(customPalette.getExternalizedChoiceComponent()); >> >> It works. >> >> My question is if this is the correct way? Is there a better way doing >> that? >> >> 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: changing choices component in Palette
BTW, we use Wicket 1.3.6 I will try to rephrase my original question: why are getChoicesComponent and getSelectionComponent() private? Can I add a Wish in Jira to make them public? 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 Thu, Jun 11, 2009 at 5:30 PM, Eyal Golan wrote: > Hi, > I have a situation that I want to change possible choices in a palette > according to a DropDown. > I added to the DropDown the Ajax Updating > add(new AjaxFormComponentUpdatingBehavior("onchange") {...} > I have this palette: > final CustomPalette palette = new CustomPalette("palette", new > PropertyModel(rolesCoverage, "comparedConfigurations"), > allConfigurationsModel, choiceRenderer, 10, true); > and: > final IModel allConfigurationsModel = new AbstractReadOnlyModel() { > private static final long serialVersionUID = 1L; > > @Override > public Object getObject() { > final List allConfigs = > sageDal.getConfigurations(); > allConfigs.remove(rolesCoverage.getMainConfiguration()); > return allConfigs; > } > }; > The page uses CompoundPropertModel: super(id, new > CompoundPropertyModel(rolesCoverage)); in the constructor. > The problem that I encountered is that if I added to the target of the > DropDown the palette, it kept remembering my selected values. > > In order to change that I hacked a bit with our CustomPalette: > @Override > protected Component newChoicesComponent() { > final Component result = super.newChoicesComponent(); > externalizedChoiceComponent = result; > externalizedChoiceComponent.setOutputMarkupId(true); > return result; > } > > public Component getExternalizedChoiceComponent() { > return this.externalizedChoiceComponent; > } > > And in the DropDown, instead of adding the palette, I used > target.addComponent(customPalette.getExternalizedChoiceComponent()); > > It works. > > My question is if this is the correct way? Is there a better way doing > that? > > 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 >
changing choices component in Palette
Hi, I have a situation that I want to change possible choices in a palette according to a DropDown. I added to the DropDown the Ajax Updating add(new AjaxFormComponentUpdatingBehavior("onchange") {...} I have this palette: final CustomPalette palette = new CustomPalette("palette", new PropertyModel(rolesCoverage, "comparedConfigurations"), allConfigurationsModel, choiceRenderer, 10, true); and: final IModel allConfigurationsModel = new AbstractReadOnlyModel() { private static final long serialVersionUID = 1L; @Override public Object getObject() { final List allConfigs = sageDal.getConfigurations(); allConfigs.remove(rolesCoverage.getMainConfiguration()); return allConfigs; } }; The page uses CompoundPropertModel: super(id, new CompoundPropertyModel(rolesCoverage)); in the constructor. The problem that I encountered is that if I added to the target of the DropDown the palette, it kept remembering my selected values. In order to change that I hacked a bit with our CustomPalette: @Override protected Component newChoicesComponent() { final Component result = super.newChoicesComponent(); externalizedChoiceComponent = result; externalizedChoiceComponent.setOutputMarkupId(true); return result; } public Component getExternalizedChoiceComponent() { return this.externalizedChoiceComponent; } And in the DropDown, instead of adding the palette, I used target.addComponent(customPalette.getExternalizedChoiceComponent()); It works. My question is if this is the correct way? Is there a better way doing that? 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