You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by anton <an...@hotmail.com> on 2013/02/15 11:00:55 UTC
Re: Problem Modal Windows in datatable
error when clicked in the link
- No Page found for component [MarkupContainer [Component id = modal2]]
java.lang.IllegalStateException: No Page found for component
[MarkupContainer [Component id = modal2]]
at org.apache.wicket.Component.getPage(Component.java:1823)
at org.apache.wicket.RequestCycle.urlFor(RequestCycle.java:872)
at org.apache.wicket.Component.urlFor(Component.java:3392)
---------------------------------------------------------------------------------------------------
AjaxLinkPanel.java
public abstract class AjaxLinkPanel extends Panel {
public AjaxLinkPanel(String id) {
super(id);
AjaxLink link = new AjaxLink("ajaxLink") {
@Override
public void onClick(AjaxRequestTarget target) {
onClicked(target);
}
};
add(link);
}
protected abstract void onClicked(AjaxRequestTarget target);
}
----------------------------------------------------------------------------------------------------------------------
final ModalWindow modal2=new ModalWindow("modal2");
columns.add(new AbstractColumn<Alum>(new Model<String>("Actions"))
{
public void populateItem(Item<ICellPopulator<Alum>>
cellItem, String componentId,
IModel<Alum> model)
{
cellItem.add(new AjaxLinkPanel(componentId) {
@Override
protected void onClicked(AjaxRequestTarget target) {
// TODO Auto-generated method stub
modal2.show(target);
}
});
}
});
----------------------------------------------------------------------------------------------------------------------------------------------------
--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Problem-Modal-Windows-in-datatable-tp4655907p4656389.html
Sent from the Users forum mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Problem Modal Windows in datatable
Posted by Ernesto Reinaldo Barreiro <re...@gmail.com>.
Hi,
I think you should read what Martin advised your to read
Please read http://www.catb.org/esr/faqs/smart-questions.html
Anyway,
1-You have to add modal window to the page (or panel).
<form wicket:id="form">
<div wicket:id="modal"></div>
</form>
on Java code.
Form<Void> form = new From<Void>("form");
add(form);
modal =new ModalWindow("modal");
form.add(modal);
Also on
cellItem.add(new AjaxLinkPanel(componentId) {
@Override
protected void
onClicked(AjaxRequestTarget target) {
// TODO
Auto-generated method stub
modal.show(target);
}
});
you have to do
modal.setContent(new MyPanel(modal.getContentId());
before modal.show(target);
On Fri, Feb 15, 2013 at 11:00 AM, anton <an...@hotmail.com>wrote:
>
> error when clicked in the link
>
> - No Page found for component [MarkupContainer [Component id = modal2]]
> java.lang.IllegalStateException: No Page found for component
> [MarkupContainer [Component id = modal2]]
> at org.apache.wicket.Component.getPage(Component.java:1823)
> at org.apache.wicket.RequestCycle.urlFor(RequestCycle.java:872)
> at org.apache.wicket.Component.urlFor(Component.java:3392)
>
>
>
>
> ---------------------------------------------------------------------------------------------------
> AjaxLinkPanel.java
>
> public abstract class AjaxLinkPanel extends Panel {
> public AjaxLinkPanel(String id) {
> super(id);
> AjaxLink link = new AjaxLink("ajaxLink") {
> @Override
> public void onClick(AjaxRequestTarget target) {
> onClicked(target);
> }
> };
> add(link);
>
> }
>
> protected abstract void onClicked(AjaxRequestTarget target);
>
> }
>
>
>
> ----------------------------------------------------------------------------------------------------------------------
>
> final ModalWindow modal2=new ModalWindow("modal2");
>
> columns.add(new AbstractColumn<Alum>(new Model<String>("Actions"))
> {
> public void populateItem(Item<ICellPopulator<Alum>>
> cellItem, String componentId,
> IModel<Alum> model)
> {
>
> cellItem.add(new AjaxLinkPanel(componentId) {
>
> @Override
> protected void
> onClicked(AjaxRequestTarget target) {
> // TODO
> Auto-generated method stub
>
> modal2.show(target);
> }
> });
> }
> });
>
>
> ----------------------------------------------------------------------------------------------------------------------------------------------------
>
>
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Problem-Modal-Windows-in-datatable-tp4655907p4656389.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
--
Regards - Ernesto Reinaldo Barreiro
Antilia Soft
http://antiliasoft.com/ <http://antiliasoft.com/antilia>