You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by "Richter, Marvin" <Ma...@jestadigital.com> on 2014/02/07 09:00:27 UTC
Other Component than link in TabbedPanel's newLink
Hey,
I'm trying to use a Component which itself contains a Component in the TabbedPanel's newLink method.
Unfortunately that's not allowed .... Cause "... only raw markup is allowed ..."
Any ideas how can still achieve this?
Code:
final BootstrapTabbedPanel<ConfigTypeTab> configTypes = new BootstrapTabbedPanel<ConfigTypeTab>("configTypes",
tabs) {
@Override
protected WebMarkupContainer newLink(final String linkId, final int index) {
IModel<String> label = Model.of(tabs.get(index).getConfigType().getObject().getName());
SplitButton splitButton = new SplitButton(linkId, label) {
@Override
protected AbstractLink newBaseButton(String markupId, IModel<String> labelModel,
IModel<IconType> iconTypeModel) {
return new Link<Void>(markupId) {
private static final long serialVersionUID = 1L;
@Override
public void onClick() {
setSelectedTab(index);
}
};
}
@Override
protected List<AbstractLink> newSubMenuButtons(String buttonMarkupId) {
List<AbstractLink> subMenuLinks = new ArrayList<AbstractLink>();
subMenuLinks.add(new AjaxLink(buttonMarkupId) {
@Override
public void onComponentTagBody(MarkupStream markupStream,
ComponentTag openTag) {
replaceComponentTagBody(markupStream, openTag, "Edit");
}
@Override
public void onClick(AjaxRequestTarget target) {
LOG.debug(tabs.get(index).getConfigType().getObject().toString());
}
});
return subMenuLinks;
}
};
return splitButton;
}
};
Marvin Richter
Software Developer
T +49 (0) 30 69 538 1099
M +49 (0) 174 744 4991
marvin.richter@jestadigital.com<ma...@jestadigital.com>
JESTA DIGITAL GmbH Karl-Liebknecht-Str. 32 10178 Berlin, Germany
Gesellschaft mit beschränkter Haftung mit Sitz in Berlin
HRB Nr. 97990 Amtsgericht Charlottenburg
Geschäftsführer: Markus Peuler
RE: Other Component than link in TabbedPanel's newLink
Posted by "Richter, Marvin" <Ma...@jestadigital.com>.
This is not my only problem ... bootstrap itself doesn't even support what I was trying to do .... :-/
Cause this is just a small page to support some configs, this would be too much effort for now to write all this by myself.
I'll create a pull request for the BootstrapTabbedPanel improvement at the weekend.
Thanks,
Marvin
-----Original Message-----
From: Martin Grigorov [mailto:mgrigorov@apache.org]
Sent: Friday, February 07, 2014 9:39 AM
To: users@wicket.apache.org
Subject: Re: Other Component than link in TabbedPanel's newLink
Yes, it won't work so easy ...
You use new component for the "link", but then the "title" is not needed.
The easiest is to add MyTabbedPanel extends BootstrapTabbedPanel and in MyTabbedPanel.html provide whatever markup fits best for your use case.
Feel free to file an issue to wicket-bootstrap for improvement.
Martin Grigorov
Wicket Training and Consulting
On Fri, Feb 7, 2014 at 9:25 AM, Richter, Marvin < Marvin.Richter@jestadigital.com> wrote:
> Hmmm unfortunately that didn't do the job .... :( I'm quite sure that
> I just overlooked something ...
>
> Error:
> Close tag not found for tag: <a href="#" wicket:id="link">. For
> Components only raw markup is allow in between the tags but not other
> Wicket Component. Component: [SplitButtonContainer [Component id =
> link]]
> MarkupStream: [markup =
> jar:file:/home/mrichter/.m2/repository/de/agilecoders/wicket/wicket-bo
> otstrap-core/0.8.4/wicket-bootstrap-core-0.8.4.jar!/de/agilecoders/wic
> ket/core/markup/html/bootstrap/tabs/BootstrapTabbedPanel.html
> <a href="#" wicket:id="link"><span wicket:id="title">[[tab
> title]]</span></a>, index = 1, current = '<span wicket:id="title">'
> (line 0, column 0)]
>
> final BootstrapTabbedPanel<ConfigTypeTab> configTypes = new
> BootstrapTabbedPanel<ConfigTypeTab>("configTypes",
> tabs) {
>
> @Override
> protected WebMarkupContainer newLink(final String
> linkId, final int index) {
> return new SplitButtonContainer(linkId,
> tabs.get(index).getConfigType().getObject().getName()) {
>
> @Override
> protected void onBaseButtonClick() {
> setSelectedTab(index);
> }
>
> @Override
> protected List<AbstractLink>
> onNewSubMenuButtons(String buttonMarkupId) {
> List<AbstractLink> subMenuLinks = new
> ArrayList<AbstractLink>();
> subMenuLinks.add(new
> AjaxLink(buttonMarkupId) {
>
> @Override
> public void
> onComponentTagBody(MarkupStream markupStream,
> ComponentTag openTag)
> {
>
> replaceComponentTagBody(markupStream, openTag, "Edit");
> }
>
> @Override
> public void
> onClick(AjaxRequestTarget target) {
>
> LOG.debug(tabs.get(index).getConfigType().getObject().toString());
> }
> });
> return subMenuLinks;
> }
> };
> }
> };
>
>
> private abstract static class SplitButtonContainer extends Panel {
>
> public SplitButtonContainer(final String id, final String title) {
> super(id);
> IModel<String> label = Model.of(title);
> SplitButton splitButton = new SplitButton("splitButton",
> label) {
>
> @Override
> protected AbstractLink newBaseButton(String
> markupId, IModel<String> labelModel,
> IModel<IconType> iconTypeModel) {
> return new Link<Void>(markupId) {
>
> private static final long
> serialVersionUID = 1L;
>
> @Override
> public void onClick() {
> onBaseButtonClick();
> }
> };
> }
>
> @Override
> protected List<AbstractLink>
> newSubMenuButtons(String
> buttonMarkupId) {
> return onNewSubMenuButtons(buttonMarkupId);
> }
> };
> }
>
> protected abstract void onBaseButtonClick();
> protected abstract List<AbstractLink>
> onNewSubMenuButtons(String buttonMarkupId);
> }
>
> Thanks in advance,
> Marvin
>
>
> -----Original Message-----
> From: Richter, Marvin [mailto:Marvin.Richter@jestadigital.com]
> Sent: Friday, February 07, 2014 9:07 AM
> To: users@wicket.apache.org
> Subject: RE: Other Component than link in TabbedPanel's newLink
>
> OMFG ... that was too easy ... I missed the forest for the trees
>
> Thanks
>
> Marvin Richter
> Software Developer
> T +49 (0) 30 69 538 1099
> M +49 (0) 174 744 4991
> marvin.richter@jestadigital.com
>
> JESTA DIGITAL GmbH Karl-Liebknecht-Str. 32 10178 Berlin, Germany
> Gesellschaft mit beschränkter Haftung mit Sitz in Berlin HRB Nr. 97990
> Amtsgericht Charlottenburg
> Geschäftsführer: Markus Peuler
>
>
> -----Original Message-----
> From: Martin Grigorov [mailto:mgrigorov@apache.org]
> Sent: Friday, February 07, 2014 9:04 AM
> To: users@wicket.apache.org
> Subject: Re: Other Component than link in TabbedPanel's newLink
>
> You a component that has its own markup, i.e. a Panel with SplitButton
> inside.
>
> Martin Grigorov
> Wicket Training and Consulting
>
>
> On Fri, Feb 7, 2014 at 9:00 AM, Richter, Marvin <
> Marvin.Richter@jestadigital.com> wrote:
>
> > Hey,
> >
> > I'm trying to use a Component which itself contains a Component in
> > the TabbedPanel's newLink method.
> > Unfortunately that's not allowed .... Cause "... only raw markup is
> > allowed ..."
> >
> > Any ideas how can still achieve this?
> >
> > Code:
> >
> > final BootstrapTabbedPanel<ConfigTypeTab> configTypes = new
> > BootstrapTabbedPanel<ConfigTypeTab>("configTypes",
> > tabs) {
> >
> > @Override
> > protected WebMarkupContainer newLink(final String
> > linkId, final int index) {
> > IModel<String> label =
> > Model.of(tabs.get(index).getConfigType().getObject().getName());
> > SplitButton splitButton = new
> > SplitButton(linkId,
> > label) {
> >
> > @Override
> > protected AbstractLink
> > newBaseButton(String markupId, IModel<String> labelModel,
> > IModel<IconType> iconTypeModel) {
> > return new Link<Void>(markupId) {
> >
> > private static final long
> > serialVersionUID = 1L;
> >
> > @Override
> > public void onClick() {
> > setSelectedTab(index);
> > }
> > };
> > }
> >
> > @Override
> > protected List<AbstractLink>
> > newSubMenuButtons(String buttonMarkupId) {
> > List<AbstractLink> subMenuLinks =
> > new ArrayList<AbstractLink>();
> > subMenuLinks.add(new
> > AjaxLink(buttonMarkupId) {
> >
> > @Override
> > public void
> > onComponentTagBody(MarkupStream markupStream,
> > ComponentTag
> > openTag) {
> >
> > replaceComponentTagBody(markupStream, openTag, "Edit");
> > }
> >
> > @Override
> > public void
> > onClick(AjaxRequestTarget target) {
> >
> > LOG.debug(tabs.get(index).getConfigType().getObject().toString());
> > }
> > });
> > return subMenuLinks;
> > }
> > };
> > return splitButton;
> > }
> > };
> >
> > Marvin Richter
> > Software Developer
> > T +49 (0) 30 69 538 1099
> > M +49 (0) 174 744 4991
> > marvin.richter@jestadigital.com<mailto:marvin.richter@jestadigital.c
> > om
> > >
> >
> > JESTA DIGITAL GmbH Karl-Liebknecht-Str. 32 10178 Berlin, Germany
> > Gesellschaft mit beschränkter Haftung mit Sitz in Berlin HRB Nr.
> > 97990 Amtsgericht Charlottenburg
> > Geschäftsführer: Markus Peuler
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Other Component than link in TabbedPanel's newLink
Posted by Martin Grigorov <mg...@apache.org>.
Yes, it won't work so easy ...
You use new component for the "link", but then the "title" is not needed.
The easiest is to add MyTabbedPanel extends BootstrapTabbedPanel and in
MyTabbedPanel.html provide whatever markup fits best for your use case.
Feel free to file an issue to wicket-bootstrap for improvement.
Martin Grigorov
Wicket Training and Consulting
On Fri, Feb 7, 2014 at 9:25 AM, Richter, Marvin <
Marvin.Richter@jestadigital.com> wrote:
> Hmmm unfortunately that didn't do the job .... :(
> I'm quite sure that I just overlooked something ...
>
> Error:
> Close tag not found for tag: <a href="#" wicket:id="link">. For
> Components only raw markup is allow in between the tags but not other
> Wicket Component. Component: [SplitButtonContainer [Component id = link]]
> MarkupStream: [markup =
> jar:file:/home/mrichter/.m2/repository/de/agilecoders/wicket/wicket-bootstrap-core/0.8.4/wicket-bootstrap-core-0.8.4.jar!/de/agilecoders/wicket/core/markup/html/bootstrap/tabs/BootstrapTabbedPanel.html
> <a href="#" wicket:id="link"><span wicket:id="title">[[tab
> title]]</span></a>, index = 1, current = '<span wicket:id="title">' (line
> 0, column 0)]
>
> final BootstrapTabbedPanel<ConfigTypeTab> configTypes = new
> BootstrapTabbedPanel<ConfigTypeTab>("configTypes",
> tabs) {
>
> @Override
> protected WebMarkupContainer newLink(final String linkId,
> final int index) {
> return new SplitButtonContainer(linkId,
> tabs.get(index).getConfigType().getObject().getName()) {
>
> @Override
> protected void onBaseButtonClick() {
> setSelectedTab(index);
> }
>
> @Override
> protected List<AbstractLink>
> onNewSubMenuButtons(String buttonMarkupId) {
> List<AbstractLink> subMenuLinks = new
> ArrayList<AbstractLink>();
> subMenuLinks.add(new
> AjaxLink(buttonMarkupId) {
>
> @Override
> public void
> onComponentTagBody(MarkupStream markupStream,
> ComponentTag openTag) {
>
> replaceComponentTagBody(markupStream, openTag, "Edit");
> }
>
> @Override
> public void
> onClick(AjaxRequestTarget target) {
>
> LOG.debug(tabs.get(index).getConfigType().getObject().toString());
> }
> });
> return subMenuLinks;
> }
> };
> }
> };
>
>
> private abstract static class SplitButtonContainer extends Panel {
>
> public SplitButtonContainer(final String id, final String title) {
> super(id);
> IModel<String> label = Model.of(title);
> SplitButton splitButton = new SplitButton("splitButton",
> label) {
>
> @Override
> protected AbstractLink newBaseButton(String markupId,
> IModel<String> labelModel,
> IModel<IconType> iconTypeModel) {
> return new Link<Void>(markupId) {
>
> private static final long serialVersionUID
> = 1L;
>
> @Override
> public void onClick() {
> onBaseButtonClick();
> }
> };
> }
>
> @Override
> protected List<AbstractLink> newSubMenuButtons(String
> buttonMarkupId) {
> return onNewSubMenuButtons(buttonMarkupId);
> }
> };
> }
>
> protected abstract void onBaseButtonClick();
> protected abstract List<AbstractLink> onNewSubMenuButtons(String
> buttonMarkupId);
> }
>
> Thanks in advance,
> Marvin
>
>
> -----Original Message-----
> From: Richter, Marvin [mailto:Marvin.Richter@jestadigital.com]
> Sent: Friday, February 07, 2014 9:07 AM
> To: users@wicket.apache.org
> Subject: RE: Other Component than link in TabbedPanel's newLink
>
> OMFG ... that was too easy ... I missed the forest for the trees
>
> Thanks
>
> Marvin Richter
> Software Developer
> T +49 (0) 30 69 538 1099
> M +49 (0) 174 744 4991
> marvin.richter@jestadigital.com
>
> JESTA DIGITAL GmbH Karl-Liebknecht-Str. 32 10178 Berlin, Germany
> Gesellschaft mit beschränkter Haftung mit Sitz in Berlin HRB Nr. 97990
> Amtsgericht Charlottenburg
> Geschäftsführer: Markus Peuler
>
>
> -----Original Message-----
> From: Martin Grigorov [mailto:mgrigorov@apache.org]
> Sent: Friday, February 07, 2014 9:04 AM
> To: users@wicket.apache.org
> Subject: Re: Other Component than link in TabbedPanel's newLink
>
> You a component that has its own markup, i.e. a Panel with SplitButton
> inside.
>
> Martin Grigorov
> Wicket Training and Consulting
>
>
> On Fri, Feb 7, 2014 at 9:00 AM, Richter, Marvin <
> Marvin.Richter@jestadigital.com> wrote:
>
> > Hey,
> >
> > I'm trying to use a Component which itself contains a Component in the
> > TabbedPanel's newLink method.
> > Unfortunately that's not allowed .... Cause "... only raw markup is
> > allowed ..."
> >
> > Any ideas how can still achieve this?
> >
> > Code:
> >
> > final BootstrapTabbedPanel<ConfigTypeTab> configTypes = new
> > BootstrapTabbedPanel<ConfigTypeTab>("configTypes",
> > tabs) {
> >
> > @Override
> > protected WebMarkupContainer newLink(final String
> > linkId, final int index) {
> > IModel<String> label =
> > Model.of(tabs.get(index).getConfigType().getObject().getName());
> > SplitButton splitButton = new SplitButton(linkId,
> > label) {
> >
> > @Override
> > protected AbstractLink
> > newBaseButton(String markupId, IModel<String> labelModel,
> > IModel<IconType> iconTypeModel) {
> > return new Link<Void>(markupId) {
> >
> > private static final long
> > serialVersionUID = 1L;
> >
> > @Override
> > public void onClick() {
> > setSelectedTab(index);
> > }
> > };
> > }
> >
> > @Override
> > protected List<AbstractLink>
> > newSubMenuButtons(String buttonMarkupId) {
> > List<AbstractLink> subMenuLinks = new
> > ArrayList<AbstractLink>();
> > subMenuLinks.add(new
> > AjaxLink(buttonMarkupId) {
> >
> > @Override
> > public void
> > onComponentTagBody(MarkupStream markupStream,
> > ComponentTag openTag)
> > {
> >
> > replaceComponentTagBody(markupStream, openTag, "Edit");
> > }
> >
> > @Override
> > public void
> > onClick(AjaxRequestTarget target) {
> >
> > LOG.debug(tabs.get(index).getConfigType().getObject().toString());
> > }
> > });
> > return subMenuLinks;
> > }
> > };
> > return splitButton;
> > }
> > };
> >
> > Marvin Richter
> > Software Developer
> > T +49 (0) 30 69 538 1099
> > M +49 (0) 174 744 4991
> > marvin.richter@jestadigital.com<mailto:marvin.richter@jestadigital.com
> > >
> >
> > JESTA DIGITAL GmbH Karl-Liebknecht-Str. 32 10178 Berlin, Germany
> > Gesellschaft mit beschränkter Haftung mit Sitz in Berlin HRB Nr. 97990
> > Amtsgericht Charlottenburg
> > Geschäftsführer: Markus Peuler
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
RE: Other Component than link in TabbedPanel's newLink
Posted by "Richter, Marvin" <Ma...@jestadigital.com>.
Hmmm unfortunately that didn't do the job .... :(
I'm quite sure that I just overlooked something ...
Error:
Close tag not found for tag: <a href="#" wicket:id="link">. For Components only raw markup is allow in between the tags but not other Wicket Component. Component: [SplitButtonContainer [Component id = link]]
MarkupStream: [markup = jar:file:/home/mrichter/.m2/repository/de/agilecoders/wicket/wicket-bootstrap-core/0.8.4/wicket-bootstrap-core-0.8.4.jar!/de/agilecoders/wicket/core/markup/html/bootstrap/tabs/BootstrapTabbedPanel.html
<a href="#" wicket:id="link"><span wicket:id="title">[[tab title]]</span></a>, index = 1, current = '<span wicket:id="title">' (line 0, column 0)]
final BootstrapTabbedPanel<ConfigTypeTab> configTypes = new BootstrapTabbedPanel<ConfigTypeTab>("configTypes",
tabs) {
@Override
protected WebMarkupContainer newLink(final String linkId, final int index) {
return new SplitButtonContainer(linkId, tabs.get(index).getConfigType().getObject().getName()) {
@Override
protected void onBaseButtonClick() {
setSelectedTab(index);
}
@Override
protected List<AbstractLink> onNewSubMenuButtons(String buttonMarkupId) {
List<AbstractLink> subMenuLinks = new ArrayList<AbstractLink>();
subMenuLinks.add(new AjaxLink(buttonMarkupId) {
@Override
public void onComponentTagBody(MarkupStream markupStream,
ComponentTag openTag) {
replaceComponentTagBody(markupStream, openTag, "Edit");
}
@Override
public void onClick(AjaxRequestTarget target) {
LOG.debug(tabs.get(index).getConfigType().getObject().toString());
}
});
return subMenuLinks;
}
};
}
};
private abstract static class SplitButtonContainer extends Panel {
public SplitButtonContainer(final String id, final String title) {
super(id);
IModel<String> label = Model.of(title);
SplitButton splitButton = new SplitButton("splitButton", label) {
@Override
protected AbstractLink newBaseButton(String markupId, IModel<String> labelModel,
IModel<IconType> iconTypeModel) {
return new Link<Void>(markupId) {
private static final long serialVersionUID = 1L;
@Override
public void onClick() {
onBaseButtonClick();
}
};
}
@Override
protected List<AbstractLink> newSubMenuButtons(String buttonMarkupId) {
return onNewSubMenuButtons(buttonMarkupId);
}
};
}
protected abstract void onBaseButtonClick();
protected abstract List<AbstractLink> onNewSubMenuButtons(String buttonMarkupId);
}
Thanks in advance,
Marvin
-----Original Message-----
From: Richter, Marvin [mailto:Marvin.Richter@jestadigital.com]
Sent: Friday, February 07, 2014 9:07 AM
To: users@wicket.apache.org
Subject: RE: Other Component than link in TabbedPanel's newLink
OMFG ... that was too easy ... I missed the forest for the trees
Thanks
Marvin Richter
Software Developer
T +49 (0) 30 69 538 1099
M +49 (0) 174 744 4991
marvin.richter@jestadigital.com
JESTA DIGITAL GmbH Karl-Liebknecht-Str. 32 10178 Berlin, Germany Gesellschaft mit beschränkter Haftung mit Sitz in Berlin HRB Nr. 97990 Amtsgericht Charlottenburg
Geschäftsführer: Markus Peuler
-----Original Message-----
From: Martin Grigorov [mailto:mgrigorov@apache.org]
Sent: Friday, February 07, 2014 9:04 AM
To: users@wicket.apache.org
Subject: Re: Other Component than link in TabbedPanel's newLink
You a component that has its own markup, i.e. a Panel with SplitButton inside.
Martin Grigorov
Wicket Training and Consulting
On Fri, Feb 7, 2014 at 9:00 AM, Richter, Marvin < Marvin.Richter@jestadigital.com> wrote:
> Hey,
>
> I'm trying to use a Component which itself contains a Component in the
> TabbedPanel's newLink method.
> Unfortunately that's not allowed .... Cause "... only raw markup is
> allowed ..."
>
> Any ideas how can still achieve this?
>
> Code:
>
> final BootstrapTabbedPanel<ConfigTypeTab> configTypes = new
> BootstrapTabbedPanel<ConfigTypeTab>("configTypes",
> tabs) {
>
> @Override
> protected WebMarkupContainer newLink(final String
> linkId, final int index) {
> IModel<String> label =
> Model.of(tabs.get(index).getConfigType().getObject().getName());
> SplitButton splitButton = new SplitButton(linkId,
> label) {
>
> @Override
> protected AbstractLink
> newBaseButton(String markupId, IModel<String> labelModel,
> IModel<IconType> iconTypeModel) {
> return new Link<Void>(markupId) {
>
> private static final long
> serialVersionUID = 1L;
>
> @Override
> public void onClick() {
> setSelectedTab(index);
> }
> };
> }
>
> @Override
> protected List<AbstractLink>
> newSubMenuButtons(String buttonMarkupId) {
> List<AbstractLink> subMenuLinks = new
> ArrayList<AbstractLink>();
> subMenuLinks.add(new
> AjaxLink(buttonMarkupId) {
>
> @Override
> public void
> onComponentTagBody(MarkupStream markupStream,
> ComponentTag openTag)
> {
>
> replaceComponentTagBody(markupStream, openTag, "Edit");
> }
>
> @Override
> public void
> onClick(AjaxRequestTarget target) {
>
> LOG.debug(tabs.get(index).getConfigType().getObject().toString());
> }
> });
> return subMenuLinks;
> }
> };
> return splitButton;
> }
> };
>
> Marvin Richter
> Software Developer
> T +49 (0) 30 69 538 1099
> M +49 (0) 174 744 4991
> marvin.richter@jestadigital.com<mailto:marvin.richter@jestadigital.com
> >
>
> JESTA DIGITAL GmbH Karl-Liebknecht-Str. 32 10178 Berlin, Germany
> Gesellschaft mit beschränkter Haftung mit Sitz in Berlin HRB Nr. 97990
> Amtsgericht Charlottenburg
> Geschäftsführer: Markus Peuler
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
RE: Other Component than link in TabbedPanel's newLink
Posted by "Richter, Marvin" <Ma...@jestadigital.com>.
OMFG ... that was too easy ... I missed the forest for the trees
Thanks
Marvin Richter
Software Developer
T +49 (0) 30 69 538 1099
M +49 (0) 174 744 4991
marvin.richter@jestadigital.com
JESTA DIGITAL GmbH Karl-Liebknecht-Str. 32 10178 Berlin, Germany
Gesellschaft mit beschränkter Haftung mit Sitz in Berlin
HRB Nr. 97990 Amtsgericht Charlottenburg
Geschäftsführer: Markus Peuler
-----Original Message-----
From: Martin Grigorov [mailto:mgrigorov@apache.org]
Sent: Friday, February 07, 2014 9:04 AM
To: users@wicket.apache.org
Subject: Re: Other Component than link in TabbedPanel's newLink
You a component that has its own markup, i.e. a Panel with SplitButton inside.
Martin Grigorov
Wicket Training and Consulting
On Fri, Feb 7, 2014 at 9:00 AM, Richter, Marvin < Marvin.Richter@jestadigital.com> wrote:
> Hey,
>
> I'm trying to use a Component which itself contains a Component in the
> TabbedPanel's newLink method.
> Unfortunately that's not allowed .... Cause "... only raw markup is
> allowed ..."
>
> Any ideas how can still achieve this?
>
> Code:
>
> final BootstrapTabbedPanel<ConfigTypeTab> configTypes = new
> BootstrapTabbedPanel<ConfigTypeTab>("configTypes",
> tabs) {
>
> @Override
> protected WebMarkupContainer newLink(final String
> linkId, final int index) {
> IModel<String> label =
> Model.of(tabs.get(index).getConfigType().getObject().getName());
> SplitButton splitButton = new SplitButton(linkId,
> label) {
>
> @Override
> protected AbstractLink
> newBaseButton(String markupId, IModel<String> labelModel,
> IModel<IconType> iconTypeModel) {
> return new Link<Void>(markupId) {
>
> private static final long
> serialVersionUID = 1L;
>
> @Override
> public void onClick() {
> setSelectedTab(index);
> }
> };
> }
>
> @Override
> protected List<AbstractLink>
> newSubMenuButtons(String buttonMarkupId) {
> List<AbstractLink> subMenuLinks = new
> ArrayList<AbstractLink>();
> subMenuLinks.add(new
> AjaxLink(buttonMarkupId) {
>
> @Override
> public void
> onComponentTagBody(MarkupStream markupStream,
> ComponentTag openTag)
> {
>
> replaceComponentTagBody(markupStream, openTag, "Edit");
> }
>
> @Override
> public void
> onClick(AjaxRequestTarget target) {
>
> LOG.debug(tabs.get(index).getConfigType().getObject().toString());
> }
> });
> return subMenuLinks;
> }
> };
> return splitButton;
> }
> };
>
> Marvin Richter
> Software Developer
> T +49 (0) 30 69 538 1099
> M +49 (0) 174 744 4991
> marvin.richter@jestadigital.com<mailto:marvin.richter@jestadigital.com
> >
>
> JESTA DIGITAL GmbH Karl-Liebknecht-Str. 32 10178 Berlin, Germany
> Gesellschaft mit beschränkter Haftung mit Sitz in Berlin HRB Nr. 97990
> Amtsgericht Charlottenburg
> Geschäftsführer: Markus Peuler
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Other Component than link in TabbedPanel's newLink
Posted by Martin Grigorov <mg...@apache.org>.
You a component that has its own markup, i.e. a Panel with SplitButton
inside.
Martin Grigorov
Wicket Training and Consulting
On Fri, Feb 7, 2014 at 9:00 AM, Richter, Marvin <
Marvin.Richter@jestadigital.com> wrote:
> Hey,
>
> I'm trying to use a Component which itself contains a Component in the
> TabbedPanel's newLink method.
> Unfortunately that's not allowed .... Cause "... only raw markup is
> allowed ..."
>
> Any ideas how can still achieve this?
>
> Code:
>
> final BootstrapTabbedPanel<ConfigTypeTab> configTypes = new
> BootstrapTabbedPanel<ConfigTypeTab>("configTypes",
> tabs) {
>
> @Override
> protected WebMarkupContainer newLink(final String linkId,
> final int index) {
> IModel<String> label =
> Model.of(tabs.get(index).getConfigType().getObject().getName());
> SplitButton splitButton = new SplitButton(linkId,
> label) {
>
> @Override
> protected AbstractLink newBaseButton(String
> markupId, IModel<String> labelModel,
> IModel<IconType> iconTypeModel) {
> return new Link<Void>(markupId) {
>
> private static final long
> serialVersionUID = 1L;
>
> @Override
> public void onClick() {
> setSelectedTab(index);
> }
> };
> }
>
> @Override
> protected List<AbstractLink>
> newSubMenuButtons(String buttonMarkupId) {
> List<AbstractLink> subMenuLinks = new
> ArrayList<AbstractLink>();
> subMenuLinks.add(new
> AjaxLink(buttonMarkupId) {
>
> @Override
> public void
> onComponentTagBody(MarkupStream markupStream,
> ComponentTag openTag) {
>
> replaceComponentTagBody(markupStream, openTag, "Edit");
> }
>
> @Override
> public void
> onClick(AjaxRequestTarget target) {
>
> LOG.debug(tabs.get(index).getConfigType().getObject().toString());
> }
> });
> return subMenuLinks;
> }
> };
> return splitButton;
> }
> };
>
> Marvin Richter
> Software Developer
> T +49 (0) 30 69 538 1099
> M +49 (0) 174 744 4991
> marvin.richter@jestadigital.com<ma...@jestadigital.com>
>
> JESTA DIGITAL GmbH Karl-Liebknecht-Str. 32 10178 Berlin, Germany
> Gesellschaft mit beschränkter Haftung mit Sitz in Berlin
> HRB Nr. 97990 Amtsgericht Charlottenburg
> Geschäftsführer: Markus Peuler
>
>