Re: Beginner problems with TabbedPanel

2011-04-25 Thread meduolis
Just tried Igor's solution with JavaScript disabled using AjaxFallbackButton

Exception appears:

java.lang.IllegalStateException: No Page found for component
[MarkupContainer [Component id = xlsUploadForm]]

Components tree:

Page
  TabbedPanel
Panel
  Form
Button

Any ideas how to make it fallback correct?

With js everything works just perfect

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Beginner-problems-with-TabbedPanel-tp1887205p3473115.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Beginner problems with TabbedPanel

2009-07-30 Thread Igor Vaynberg
completely untrue. see my sample that works with a regular tabbed panel.

-igor

On Thu, Jul 30, 2009 at 3:06 AM, Gajo Csaba wrote:
> Hi Iain,
>
> I solved the problem thanks to martin-g from ##wicket. Seems like the
> problem was I was using a non-ajax tabbed panel with an ajax button. When I
> switched to an ajax panel, it worked great.
> I've also tried using a non-ajax tabbed panel with a non-ajax button like
> you suggested, and it also seems to work.
>
> Looks like the only problem here is that you shouldn't mix ajax components
> with non-ajax ones.
>
> Regards,
> Csaba
>
>
> Iain Reddick wrote:
>>
>> Surely this is what you want for a non-ajax solution:
>>
>> class MyPage extends Page {
>>  private TabbedPanel tabPanel;
>>  ...
>>  public MyPage() {
>>   tabPanel = new TabPanel(...);
>>   add( tabPanel );
>>   ...
>>   confirmBtn = new Button("confirm") {
>>     private static final long serialVersionUID = 1L;
>>
>>     @Override
>>     public void onSubmit() {
>>       tabPanel.setSelectedTab(0);
>>     }
>>   };
>>   add( confirmBtn );
>>  }
>> }
>>
>> And for an ajax solution, just add tabPanel to the ajax request in the
>> submit handler?
>>
>> Sorry if this isn't right, but I don't see what the issue is.
>>
>> Gajo Csaba wrote:
>>>
>>> That may be true Igor, but there doesn't seem to be any other solution to
>>> make this work:
>>>
>>> confirmBtn = new Button("confirm") {
>>>   private static final long serialVersionUID = 1L;
>>>   @Override
>>>   public void onSubmit() {
>>>       Page page = getPage();
>>>       TabbedPanel tabPanel = ((HomePage)getWebPage()).getTabbedPanel();
>>>                    tabPanel.setSelectedTab(0);
>>>       setResponsePage(page);
>>>   }
>>> };
>>>
>>> I cannot repaint the tabPanel (either with render() or
>>> renderComponent()), cannot repaint the whole page, cannot go with Linda's
>>> suggestion because even after Martin's fix it still generates an error. I
>>> just want to set the tabbedpanel's selected tab to be #0. It's not that
>>> complicated. In Swing, I would write: tabPanel.setSelectedTab(0); and that
>>> would be it.
>>>
>>> Now I'm not very critical about how software systems are constructed, and
>>> don't care if some features may cause minor side-effects, or cause the
>>> programmer to write a bit hacky code. But having the setSelectedTab() method
>>> detach the page for no apparent reason and without any warning is as bad as
>>> having a goto command in a programming language. "Side effects" are one of
>>> the first thing that you learn in college, and why you should avoid them at
>>> all cost. The documentation for the setSelectedTab() says "sets the selected
>>> tab". What it's missing is a big warning sign "WARNING IT DETACHES THE
>>> PAGE WILL CAUSE UNRELATED ERROR MESSAGES!!!"
>>>
>>> So what is your suggestion Igor? How should I use the framework properly?
>>>
>>> Regards,
>>> Csaba
>>>
>>>
>>> Igor Vaynberg wrote:

 of course there is no reason to use an ajax link if all you are going
 to do is repaint the entire page anyways...

 also code like this: setresponsepage(getpage()) is always suspect. by
 default wicket repaints the same page so there is no need to call
 this. when inside ajax you should add components you want repainted to
 the request target that is passed in to you.

 setresponsepage should only be used when actually going to a different
 page. you are not using the framework properly...

 -igor

 2009/7/29 Martin Makundi :

>
> 1.
>
> You can fix linda's suggestion by calling setOutputMarkupId(true) on
> your tabbedpanel.
>
> 2. The reason for:
>
> 10:42:27 ERROR [RequestCycle] - No Page found for component
> [MarkupContainer [Component id = panel]]
> java.lang.IllegalStateException: No Page found for component
> [MarkupContainer [Component id = panel]]
>     at org.apache.wicket.Component.getPage(Component.java:1729)
>
> Is that you just called setSelectedTab() which DISCONNECTS the current
> tab from the page hierarcy. Try getting the page before that:
> onClick() {
>  Page page = getPage();
>  tabbedPanel.setSelectedTab(0);
>  setREsponsePage(page);
> }
>
>
> **
> Martin
>
>
> **
> Martin
>
> 2009/7/29 Gajo Csaba :
>
>>
>> Hmm there's something very wrong here...
>>
>> I try to refresh the page like this:
>> setResponsePage(getPage());
>>
>> When this is the only action, the current page is refreshed. When I
>> write
>> setSelectedTab(0) above it, I get an error.
>>
>> 10:42:27 ERROR [RequestCycle] - No Page found for component
>> [MarkupContainer
>> [Component id = panel]]
>> java.lang.IllegalStateException: No Page found for component
>> [MarkupContainer [Component id = panel]]
>>      at org.apache.wicket.Component.getPage(Component.java:1729)
>>      at
>>

Re: Beginner problems with TabbedPanel

2009-07-30 Thread Igor Vaynberg
TabbedPanel tb=new TabbedPanel("tb");
tb.setOutputMarkupId(true);



on panel 2...

add(new AjaxFallbackLink("switch"){
public void onClick(AjaxRequestTarget target) {
TabbedPanel tb = findParent(TabbedPanel.class);
tb.setSelectedTab(0);
if (target != null){target.addComponent(tb);}
}
});

this is how the framework is meant to be used. the following works
with ajax when js is enabled and a regular refresh when js is
disabled.

clean and simple.

-igor

