You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Dan Simko <wi...@gmail.com> on 2012/07/24 11:14:35 UTC
Wicket 1.6 - strange behavior with Fragment, ModalWindow and resources
Hi,
I am not sure if it's a bug but in version 1.5 this code was working:
public class HomePage extends WebPage {
private static final long serialVersionUID = 1L;
public HomePage(final PageParameters parameters) {
super(parameters);
final ModalWindow window = new ModalWindow("modal");
window.setContent(new MyFragment(ModalWindow.CONTENT_ID, this));
add(window);
add(new AjaxLink("link") {
@Override
public void onClick(AjaxRequestTarget target) {
window.show(target);
}
});
}
// FIXME: If you uncomment this, resources will be added to the page and
carousel will be created,
// but only first time when you click on "show modal" link. Second time
carousel is not created.
// @Override
// public void renderHead(IHeaderResponse response) {
// response.render(JavaScriptHeaderItem.forReference(new
PackageResourceReference(MyFragment.class, "jquery.jcarousel.js")));
// response.render(CssHeaderItem.forReference(new
PackageResourceReference(MyFragment.class, "skin.css")));
// }
private static class MyFragment extends Fragment{
public MyFragment(String id, MarkupContainer container) {
super(id, "fragment", container);
}
//FIXME: resources are not added to the page head
@Override
public void renderHead(IHeaderResponse response) {
response.render(JavaScriptHeaderItem.forReference(new
PackageResourceReference(MyFragment.class, "jquery.jcarousel.js")));
response.render(CssHeaderItem.forReference(new
PackageResourceReference(MyFragment.class, "skin.css")));
}
}
}
Should I create a Jira? Quickstart is attached.
Thanks in advance!
Re: Wicket 1.6 - strange behavior with Fragment, ModalWindow and resources
Posted by Dan Simko <wi...@gmail.com>.
done, WICKET-4669
On Tue, Jul 24, 2012 at 1:38 PM, Martin Grigorov <mg...@apache.org>wrote:
> Hi,
>
> File a ticket please.
>
> On Tue, Jul 24, 2012 at 12:14 PM, Dan Simko <wi...@gmail.com> wrote:
> > Hi,
> >
> > I am not sure if it's a bug but in version 1.5 this code was working:
> >
> >
> > public class HomePage extends WebPage {
> > private static final long serialVersionUID = 1L;
> >
> >
> > public HomePage(final PageParameters parameters) {
> > super(parameters);
> >
> > final ModalWindow window = new ModalWindow("modal");
> > window.setContent(new MyFragment(ModalWindow.CONTENT_ID, this));
> > add(window);
> > add(new AjaxLink("link") {
> > @Override
> > public void onClick(AjaxRequestTarget target) {
> > window.show(target);
> > }
> > });
> >
> > }
> > // FIXME: If you uncomment this, resources will be added to the page and
> > carousel will be created,
> > // but only first time when you click on "show modal" link. Second time
> > carousel is not created.
> > // @Override
> > // public void renderHead(IHeaderResponse response) {
> > // response.render(JavaScriptHeaderItem.forReference(new
> > PackageResourceReference(MyFragment.class, "jquery.jcarousel.js")));
> > // response.render(CssHeaderItem.forReference(new
> > PackageResourceReference(MyFragment.class, "skin.css")));
> > // }
> >
> > private static class MyFragment extends Fragment{
> >
> > public MyFragment(String id, MarkupContainer container) {
> > super(id, "fragment", container);
> > }
> >
> > //FIXME: resources are not added to the page head
> > @Override
> > public void renderHead(IHeaderResponse response) {
> > response.render(JavaScriptHeaderItem.forReference(new
> > PackageResourceReference(MyFragment.class, "jquery.jcarousel.js")));
> > response.render(CssHeaderItem.forReference(new
> > PackageResourceReference(MyFragment.class, "skin.css")));
> > }
> >
> > }
> > }
> >
> >
> > Should I create a Jira? Quickstart is attached.
> >
> > Thanks in advance!
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > For additional commands, e-mail: users-help@wicket.apache.org
>
>
>
> --
> Martin Grigorov
> jWeekend
> Training, Consulting, Development
> http://jWeekend.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
Re: Wicket 1.6 - strange behavior with Fragment, ModalWindow and resources
Posted by Martin Grigorov <mg...@apache.org>.
Hi,
File a ticket please.
On Tue, Jul 24, 2012 at 12:14 PM, Dan Simko <wi...@gmail.com> wrote:
> Hi,
>
> I am not sure if it's a bug but in version 1.5 this code was working:
>
>
> public class HomePage extends WebPage {
> private static final long serialVersionUID = 1L;
>
>
> public HomePage(final PageParameters parameters) {
> super(parameters);
>
> final ModalWindow window = new ModalWindow("modal");
> window.setContent(new MyFragment(ModalWindow.CONTENT_ID, this));
> add(window);
> add(new AjaxLink("link") {
> @Override
> public void onClick(AjaxRequestTarget target) {
> window.show(target);
> }
> });
>
> }
> // FIXME: If you uncomment this, resources will be added to the page and
> carousel will be created,
> // but only first time when you click on "show modal" link. Second time
> carousel is not created.
> // @Override
> // public void renderHead(IHeaderResponse response) {
> // response.render(JavaScriptHeaderItem.forReference(new
> PackageResourceReference(MyFragment.class, "jquery.jcarousel.js")));
> // response.render(CssHeaderItem.forReference(new
> PackageResourceReference(MyFragment.class, "skin.css")));
> // }
>
> private static class MyFragment extends Fragment{
>
> public MyFragment(String id, MarkupContainer container) {
> super(id, "fragment", container);
> }
>
> //FIXME: resources are not added to the page head
> @Override
> public void renderHead(IHeaderResponse response) {
> response.render(JavaScriptHeaderItem.forReference(new
> PackageResourceReference(MyFragment.class, "jquery.jcarousel.js")));
> response.render(CssHeaderItem.forReference(new
> PackageResourceReference(MyFragment.class, "skin.css")));
> }
>
> }
> }
>
>
> Should I create a Jira? Quickstart is attached.
>
> Thanks in advance!
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
--
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org