Re: How to display an error message?

2009-08-02 Thread Gajo Csaba
Thanks Igor, that was exactly what I needed to do. Could you tell me 
what does target.addComponent() do? It tells Wicket which component 
should be refreshed by the ajax request?



Igor Vaynberg wrote:

feedback.rendercomponent()???

i assume this add button is an ajax button? in that case you have to
add the feedback panel to the ajax target passed to you. there are
plenty of examples in wicket-examples.

-igor

On Sun, Aug 2, 2009 at 11:23 PM, Gajo Csaba wrote:
  

Hello,

I have a FeedbackPanel, a TreeTable and an Add button. When I click on the
Add button, I check if there are any selected nodes in the tree. If there
are none, I want to display an error message in the FeedbackPanel. How to do
this?

The following doesn't work:
feedback.error("Select one node.");

i've also tried re-rendering it, but it also didn't work:
feedback.renderComponent();

What is the proper way to display the error message?

Regards,
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



How to display an error message?

2009-08-02 Thread Gajo Csaba

Hello,

I have a FeedbackPanel, a TreeTable and an Add button. When I click on 
the Add button, I check if there are any selected nodes in the tree. If 
there are none, I want to display an error message in the FeedbackPanel. 
How to do this?


The following doesn't work:
feedback.error("Select one node.");

i've also tried re-rendering it, but it also didn't work:
feedback.renderComponent();

What is the proper way to display the error message?

Regards,
Csaba


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



Re: Modal dialog's components get disabled after closing

2009-07-31 Thread Gajo Csaba
I've found the error, looks like our abstract class which extends the 
ModalWindow had

contentPanel.setEnabled(false);
written in its close callback method...


Gajo Csaba wrote:

Hi,

I have a class which extends ModalWindow and has just one content 
panel inside. I've added several radio buttons and ajaxfallbackbuttons 
to it. When I display it with dialog.show(target) it shows without 
problem.


I also have a "Cancel" button in it, which is supposed to close the 
dialog. It's code is: dialog.close(target). This also works, it closes 
the dialog.


The problem is, when I open the same dialog again, all components 
inside are disabled! Why is this so? How can I close the dialog 
without getting all of its components disabled?


Regards,
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



Modal dialog's components get disabled after closing

2009-07-31 Thread Gajo Csaba

Hi,

I have a class which extends ModalWindow and has just one content panel 
inside. I've added several radio buttons and ajaxfallbackbuttons to it. 
When I display it with dialog.show(target) it shows without problem.


I also have a "Cancel" button in it, which is supposed to close the 
dialog. It's code is: dialog.close(target). This also works, it closes 
the dialog.


The problem is, when I open the same dialog again, all components inside 
are disabled! Why is this so? How can I close the dialog without getting 
all of its components disabled?


Regards,
Csaba



-
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 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) 


Re: Thanks Wicket-Team!

2009-07-30 Thread Gajo Csaba
Oliver, good website, I can see you've put a lot of work in it. Could 
you please make it work fully with Opera too? At one page I got a 
message telling me to come back with IE or Firefox. I think wicket works 
without problems on Opera 9...


Regards,
Csaba


okrohne wrote:

Hi Jeremy,

let me add that I had no web-framework/spring/html/js experience before,
so this is my first web application. In addition I have no swing background
which would have been helpful to better get started with the wicket
programming model.
This has definitly contributed to my learning curve. 


When I started to look at different frameworks, js-libs, etc. I often asked
myself how
to do it with wicket? Especially how to integrate json js libs, if I look at
the wicket examples:
no js in any markup file (but many js examples in the web are in html
files), 
yes everything is done from java, now I know and it is powerfull as I have

easy access to all my business objects, services etc. So customizing
existing wicket ajax
components or adding ajax to components was not so easy for me. 


Thanks,
Oliver


jthomerson wrote:
  

I'd be interested in knowing from your viewpoint what parts had a high
learning curve?  And what background are you coming from (that may
effect your individual curve)?  In my experience, Wicket has a MUCH
lower learning curve than Spring Web Flow and Tapestry (any
incarnation).  So, as someone who teaches Wicket, I'd be interested in
seeing what parts stumped you.

Good looking site by the way!

--
Jeremy Thomerson
http://www.wickettraining.com




On Wed, Jul 29, 2009 at 2:07 AM, okrohne wrote:


Hi José

just me as developer and my co-founder who did
the design.

Wicket has quite a high learning curve but after a while one can be so
productive
that is makes just fun :)

Thanks,
Oliver



José Antonio Matute wrote:
  

Wow Only four months?  How many developers?

I'm very impressed :)

Fantastic work 

Best regards
-Mensaje original-
De: Oliver Krohne [mailto:okro...@yahoo.de]
Enviado el: martes, 28 de julio de 2009 13:02
Para: users@wicket.apache.org
Asunto: Thanks Wicket-Team!

Hi,

Many thanks to the Wicket-Team for the great Framework and
of course for the support I have received from the mailinglist.

I started with zero-Wicket knowledge and now 4 month later
we have launched a new community website:

http://fytch.com

It is based on Wicket, Spring, OpenJPA, Lucene, PostgreSQL.

I would be glad if you try out Fytch and of course any feedback is
welcome.
Should I put Fytch on the wiki "Sites using Wicket"?

Thanks for the fabulous Wicket,
Oliver





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





--
View this message in context:
http://www.nabble.com/Thanks-Wicket-Team%21-tp24697082p24713643.html
Sent from the Wicket - User 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


  

-
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-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(St

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(Abs

Re: Beginner problems with TabbedPanel

2009-07-29 Thread Gajo Csaba
ilter(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)


getPage().addOrReplace(tabPanel); also generates some third error...

tabPanel.addOrReplace(tabPanel); generates an error saying I can't 
replace a component with itself :)


Writing the complete URL 
?wicket:interface=:2:innertabs:tabs-container:tabs:0:link:1:ILinkListener:: 
seems to be the only suggestion which actually works for now.






Martin Makundi wrote:

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

  



-
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 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



Beginner problems with TabbedPanel

2009-07-29 Thread 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