On Thu, Jul 30, 2009 at 1:35 AM, Gajo Csaba wrote:
> That may be true Igor, but there doesn't seem to be any other solution to
> make this work:
>
> confirmBtn = new Button("confirm") {
>   private static final long serialVersionUID = 1L;
>   @Override
>   public void onSubmit() {
>       Page page = getPage();
>       TabbedPanel tabPanel = ((HomePage)getWebPage()).getTabbedPanel();
>                 tabPanel.setSelectedTab(0);
>       setResponsePage(page);
>   }
> };
>
> I cannot repaint the tabPanel (either with render() or renderComponent()),
> cannot repaint the whole page, cannot go with Linda's suggestion because
> even after Martin's fix it still generates an error. I just want to set the
> tabbedpanel's selected tab to be #0. It's not that complicated. In Swing, I
> would write: tabPanel.setSelectedTab(0); and that would be it.
>
> Now I'm not very critical about how software systems are constructed, and
> don't care if some features may cause minor side-effects, or cause the
> programmer to write a bit hacky code. But having the setSelectedTab() method
> detach the page for no apparent reason and without any warning is as bad as
> having a goto command in a programming language. "Side effects" are one of
> the first thing that you learn in college, and why you should avoid them at
> all cost. The documentation for the setSelectedTab() says "sets the selected
> tab". What it's missing is a big warning sign "WARNING IT DETACHES THE
> PAGE WILL CAUSE UNRELATED ERROR MESSAGES!!!"
>
> So what is your suggestion Igor? How should I use the framework properly?
>
> Regards,
> Csaba
>
>
> Igor Vaynberg wrote:
>>
>> of course there is no reason to use an ajax link if all you are going
>> to do is repaint the entire page anyways...
>>
>> also code like this: setresponsepage(getpage()) is always suspect. by
>> default wicket repaints the same page so there is no need to call
>> this. when inside ajax you should add components you want repainted to
>> the request target that is passed in to you.
>>
>> setresponsepage should only be used when actually going to a different
>> page. you are not using the framework properly...
>>
>> -igor
>>
>> 2009/7/29 Martin Makundi :
>>
>>>
>>> 1.
>>>
>>> You can fix linda's suggestion by calling setOutputMarkupId(true) on
>>> your tabbedpanel.
>>>
>>> 2. The reason for:
>>>
>>> 10:42:27 ERROR [RequestCycle] - No Page found for component
>>> [MarkupContainer [Component id = panel]]
>>> java.lang.IllegalStateException: No Page found for component
>>> [MarkupContainer [Component id = panel]]
>>>     at org.apache.wicket.Component.getPage(Component.java:1729)
>>>
>>> Is that you just called setSelectedTab() which DISCONNECTS the current
>>> tab from the page hierarcy. Try getting the page before that:
>>> onClick() {
>>>  Page page = getPage();
>>>  tabbedPanel.setSelectedTab(0);
>>>  setREsponsePage(page);
>>> }
>>>
>>>
>>> **
>>> Martin
>>>
>>>
>>> **
>>> Martin
>>>
>>> 2009/7/29 Gajo Csaba :
>>>

 Hmm there's something very wrong here...

 I try to refresh the page like this:
 setResponsePage(getPage());

 When this is the only action, the current page is refreshed. When I
 write
 setSelectedTab(0) above it, I get an error.

 10:42:27 ERROR [RequestCycle] - No Page found for component
 [MarkupContainer
 [Component id = panel]]
 java.lang.IllegalStateException: No Page found for component
 [MarkupContainer [Component id = panel]]
      at org.apache.wicket.Component.getPage(Component.java:1729)
      at

 si.irose.iprojekti.treeview.TreeViewPanel.deleteBtnClick(TreeViewPanel.java:160)
      at

 si.irose.iprojekti.treeview.TreeViewPanel.access$200(TreeViewPanel.java:45)
      at

 si.irose.iprojekti.treeview.TreeViewPanel$3.onSubmit(TreeViewPanel.java:95)
      at

 org.apache.wicket.ajax.markup.html.form.AjaxFallbackButton$1.onSubmit(AjaxFallbackButton.java:74)
      at

 org.apache.wicket.ajax.form.AjaxFormSubmitBehavior.onEvent(AjaxFormSubmitBehavior.java:140)
      at

 org.apache.wicket.ajax.AjaxEventBehavior.respond(AjaxEventBehavior.java:166)
      at

 org.apache.wicket.ajax.AbstractDefaultAjaxBehavior.onRequest(AbstractDefaultAjaxBehavior.java:299)
      at

 org.apache.wicket.request.target.component.listener.BehaviorRequestTarget.processEvents(BehaviorRequestTarget.java:105)
      at
>>

Re: Beginner problems with TabbedPanel

2009-07-30 Thread Iain Reddick


confirmBtn = new Button("confirm") {
  private static final long serialVersionUID = 1L;
  @Override
  public void onSubmit() {
  Page homePage = (HomePage)getPage();
  homePage.getTabbedPanel().setSelectedTab(0);
  }
};

Iain Reddick wrote:

Sorry - I've re-read your initial post and see what your issue is.

Iain Reddick wrote:

Surely this is what you want for a non-ajax solution:

class MyPage extends Page {
 private TabbedPanel tabPanel;
 ...
 public MyPage() {
   tabPanel = new TabPanel(...);
   add( tabPanel );
   ...
   confirmBtn = new Button("confirm") {
 private static final long serialVersionUID = 1L;

 @Override
 public void onSubmit() {
   tabPanel.setSelectedTab(0);
 }
   };
   add( confirmBtn );
 }
}

And for an ajax solution, just add tabPanel to the ajax request in 
the submit handler?


Sorry if this isn't right, but I don't see what the issue is.

Gajo Csaba wrote:
That may be true Igor, but there doesn't seem to be any other 
solution to make this work:


confirmBtn = new Button("confirm") {
   private static final long serialVersionUID = 1L;
   @Override
   public void onSubmit() {
   Page page = getPage();
   TabbedPanel tabPanel = 
((HomePage)getWebPage()).getTabbedPanel();  
tabPanel.setSelectedTab(0);

   setResponsePage(page);
   }
};

I cannot repaint the tabPanel (either with render() or 
renderComponent()), cannot repaint the whole page, cannot go with 
Linda's suggestion because even after Martin's fix it still 
generates an error. I just want to set the tabbedpanel's selected 
tab to be #0. It's not that complicated. In Swing, I would write: 
tabPanel.setSelectedTab(0); and that would be it.


Now I'm not very critical about how software systems are 
constructed, and don't care if some features may cause minor 
side-effects, or cause the programmer to write a bit hacky code. But 
having the setSelectedTab() method detach the page for no apparent 
reason and without any warning is as bad as having a goto command in 
a programming language. "Side effects" are one of the first thing 
that you learn in college, and why you should avoid them at all 
cost. The documentation for the setSelectedTab() says "sets the 
selected tab". What it's missing is a big warning sign "WARNING 
IT DETACHES THE PAGE WILL CAUSE UNRELATED ERROR MESSAGES!!!"


So what is your suggestion Igor? How should I use the framework 
properly?


Regards,
Csaba


Igor Vaynberg wrote:

of course there is no reason to use an ajax link if all you are going
to do is repaint the entire page anyways...

also code like this: setresponsepage(getpage()) is always suspect. by
default wicket repaints the same page so there is no need to call
this. when inside ajax you should add components you want repainted to
the request target that is passed in to you.

setresponsepage should only be used when actually going to a different
page. you are not using the framework properly...

-igor

2009/7/29 Martin Makundi :
 

1.

You can fix linda's suggestion by calling setOutputMarkupId(true) on
your tabbedpanel.

2. The reason for:

10:42:27 ERROR [RequestCycle] - No Page found for component
[MarkupContainer [Component id = panel]]
java.lang.IllegalStateException: No Page found for component
[MarkupContainer [Component id = panel]]
 at org.apache.wicket.Component.getPage(Component.java:1729)

Is that you just called setSelectedTab() which DISCONNECTS the 
current

tab from the page hierarcy. Try getting the page before that:
onClick() {
 Page page = getPage();
 tabbedPanel.setSelectedTab(0);
 setREsponsePage(page);
}


**
Martin


**
Martin

2009/7/29 Gajo Csaba :
 

Hmm there's something very wrong here...

I try to refresh the page like this:
setResponsePage(getPage());

When this is the only action, the current page is refreshed. When 
I write

setSelectedTab(0) above it, I get an error.

10:42:27 ERROR [RequestCycle] - No Page found for component 
[MarkupContainer

[Component id = panel]]
java.lang.IllegalStateException: No Page found for component
[MarkupContainer [Component id = panel]]
  at org.apache.wicket.Component.getPage(Component.java:1729)
  at
si.irose.iprojekti.treeview.TreeViewPanel.deleteBtnClick(TreeViewPanel.java:160) 


  at
si.irose.iprojekti.treeview.TreeViewPanel.access$200(TreeViewPanel.java:45) 


  at
si.irose.iprojekti.treeview.TreeViewPanel$3.onSubmit(TreeViewPanel.java:95) 


  at
org.apache.wicket.ajax.markup.html.form.AjaxFallbackButton$1.onSubmit(AjaxFallbackButton.java:74) 


  at
org.apache.wicket.ajax.form.AjaxFormSubmitBehavior.onEvent(AjaxFormSubmitBehavior.java:140) 


  at
org.apache.wicket.ajax.AjaxEventBehavior.respond(AjaxEventBehavior.java:166) 


  at
org.apache.wicket.ajax.AbstractDefaultAjaxBehavior.onRequest(AbstractDefaultAjaxBehavior.java:299) 


  at
org.apache.wicket.request.target.component.listener.BehaviorRequestTarget.processEvents(BehaviorRequestTarget.java:105) 


  

