Hi Eyal,
First:
if you wanna change the components, you will see that you can override
the newXXXX 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 <[email protected]> wrote:
> any 1
>
> ?
>
> Eyal Golan
> [email protected]
>
> 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 <[email protected]> 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
> > [email protected]
> >
> > 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 <[email protected]> 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<Configuration> 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
> >> [email protected]
> >>
> >> 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