Re: Beginner problems with TabbedPanel

2009-07-30 Thread Gajo Csaba

Hi Iain,

I solved the problem thanks to martin-g from ##wicket. Seems like the 
problem was I was using a non-ajax tabbed panel with an ajax button. 
When I switched to an ajax panel, it worked great.
I've also tried using a non-ajax tabbed panel with a non-ajax button 
like you suggested, and it also seems to work.


Looks like the only problem here is that you shouldn't mix ajax 
components with non-ajax ones.


Regards,
Csaba


Iain Reddick wrote:

Surely this is what you want for a non-ajax solution:

class MyPage extends Page {
 private TabbedPanel tabPanel;
 ...
 public MyPage() {
   tabPanel = new TabPanel(...);
   add( tabPanel );
   ...
   confirmBtn = new Button("confirm") {
 private static final long serialVersionUID = 1L;

 @Override
 public void onSubmit() {
   tabPanel.setSelectedTab(0);
 }
   };
   add( confirmBtn );
 }
}

And for an ajax solution, just add tabPanel to the ajax request in the 
submit handler?


Sorry if this isn't right, but I don't see what the issue is.

Gajo Csaba wrote:
That may be true Igor, but there doesn't seem to be any other 
solution to make this work:


confirmBtn = new Button("confirm") {
   private static final long serialVersionUID = 1L;
   @Override
   public void onSubmit() {
   Page page = getPage();
   TabbedPanel tabPanel = 
((HomePage)getWebPage()).getTabbedPanel();  
tabPanel.setSelectedTab(0);

   setResponsePage(page);
   }
};

I cannot repaint the tabPanel (either with render() or 
renderComponent()), cannot repaint the whole page, cannot go with 
Linda's suggestion because even after Martin's fix it still generates 
an error. I just want to set the tabbedpanel's selected tab to be #0. 
It's not that complicated. In Swing, I would write: 
tabPanel.setSelectedTab(0); and that would be it.


Now I'm not very critical about how software systems are constructed, 
and don't care if some features may cause minor side-effects, or 
cause the programmer to write a bit hacky code. But having the 
setSelectedTab() method detach the page for no apparent reason and 
without any warning is as bad as having a goto command in a 
programming language. "Side effects" are one of the first thing that 
you learn in college, and why you should avoid them at all cost. The 
documentation for the setSelectedTab() says "sets the selected tab". 
What it's missing is a big warning sign "WARNING IT DETACHES THE 
PAGE WILL CAUSE UNRELATED ERROR MESSAGES!!!"


So what is your suggestion Igor? How should I use the framework 
properly?


Regards,
Csaba


Igor Vaynberg wrote:

of course there is no reason to use an ajax link if all you are going
to do is repaint the entire page anyways...

also code like this: setresponsepage(getpage()) is always suspect. by
default wicket repaints the same page so there is no need to call
this. when inside ajax you should add components you want repainted to
the request target that is passed in to you.

setresponsepage should only be used when actually going to a different
page. you are not using the framework properly...

-igor

2009/7/29 Martin Makundi :
 

1.

You can fix linda's suggestion by calling setOutputMarkupId(true) on
your tabbedpanel.

2. The reason for:

10:42:27 ERROR [RequestCycle] - No Page found for component
[MarkupContainer [Component id = panel]]
java.lang.IllegalStateException: No Page found for component
[MarkupContainer [Component id = panel]]
 at org.apache.wicket.Component.getPage(Component.java:1729)

Is that you just called setSelectedTab() which DISCONNECTS the current
tab from the page hierarcy. Try getting the page before that:
onClick() {
 Page page = getPage();
 tabbedPanel.setSelectedTab(0);
 setREsponsePage(page);
}


**
Martin


**
Martin

2009/7/29 Gajo Csaba :
  

Hmm there's something very wrong here...

I try to refresh the page like this:
setResponsePage(getPage());

When this is the only action, the current page is refreshed. When 
I write

setSelectedTab(0) above it, I get an error.

10:42:27 ERROR [RequestCycle] - No Page found for component 
[MarkupContainer

[Component id = panel]]
java.lang.IllegalStateException: No Page found for component
[MarkupContainer [Component id = panel]]
  at org.apache.wicket.Component.getPage(Component.java:1729)
  at
si.irose.iprojekti.treeview.TreeViewPanel.deleteBtnClick(TreeViewPanel.java:160) 


  at
si.irose.iprojekti.treeview.TreeViewPanel.access$200(TreeViewPanel.java:45) 


  at
si.irose.iprojekti.treeview.TreeViewPanel$3.onSubmit(TreeViewPanel.java:95) 


  at
org.apache.wicket.ajax.markup.html.form.AjaxFallbackButton$1.onSubmit(AjaxFallbackButton.java:74) 


  at
org.apache.wicket.ajax.form.AjaxFormSubmitBehavior.onEvent(AjaxFormSubmitBehavior.java:140) 


  at
org.apache.wicket.ajax.AjaxEventBehavior.respond(AjaxEventBehavior.java:166) 


  at
org.apache.wicket.ajax.AbstractDefaultAjaxBehavior.onRequest(AbstractDefaultAjaxBehavior.java:299) 


  at
org.apache.wi

Re: Beginner problems with TabbedPanel

2009-07-30 Thread Iain Reddick

Sorry - I've re-read your initial post and see what your issue is.

Iain Reddick wrote:

Surely this is what you want for a non-ajax solution:

class MyPage extends Page {
 private TabbedPanel tabPanel;
 ...
 public MyPage() {
   tabPanel = new TabPanel(...);
   add( tabPanel );
   ...
   confirmBtn = new Button("confirm") {
 private static final long serialVersionUID = 1L;

 @Override
 public void onSubmit() {
   tabPanel.setSelectedTab(0);
 }
   };
   add( confirmBtn );
 }
}

And for an ajax solution, just add tabPanel to the ajax request in the 
submit handler?


Sorry if this isn't right, but I don't see what the issue is.

Gajo Csaba wrote:
That may be true Igor, but there doesn't seem to be any other 
solution to make this work:


confirmBtn = new Button("confirm") {
   private static final long serialVersionUID = 1L;
   @Override
   public void onSubmit() {
   Page page = getPage();
   TabbedPanel tabPanel = 
((HomePage)getWebPage()).getTabbedPanel();  
tabPanel.setSelectedTab(0);

   setResponsePage(page);
   }
};

I cannot repaint the tabPanel (either with render() or 
renderComponent()), cannot repaint the whole page, cannot go with 
Linda's suggestion because even after Martin's fix it still generates 
an error. I just want to set the tabbedpanel's selected tab to be #0. 
It's not that complicated. In Swing, I would write: 
tabPanel.setSelectedTab(0); and that would be it.


Now I'm not very critical about how software systems are constructed, 
and don't care if some features may cause minor side-effects, or 
cause the programmer to write a bit hacky code. But having the 
setSelectedTab() method detach the page for no apparent reason and 
without any warning is as bad as having a goto command in a 
programming language. "Side effects" are one of the first thing that 
you learn in college, and why you should avoid them at all cost. The 
documentation for the setSelectedTab() says "sets the selected tab". 
What it's missing is a big warning sign "WARNING IT DETACHES THE 
PAGE WILL CAUSE UNRELATED ERROR MESSAGES!!!"


So what is your suggestion Igor? How should I use the framework 
properly?


Regards,
Csaba


Igor Vaynberg wrote:

of course there is no reason to use an ajax link if all you are going
to do is repaint the entire page anyways...

also code like this: setresponsepage(getpage()) is always suspect. by
default wicket repaints the same page so there is no need to call
this. when inside ajax you should add components you want repainted to
the request target that is passed in to you.

setresponsepage should only be used when actually going to a different
page. you are not using the framework properly...

-igor

2009/7/29 Martin Makundi :
 

1.

You can fix linda's suggestion by calling setOutputMarkupId(true) on
your tabbedpanel.

2. The reason for:

10:42:27 ERROR [RequestCycle] - No Page found for component
[MarkupContainer [Component id = panel]]
java.lang.IllegalStateException: No Page found for component
[MarkupContainer [Component id = panel]]
 at org.apache.wicket.Component.getPage(Component.java:1729)

Is that you just called setSelectedTab() which DISCONNECTS the current
tab from the page hierarcy. Try getting the page before that:
onClick() {
 Page page = getPage();
 tabbedPanel.setSelectedTab(0);
 setREsponsePage(page);
}


**
Martin


**
Martin

2009/7/29 Gajo Csaba :
  

Hmm there's something very wrong here...

I try to refresh the page like this:
setResponsePage(getPage());

When this is the only action, the current page is refreshed. When 
I write

setSelectedTab(0) above it, I get an error.

10:42:27 ERROR [RequestCycle] - No Page found for component 
[MarkupContainer

[Component id = panel]]
java.lang.IllegalStateException: No Page found for component
[MarkupContainer [Component id = panel]]
  at org.apache.wicket.Component.getPage(Component.java:1729)
  at
si.irose.iprojekti.treeview.TreeViewPanel.deleteBtnClick(TreeViewPanel.java:160) 


  at
si.irose.iprojekti.treeview.TreeViewPanel.access$200(TreeViewPanel.java:45) 


  at
si.irose.iprojekti.treeview.TreeViewPanel$3.onSubmit(TreeViewPanel.java:95) 


  at
org.apache.wicket.ajax.markup.html.form.AjaxFallbackButton$1.onSubmit(AjaxFallbackButton.java:74) 


  at
org.apache.wicket.ajax.form.AjaxFormSubmitBehavior.onEvent(AjaxFormSubmitBehavior.java:140) 


  at
org.apache.wicket.ajax.AjaxEventBehavior.respond(AjaxEventBehavior.java:166) 


  at
org.apache.wicket.ajax.AbstractDefaultAjaxBehavior.onRequest(AbstractDefaultAjaxBehavior.java:299) 


  at
org.apache.wicket.request.target.component.listener.BehaviorRequestTarget.processEvents(BehaviorRequestTarget.java:105) 


  at
org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(AbstractRequestCycleProcessor.java:92) 


  at
org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1192) 


  at org.apache.wicket.RequestCycle.step(R

Re: Beginner problems with TabbedPanel

2009-07-30 Thread Iain Reddick

Surely this is what you want for a non-ajax solution:

class MyPage extends Page {
 private TabbedPanel tabPanel;
 ...
 public MyPage() {
   tabPanel = new TabPanel(...);
   add( tabPanel );
   ...
   confirmBtn = new Button("confirm") {
 private static final long serialVersionUID = 1L;

 @Override
 public void onSubmit() {
   tabPanel.setSelectedTab(0);
 }
   };
   add( confirmBtn );
 }
}

And for an ajax solution, just add tabPanel to the ajax request in the 
submit handler?


Sorry if this isn't right, but I don't see what the issue is.

Gajo Csaba wrote:
That may be true Igor, but there doesn't seem to be any other solution 
to make this work:


confirmBtn = new Button("confirm") {
   private static final long serialVersionUID = 1L;
   @Override
   public void onSubmit() {
   Page page = getPage();
   TabbedPanel tabPanel = 
((HomePage)getWebPage()).getTabbedPanel();  
tabPanel.setSelectedTab(0);

   setResponsePage(page);
   }
};

I cannot repaint the tabPanel (either with render() or 
renderComponent()), cannot repaint the whole page, cannot go with 
Linda's suggestion because even after Martin's fix it still generates 
an error. I just want to set the tabbedpanel's selected tab to be #0. 
It's not that complicated. In Swing, I would write: 
tabPanel.setSelectedTab(0); and that would be it.


Now I'm not very critical about how software systems are constructed, 
and don't care if some features may cause minor side-effects, or cause 
the programmer to write a bit hacky code. But having the 
setSelectedTab() method detach the page for no apparent reason and 
without any warning is as bad as having a goto command in a 
programming language. "Side effects" are one of the first thing that 
you learn in college, and why you should avoid them at all cost. The 
documentation for the setSelectedTab() says "sets the selected tab". 
What it's missing is a big warning sign "WARNING IT DETACHES THE 
PAGE WILL CAUSE UNRELATED ERROR MESSAGES!!!"


So what is your suggestion Igor? How should I use the framework properly?

Regards,
Csaba


Igor Vaynberg wrote:

of course there is no reason to use an ajax link if all you are going
to do is repaint the entire page anyways...

also code like this: setresponsepage(getpage()) is always suspect. by
default wicket repaints the same page so there is no need to call
this. when inside ajax you should add components you want repainted to
the request target that is passed in to you.

setresponsepage should only be used when actually going to a different
page. you are not using the framework properly...

-igor

2009/7/29 Martin Makundi :
 

1.

You can fix linda's suggestion by calling setOutputMarkupId(true) on
your tabbedpanel.

2. The reason for:

10:42:27 ERROR [RequestCycle] - No Page found for component
[MarkupContainer [Component id = panel]]
java.lang.IllegalStateException: No Page found for component
[MarkupContainer [Component id = panel]]
 at org.apache.wicket.Component.getPage(Component.java:1729)

Is that you just called setSelectedTab() which DISCONNECTS the current
tab from the page hierarcy. Try getting the page before that:
onClick() {
 Page page = getPage();
 tabbedPanel.setSelectedTab(0);
 setREsponsePage(page);
}


**
Martin


**
Martin

2009/7/29 Gajo Csaba :
   

Hmm there's something very wrong here...

I try to refresh the page like this:
setResponsePage(getPage());

When this is the only action, the current page is refreshed. When I 
write

setSelectedTab(0) above it, I get an error.

10:42:27 ERROR [RequestCycle] - No Page found for component 
[MarkupContainer

[Component id = panel]]
java.lang.IllegalStateException: No Page found for component
[MarkupContainer [Component id = panel]]
  at org.apache.wicket.Component.getPage(Component.java:1729)
  at
si.irose.iprojekti.treeview.TreeViewPanel.deleteBtnClick(TreeViewPanel.java:160) 


  at
si.irose.iprojekti.treeview.TreeViewPanel.access$200(TreeViewPanel.java:45) 


  at
si.irose.iprojekti.treeview.TreeViewPanel$3.onSubmit(TreeViewPanel.java:95) 


  at
org.apache.wicket.ajax.markup.html.form.AjaxFallbackButton$1.onSubmit(AjaxFallbackButton.java:74) 


  at
org.apache.wicket.ajax.form.AjaxFormSubmitBehavior.onEvent(AjaxFormSubmitBehavior.java:140) 


  at
org.apache.wicket.ajax.AjaxEventBehavior.respond(AjaxEventBehavior.java:166) 


  at
org.apache.wicket.ajax.AbstractDefaultAjaxBehavior.onRequest(AbstractDefaultAjaxBehavior.java:299) 


  at
org.apache.wicket.request.target.component.listener.BehaviorRequestTarget.processEvents(BehaviorRequestTarget.java:105) 


  at
org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(AbstractRequestCycleProcessor.java:92) 


  at
org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1192) 


  at org.apache.wicket.RequestCycle.step(RequestCycle.java:1271)
  at org.apache.wicket.RequestCycle.steps(RequestCycle.java:137

Re: Beginner problems with TabbedPanel

2009-07-30 Thread Gajo Csaba
That may be true Igor, but there doesn't seem to be any other solution 
to make this work:


confirmBtn = new Button("confirm") {
   private static final long serialVersionUID = 1L;
   @Override
   public void onSubmit() {
   Page page = getPage();
   TabbedPanel tabPanel = 
((HomePage)getWebPage()).getTabbedPanel();   
   tabPanel.setSelectedTab(0);

   setResponsePage(page);
   }
};

I cannot repaint the tabPanel (either with render() or 
renderComponent()), cannot repaint the whole page, cannot go with 
Linda's suggestion because even after Martin's fix it still generates an 
error. I just want to set the tabbedpanel's selected tab to be #0. It's 
not that complicated. In Swing, I would write: 
tabPanel.setSelectedTab(0); and that would be it.


Now I'm not very critical about how software systems are constructed, 
and don't care if some features may cause minor side-effects, or cause 
the programmer to write a bit hacky code. But having the 
setSelectedTab() method detach the page for no apparent reason and 
without any warning is as bad as having a goto command in a programming 
language. "Side effects" are one of the first thing that you learn in 
college, and why you should avoid them at all cost. The documentation 
for the setSelectedTab() says "sets the selected tab". What it's missing 
is a big warning sign "WARNING IT DETACHES THE PAGE WILL CAUSE 
UNRELATED ERROR MESSAGES!!!"


So what is your suggestion Igor? How should I use the framework properly?

Regards,
Csaba


Igor Vaynberg wrote:

of course there is no reason to use an ajax link if all you are going
to do is repaint the entire page anyways...

also code like this: setresponsepage(getpage()) is always suspect. by
default wicket repaints the same page so there is no need to call
this. when inside ajax you should add components you want repainted to
the request target that is passed in to you.

setresponsepage should only be used when actually going to a different
page. you are not using the framework properly...

-igor

2009/7/29 Martin Makundi :
  

1.

You can fix linda's suggestion by calling setOutputMarkupId(true) on
your tabbedpanel.

2. The reason for:

10:42:27 ERROR [RequestCycle] - No Page found for component
[MarkupContainer [Component id = panel]]
java.lang.IllegalStateException: No Page found for component
[MarkupContainer [Component id = panel]]
 at org.apache.wicket.Component.getPage(Component.java:1729)

Is that you just called setSelectedTab() which DISCONNECTS the current
tab from the page hierarcy. Try getting the page before that:
onClick() {
 Page page = getPage();
 tabbedPanel.setSelectedTab(0);
 setREsponsePage(page);
}


**
Martin


**
Martin

2009/7/29 Gajo Csaba :


Hmm there's something very wrong here...

I try to refresh the page like this:
setResponsePage(getPage());

When this is the only action, the current page is refreshed. When I write
setSelectedTab(0) above it, I get an error.

10:42:27 ERROR [RequestCycle] - No Page found for component [MarkupContainer
[Component id = panel]]
java.lang.IllegalStateException: No Page found for component
[MarkupContainer [Component id = panel]]
  at org.apache.wicket.Component.getPage(Component.java:1729)
  at
si.irose.iprojekti.treeview.TreeViewPanel.deleteBtnClick(TreeViewPanel.java:160)
  at
si.irose.iprojekti.treeview.TreeViewPanel.access$200(TreeViewPanel.java:45)
  at
si.irose.iprojekti.treeview.TreeViewPanel$3.onSubmit(TreeViewPanel.java:95)
  at
org.apache.wicket.ajax.markup.html.form.AjaxFallbackButton$1.onSubmit(AjaxFallbackButton.java:74)
  at
org.apache.wicket.ajax.form.AjaxFormSubmitBehavior.onEvent(AjaxFormSubmitBehavior.java:140)
  at
org.apache.wicket.ajax.AjaxEventBehavior.respond(AjaxEventBehavior.java:166)
  at
org.apache.wicket.ajax.AbstractDefaultAjaxBehavior.onRequest(AbstractDefaultAjaxBehavior.java:299)
  at
org.apache.wicket.request.target.component.listener.BehaviorRequestTarget.processEvents(BehaviorRequestTarget.java:105)
  at
org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(AbstractRequestCycleProcessor.java:92)
  at
org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1192)
  at org.apache.wicket.RequestCycle.step(RequestCycle.java:1271)
  at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1370)
  at org.apache.wicket.RequestCycle.request(RequestCycle.java:501)
  at
org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:455)
  at
org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:288)
  at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
  at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
  at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
  at
org.apache.catalina.core.StandardContextValve.invoke(StandardContex

Re: Beginner problems with TabbedPanel

2009-07-29 Thread Igor Vaynberg
of course there is no reason to use an ajax link if all you are going
to do is repaint the entire page anyways...

also code like this: setresponsepage(getpage()) is always suspect. by
default wicket repaints the same page so there is no need to call
this. when inside ajax you should add components you want repainted to
the request target that is passed in to you.

setresponsepage should only be used when actually going to a different
page. you are not using the framework properly...

-igor

2009/7/29 Martin Makundi :
> 1.
>
> You can fix linda's suggestion by calling setOutputMarkupId(true) on
> your tabbedpanel.
>
> 2. The reason for:
>
> 10:42:27 ERROR [RequestCycle] - No Page found for component
> [MarkupContainer [Component id = panel]]
> java.lang.IllegalStateException: No Page found for component
> [MarkupContainer [Component id = panel]]
>      at org.apache.wicket.Component.getPage(Component.java:1729)
>
> Is that you just called setSelectedTab() which DISCONNECTS the current
> tab from the page hierarcy. Try getting the page before that:
> onClick() {
>  Page page = getPage();
>  tabbedPanel.setSelectedTab(0);
>  setREsponsePage(page);
> }
>
>
> **
> Martin
>
>
> **
> Martin
>
> 2009/7/29 Gajo Csaba :
>> Hmm there's something very wrong here...
>>
>> I try to refresh the page like this:
>> setResponsePage(getPage());
>>
>> When this is the only action, the current page is refreshed. When I write
>> setSelectedTab(0) above it, I get an error.
>>
>> 10:42:27 ERROR [RequestCycle] - No Page found for component [MarkupContainer
>> [Component id = panel]]
>> java.lang.IllegalStateException: No Page found for component
>> [MarkupContainer [Component id = panel]]
>>       at org.apache.wicket.Component.getPage(Component.java:1729)
>>       at
>> si.irose.iprojekti.treeview.TreeViewPanel.deleteBtnClick(TreeViewPanel.java:160)
>>       at
>> si.irose.iprojekti.treeview.TreeViewPanel.access$200(TreeViewPanel.java:45)
>>       at
>> si.irose.iprojekti.treeview.TreeViewPanel$3.onSubmit(TreeViewPanel.java:95)
>>       at
>> org.apache.wicket.ajax.markup.html.form.AjaxFallbackButton$1.onSubmit(AjaxFallbackButton.java:74)
>>       at
>> org.apache.wicket.ajax.form.AjaxFormSubmitBehavior.onEvent(AjaxFormSubmitBehavior.java:140)
>>       at
>> org.apache.wicket.ajax.AjaxEventBehavior.respond(AjaxEventBehavior.java:166)
>>       at
>> org.apache.wicket.ajax.AbstractDefaultAjaxBehavior.onRequest(AbstractDefaultAjaxBehavior.java:299)
>>       at
>> org.apache.wicket.request.target.component.listener.BehaviorRequestTarget.processEvents(BehaviorRequestTarget.java:105)
>>       at
>> org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(AbstractRequestCycleProcessor.java:92)
>>       at
>> org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1192)
>>       at org.apache.wicket.RequestCycle.step(RequestCycle.java:1271)
>>       at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1370)
>>       at org.apache.wicket.RequestCycle.request(RequestCycle.java:501)
>>       at
>> org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:455)
>>       at
>> org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:288)
>>       at
>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
>>       at
>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>>       at
>> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
>>       at
>> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
>>       at
>> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
>>       at
>> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
>>       at
>> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
>>       at
>> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
>>       at
>> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
>>       at
>> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
>>       at
>> org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
>>       at java.lang.Thread.run(Thread.java:619)
>>
>>
>> I've also tried with render() and renderComponent(), on a page and on the
>> tabPanel level...
>>
>> Linda's suggestion also generates an error, albeit a different one.
>> "innertabs" is found in HomePage.html, which looks like this:
>>
>> 
>> 
>> 
>> 
>>   
>>       [inner tabbed panel
>> will be here]
>>   
>> 
>> 
>>
>> The tabbed panel is the "innertabs". The generated exception is:
>>
>> java.lang.IllegalArgumentException: cannot update component that does not
>> have setOutputMarkupId property set to true. Component: [MarkupContainer
>> [Component id = innertabs]]
>>    at
>> org.apache.wicket.ajax.AjaxRequestTarget.addComponen

Re: Beginner problems with TabbedPanel

2009-07-29 Thread Martin Makundi
Good. Finally I said something useful :)

**
Martin

2009/7/29 Gajo Csaba :
> Thanks Martin, it finally works! :)
>
>

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Beginner problems with TabbedPanel

2009-07-29 Thread Gajo Csaba

Thanks Martin, it finally works! :)


Martin Makundi wrote:

1.

You can fix linda's suggestion by calling setOutputMarkupId(true) on
your tabbedpanel.

2. The reason for:

10:42:27 ERROR [RequestCycle] - No Page found for component
[MarkupContainer [Component id = panel]]
java.lang.IllegalStateException: No Page found for component
[MarkupContainer [Component id = panel]]
  at org.apache.wicket.Component.getPage(Component.java:1729)

Is that you just called setSelectedTab() which DISCONNECTS the current
tab from the page hierarcy. Try getting the page before that:
onClick() {
  Page page = getPage();
  tabbedPanel.setSelectedTab(0);
  setREsponsePage(page);
}


**
Martin


**
Martin

2009/7/29 Gajo Csaba :
  

Hmm there's something very wrong here...

I try to refresh the page like this:
setResponsePage(getPage());

When this is the only action, the current page is refreshed. When I write
setSelectedTab(0) above it, I get an error.

10:42:27 ERROR [RequestCycle] - No Page found for component [MarkupContainer
[Component id = panel]]
java.lang.IllegalStateException: No Page found for component
[MarkupContainer [Component id = panel]]
  at org.apache.wicket.Component.getPage(Component.java:1729)
  at
si.irose.iprojekti.treeview.TreeViewPanel.deleteBtnClick(TreeViewPanel.java:160)
  at
si.irose.iprojekti.treeview.TreeViewPanel.access$200(TreeViewPanel.java:45)
  at
si.irose.iprojekti.treeview.TreeViewPanel$3.onSubmit(TreeViewPanel.java:95)
  at
org.apache.wicket.ajax.markup.html.form.AjaxFallbackButton$1.onSubmit(AjaxFallbackButton.java:74)
  at
org.apache.wicket.ajax.form.AjaxFormSubmitBehavior.onEvent(AjaxFormSubmitBehavior.java:140)
  at
org.apache.wicket.ajax.AjaxEventBehavior.respond(AjaxEventBehavior.java:166)
  at
org.apache.wicket.ajax.AbstractDefaultAjaxBehavior.onRequest(AbstractDefaultAjaxBehavior.java:299)
  at
org.apache.wicket.request.target.component.listener.BehaviorRequestTarget.processEvents(BehaviorRequestTarget.java:105)
  at
org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(AbstractRequestCycleProcessor.java:92)
  at
org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1192)
  at org.apache.wicket.RequestCycle.step(RequestCycle.java:1271)
  at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1370)
  at org.apache.wicket.RequestCycle.request(RequestCycle.java:501)
  at
org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:455)
  at
org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:288)
  at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
  at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
  at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
  at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
  at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
  at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
  at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
  at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
  at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
  at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
  at
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
  at java.lang.Thread.run(Thread.java:619)


I've also tried with render() and renderComponent(), on a page and on the
tabPanel level...

Linda's suggestion also generates an error, albeit a different one.
"innertabs" is found in HomePage.html, which looks like this:





  
  [inner tabbed panel
will be here]
  



The tabbed panel is the "innertabs". The generated exception is:

java.lang.IllegalArgumentException: cannot update component that does not
have setOutputMarkupId property set to true. Component: [MarkupContainer
[Component id = innertabs]]
   at
org.apache.wicket.ajax.AjaxRequestTarget.addComponent(AjaxRequestTarget.java:345)
   at
si.irose.iprojekti.treeview.TreeViewPanel.deleteBtnClick(TreeViewPanel.java:161)
   at
si.irose.iprojekti.treeview.TreeViewPanel.access$200(TreeViewPanel.java:45)
   at
si.irose.iprojekti.treeview.TreeViewPanel$3.onSubmit(TreeViewPanel.java:95)
   at
org.apache.wicket.ajax.markup.html.form.AjaxFallbackButton$1.onSubmit(AjaxFallbackButton.java:74)
   at
org.apache.wicket.ajax.form.AjaxFormSubmitBehavior.onEvent(AjaxFormSubmitBehavior.java:140)
   at
org.apache.wicket.ajax.AjaxEventBehavior.respond(AjaxEventBehavior.java:166)
   at
org.apache.wicket.ajax.AbstractDefaultAjaxBehavior.onRequest(AbstractDefaultAjaxBehavior.java:299)
   at
org.apache.wicket.request.target.component.listener.BehaviorRequestTarget.processEvent

Re: Beginner problems with TabbedPanel

2009-07-29 Thread Martin Makundi
1.

You can fix linda's suggestion by calling setOutputMarkupId(true) on
your tabbedpanel.

2. The reason for:

10:42:27 ERROR [RequestCycle] - No Page found for component
[MarkupContainer [Component id = panel]]
java.lang.IllegalStateException: No Page found for component
[MarkupContainer [Component id = panel]]
  at org.apache.wicket.Component.getPage(Component.java:1729)

Is that you just called setSelectedTab() which DISCONNECTS the current
tab from the page hierarcy. Try getting the page before that:
onClick() {
  Page page = getPage();
  tabbedPanel.setSelectedTab(0);
  setREsponsePage(page);
}


**
Martin


**
Martin

2009/7/29 Gajo Csaba :
> Hmm there's something very wrong here...
>
> I try to refresh the page like this:
> setResponsePage(getPage());
>
> When this is the only action, the current page is refreshed. When I write
> setSelectedTab(0) above it, I get an error.
>
> 10:42:27 ERROR [RequestCycle] - No Page found for component [MarkupContainer
> [Component id = panel]]
> java.lang.IllegalStateException: No Page found for component
> [MarkupContainer [Component id = panel]]
>       at org.apache.wicket.Component.getPage(Component.java:1729)
>       at
> si.irose.iprojekti.treeview.TreeViewPanel.deleteBtnClick(TreeViewPanel.java:160)
>       at
> si.irose.iprojekti.treeview.TreeViewPanel.access$200(TreeViewPanel.java:45)
>       at
> si.irose.iprojekti.treeview.TreeViewPanel$3.onSubmit(TreeViewPanel.java:95)
>       at
> org.apache.wicket.ajax.markup.html.form.AjaxFallbackButton$1.onSubmit(AjaxFallbackButton.java:74)
>       at
> org.apache.wicket.ajax.form.AjaxFormSubmitBehavior.onEvent(AjaxFormSubmitBehavior.java:140)
>       at
> org.apache.wicket.ajax.AjaxEventBehavior.respond(AjaxEventBehavior.java:166)
>       at
> org.apache.wicket.ajax.AbstractDefaultAjaxBehavior.onRequest(AbstractDefaultAjaxBehavior.java:299)
>       at
> org.apache.wicket.request.target.component.listener.BehaviorRequestTarget.processEvents(BehaviorRequestTarget.java:105)
>       at
> org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(AbstractRequestCycleProcessor.java:92)
>       at
> org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1192)
>       at org.apache.wicket.RequestCycle.step(RequestCycle.java:1271)
>       at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1370)
>       at org.apache.wicket.RequestCycle.request(RequestCycle.java:501)
>       at
> org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:455)
>       at
> org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:288)
>       at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
>       at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>       at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
>       at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
>       at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
>       at
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
>       at
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
>       at
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
>       at
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
>       at
> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
>       at
> org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
>       at java.lang.Thread.run(Thread.java:619)
>
>
> I've also tried with render() and renderComponent(), on a page and on the
> tabPanel level...
>
> Linda's suggestion also generates an error, albeit a different one.
> "innertabs" is found in HomePage.html, which looks like this:
>
> 
> 
> 
> 
>   
>       [inner tabbed panel
> will be here]
>   
> 
> 
>
> The tabbed panel is the "innertabs". The generated exception is:
>
> java.lang.IllegalArgumentException: cannot update component that does not
> have setOutputMarkupId property set to true. Component: [MarkupContainer
> [Component id = innertabs]]
>    at
> org.apache.wicket.ajax.AjaxRequestTarget.addComponent(AjaxRequestTarget.java:345)
>    at
> si.irose.iprojekti.treeview.TreeViewPanel.deleteBtnClick(TreeViewPanel.java:161)
>    at
> si.irose.iprojekti.treeview.TreeViewPanel.access$200(TreeViewPanel.java:45)
>    at
> si.irose.iprojekti.treeview.TreeViewPanel$3.onSubmit(TreeViewPanel.java:95)
>    at
> org.apache.wicket.ajax.markup.html.form.AjaxFallbackButton$1.onSubmit(AjaxFallbackButton.java:74)
>    at
> org.apache.wicket.ajax.form.AjaxFormSubmitBehavior.onEvent(AjaxFormSubmitBehavior.java:140)
>    at
> org.apache.wicket.ajax.AjaxEventBehavior.respond(AjaxEventBehavior.java:166)
>    at
> org.apache.wicket.ajax.AbstractDefaultAjaxBehavior.onRequest

Re: Beginner problems with TabbedPanel

2009-07-29 Thread Gajo Csaba

Hmm there's something very wrong here...

I try to refresh the page like this:
setResponsePage(getPage());

When this is the only action, the current page is refreshed. When I 
write setSelectedTab(0) above it, I get an error.


10:42:27 ERROR [RequestCycle] - No Page found for component 
[MarkupContainer [Component id = panel]]
java.lang.IllegalStateException: No Page found for component 
[MarkupContainer [Component id = panel]]

   at org.apache.wicket.Component.getPage(Component.java:1729)
   at 
si.irose.iprojekti.treeview.TreeViewPanel.deleteBtnClick(TreeViewPanel.java:160)
   at 
si.irose.iprojekti.treeview.TreeViewPanel.access$200(TreeViewPanel.java:45)
   at 
si.irose.iprojekti.treeview.TreeViewPanel$3.onSubmit(TreeViewPanel.java:95)
   at 
org.apache.wicket.ajax.markup.html.form.AjaxFallbackButton$1.onSubmit(AjaxFallbackButton.java:74)
   at 
org.apache.wicket.ajax.form.AjaxFormSubmitBehavior.onEvent(AjaxFormSubmitBehavior.java:140)
   at 
org.apache.wicket.ajax.AjaxEventBehavior.respond(AjaxEventBehavior.java:166)
   at 
org.apache.wicket.ajax.AbstractDefaultAjaxBehavior.onRequest(AbstractDefaultAjaxBehavior.java:299)
   at 
org.apache.wicket.request.target.component.listener.BehaviorRequestTarget.processEvents(BehaviorRequestTarget.java:105)
   at 
org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(AbstractRequestCycleProcessor.java:92)
   at 
org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1192)

   at org.apache.wicket.RequestCycle.step(RequestCycle.java:1271)
   at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1370)
   at org.apache.wicket.RequestCycle.request(RequestCycle.java:501)
   at 
org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:455)
   at 
org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:288)
   at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
   at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
   at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
   at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
   at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
   at 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
   at 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
   at 
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
   at 
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
   at 
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
   at 
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)

   at java.lang.Thread.run(Thread.java:619)


I've also tried with render() and renderComponent(), on a page and on 
the tabPanel level...


Linda's suggestion also generates an error, albeit a different one. 
"innertabs" is found in HomePage.html, which looks like this:






   
   [inner tabbed 
panel will be here]

   



The tabbed panel is the "innertabs". The generated exception is:

java.lang.IllegalArgumentException: cannot update component that does not have 
setOutputMarkupId property set to true. Component: [MarkupContainer [Component 
id = innertabs]]
at 
org.apache.wicket.ajax.AjaxRequestTarget.addComponent(AjaxRequestTarget.java:345)
at 
si.irose.iprojekti.treeview.TreeViewPanel.deleteBtnClick(TreeViewPanel.java:161)
at 
si.irose.iprojekti.treeview.TreeViewPanel.access$200(TreeViewPanel.java:45)
at 
si.irose.iprojekti.treeview.TreeViewPanel$3.onSubmit(TreeViewPanel.java:95)
at 
org.apache.wicket.ajax.markup.html.form.AjaxFallbackButton$1.onSubmit(AjaxFallbackButton.java:74)
at 
org.apache.wicket.ajax.form.AjaxFormSubmitBehavior.onEvent(AjaxFormSubmitBehavior.java:140)
at 
org.apache.wicket.ajax.AjaxEventBehavior.respond(AjaxEventBehavior.java:166)
at 
org.apache.wicket.ajax.AbstractDefaultAjaxBehavior.onRequest(AbstractDefaultAjaxBehavior.java:299)
at 
org.apache.wicket.request.target.component.listener.BehaviorRequestTarget.processEvents(BehaviorRequestTarget.java:105)
at 
org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(AbstractRequestCycleProcessor.java:92)
at 
org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1192)
at org.apache.wicket.RequestCycle.step(RequestCycle.java:1271)
at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1370)
at org.apache.wicket.RequestCycle.request(RequestCycle.java:501)
at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:455)
at 
org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:288)
at 
org.apache.catalina.co

Re: Beginner problems with TabbedPanel

2009-07-29 Thread Linda van der Pal
Try adding the following line to that delteBtnClick method (as the last 
line):


   target.addComponent(tabPanel);

Linda

Gajo Csaba wrote:

This is what the link does in Wicket's source code:

new Link(linkId) {
   private static final long serialVersionUID = 1L;

   @Override
   public void onClick() {
   setSelectedTab(index);   // <-
   }
   };


This is my code:
   /** Click on the Delete button */
   private void deleteBtnClick(AjaxRequestTarget target, Form form) {
   TabbedPanel tabPanel = ((HomePage)getWebPage()).getTabbedPanel();
   tabPanel.setSelectedTab(0);  // <---
   }

Wicket's code works, mine doesn't. I've tried with a button and an 
ajaxfallbacklink... Maybe I really should redirect to the same page 
with another parameter, like you did.






-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Beginner problems with TabbedPanel

2009-07-29 Thread Martin Makundi
Ah.. do you repaint the page after your ajax button call?

**
Martin

2009/7/29 Gajo Csaba :
> This is what the link does in Wicket's source code:
>
> new Link(linkId) {
>           private static final long serialVersionUID = 1L;
>
>           @Override
>           public void onClick() {
>               setSelectedTab(index);   // <-
>           }
>       };
>
>
> This is my code:
>   /** Click on the Delete button */
>   private void deleteBtnClick(AjaxRequestTarget target, Form form) {
>       TabbedPanel tabPanel = ((HomePage)getWebPage()).getTabbedPanel();
>       tabPanel.setSelectedTab(0);      // <---
>   }
>
> Wicket's code works, mine doesn't. I've tried with a button and an
> ajaxfallbacklink... Maybe I really should redirect to the same page with
> another parameter, like you did.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Beginner problems with TabbedPanel

2009-07-29 Thread Gajo Csaba

This is what the link does in Wicket's source code:

new Link(linkId) {
   private static final long serialVersionUID = 1L;

   @Override
   public void onClick() {
   setSelectedTab(index);   // <-
   }
   };


This is my code:
   /** Click on the Delete button */
   private void deleteBtnClick(AjaxRequestTarget target, Form form) {
   TabbedPanel tabPanel = ((HomePage)getWebPage()).getTabbedPanel();
   tabPanel.setSelectedTab(0);  // <---
   }

Wicket's code works, mine doesn't. I've tried with a button and an 
ajaxfallbacklink... Maybe I really should redirect to the same page with 
another parameter, like you did.




Martin Makundi wrote:

Nono... just look at the source code of the link.

**
Martin

2009/7/29 Gajo Csaba :
  

I really hope that I don't have to write

?wicket:interface=:6:innertabs:tabs-container:tabs:0:link:8:ILinkListener::

into the code :(



Martin Makundi wrote:


Duh.. I am not sure but I guess you must create a mechanism... for
example ajax button opens page with such parameter that the tab
selects tab 0. You need to build that logic into tabbedpanel when it
is being rendered...

That's what we did. I am not sure if it is possible to call
setSelectedTab after the page has rendered... you could have a look at
the code in the tab link and do something similar.

**
Martin

2009/7/29 Gajo Csaba :

  

Hello,

I've recently started working with Wicket, so a lot of things are still
unknown for me. For example, right now I have a tabbed panel with two
tabs.
In the begining, I write setSelectedTab(1), so that the first tab is the
default. This works ok.

However, I have an AjaxFallbackLink on the second tab. When I click on
it, I
want the following to happen:
tabbedPanel.setSelectedTab(0);

This creates an exception, saying that some components from tab #1 aren't
visble. And they shouldn't be, because I've selected tab #0.

If I click on the tab link manually (with a mouse), the tab opens fine.

What am I doing wrong? How can I select another tab through an ajax
fallback
link?

Thank you in advance,
Csaba



-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org





-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org


  

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org





-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

  



-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Beginner problems with TabbedPanel

2009-07-29 Thread Gajo Csaba

This is what the link does in Wicket's source code:

new Link(linkId) {
   private static final long serialVersionUID = 1L;

   @Override
   public void onClick() {
   setSelectedTab(index);   // <-
   }
   };


This is my code:
   /** Click on the Delete button */
   private void deleteBtnClick(AjaxRequestTarget target, Form form) {
   TabbedPanel tabPanel = ((HomePage)getWebPage()).getTabbedPanel();
   tabPanel.setSelectedTab(0);  // <---
   }

Wicket's code works, mine doesn't. I've tried with a button and an 
ajaxfallbacklink... Maybe I really should redirect to the same page with 
another parameter, like you did.




Martin Makundi wrote:

Nono... just look at the source code of the link.

**
Martin

2009/7/29 Gajo Csaba :
  

I really hope that I don't have to write

?wicket:interface=:6:innertabs:tabs-container:tabs:0:link:8:ILinkListener::

into the code :(



Martin Makundi wrote:


Duh.. I am not sure but I guess you must create a mechanism... for
example ajax button opens page with such parameter that the tab
selects tab 0. You need to build that logic into tabbedpanel when it
is being rendered...

That's what we did. I am not sure if it is possible to call
setSelectedTab after the page has rendered... you could have a look at
the code in the tab link and do something similar.

**
Martin

2009/7/29 Gajo Csaba :

  

Hello,

I've recently started working with Wicket, so a lot of things are still
unknown for me. For example, right now I have a tabbed panel with two
tabs.
In the begining, I write setSelectedTab(1), so that the first tab is the
default. This works ok.

However, I have an AjaxFallbackLink on the second tab. When I click on
it, I
want the following to happen:
tabbedPanel.setSelectedTab(0);

This creates an exception, saying that some components from tab #1 aren't
visble. And they shouldn't be, because I've selected tab #0.

If I click on the tab link manually (with a mouse), the tab opens fine.

What am I doing wrong? How can I select another tab through an ajax
fallback
link?

Thank you in advance,
Csaba



-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org





-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org


  

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org





-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

  



-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Beginner problems with TabbedPanel

2009-07-29 Thread Martin Makundi
Nono... just look at the source code of the link.

**
Martin

2009/7/29 Gajo Csaba :
> I really hope that I don't have to write
>
> ?wicket:interface=:6:innertabs:tabs-container:tabs:0:link:8:ILinkListener::
>
> into the code :(
>
>
>
> Martin Makundi wrote:
>>
>> Duh.. I am not sure but I guess you must create a mechanism... for
>> example ajax button opens page with such parameter that the tab
>> selects tab 0. You need to build that logic into tabbedpanel when it
>> is being rendered...
>>
>> That's what we did. I am not sure if it is possible to call
>> setSelectedTab after the page has rendered... you could have a look at
>> the code in the tab link and do something similar.
>>
>> **
>> Martin
>>
>> 2009/7/29 Gajo Csaba :
>>
>>>
>>> Hello,
>>>
>>> I've recently started working with Wicket, so a lot of things are still
>>> unknown for me. For example, right now I have a tabbed panel with two
>>> tabs.
>>> In the begining, I write setSelectedTab(1), so that the first tab is the
>>> default. This works ok.
>>>
>>> However, I have an AjaxFallbackLink on the second tab. When I click on
>>> it, I
>>> want the following to happen:
>>> tabbedPanel.setSelectedTab(0);
>>>
>>> This creates an exception, saying that some components from tab #1 aren't
>>> visble. And they shouldn't be, because I've selected tab #0.
>>>
>>> If I click on the tab link manually (with a mouse), the tab opens fine.
>>>
>>> What am I doing wrong? How can I select another tab through an ajax
>>> fallback
>>> link?
>>>
>>> Thank you in advance,
>>> Csaba
>>>
>>>
>>>
>>> -
>>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>>> For additional commands, e-mail: users-h...@wicket.apache.org
>>>
>>>
>>>
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>>
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Beginner problems with TabbedPanel

2009-07-29 Thread Gajo Csaba

I really hope that I don't have to write

?wicket:interface=:6:innertabs:tabs-container:tabs:0:link:8:ILinkListener::

into the code :(



Martin Makundi wrote:

Duh.. I am not sure but I guess you must create a mechanism... for
example ajax button opens page with such parameter that the tab
selects tab 0. You need to build that logic into tabbedpanel when it
is being rendered...

That's what we did. I am not sure if it is possible to call
setSelectedTab after the page has rendered... you could have a look at
the code in the tab link and do something similar.

**
Martin

2009/7/29 Gajo Csaba :
  

Hello,

I've recently started working with Wicket, so a lot of things are still
unknown for me. For example, right now I have a tabbed panel with two tabs.
In the begining, I write setSelectedTab(1), so that the first tab is the
default. This works ok.

However, I have an AjaxFallbackLink on the second tab. When I click on it, I
want the following to happen:
tabbedPanel.setSelectedTab(0);

This creates an exception, saying that some components from tab #1 aren't
visble. And they shouldn't be, because I've selected tab #0.

If I click on the tab link manually (with a mouse), the tab opens fine.

What am I doing wrong? How can I select another tab through an ajax fallback
link?

Thank you in advance,
Csaba



-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org





-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

  



-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Beginner problems with TabbedPanel

2009-07-29 Thread Martin Makundi
Duh.. I am not sure but I guess you must create a mechanism... for
example ajax button opens page with such parameter that the tab
selects tab 0. You need to build that logic into tabbedpanel when it
is being rendered...

That's what we did. I am not sure if it is possible to call
setSelectedTab after the page has rendered... you could have a look at
the code in the tab link and do something similar.

**
Martin

2009/7/29 Gajo Csaba :
> Hello,
>
> I've recently started working with Wicket, so a lot of things are still
> unknown for me. For example, right now I have a tabbed panel with two tabs.
> In the begining, I write setSelectedTab(1), so that the first tab is the
> default. This works ok.
>
> However, I have an AjaxFallbackLink on the second tab. When I click on it, I
> want the following to happen:
> tabbedPanel.setSelectedTab(0);
>
> This creates an exception, saying that some components from tab #1 aren't
> visble. And they shouldn't be, because I've selected tab #0.
>
> If I click on the tab link manually (with a mouse), the tab opens fine.
>
> What am I doing wrong? How can I select another tab through an ajax fallback
> link?
>
> Thank you in advance,
> Csaba
>
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org