You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Ryan O'Hara <oh...@genome.chop.edu> on 2008/03/25 16:59:44 UTC
Tabs - hovering and clicking
Hey,
I'm new to Wicket. I'm trying to create a tabbed header, which will
load Tab classes when hovered. The tab classes are panels, as well.
I tried making hoverMenu a panel, but I was getting some errors about
it not finding markup. Any help would be greatly appreciated. Below
is a code snippet.
Thanks,
Ryan
public class TabbedHeader extends Panel {
private Label hoverMenu;
public TabbedHeader(final String panelId){
super(panelId);
hoverMenu = new Label("hoverMenu", new Model());
hoverMenu.setOutputMarkupId(true);
Link link = new Link("loginLink") {
public void onClick(){
setResponsePage(Login.class);
}
};
add(link);
link.add(new Label("login", "Login"));
link.add(new AjaxEventBehavior("onmouseover") {
protected void onEvent(AjaxRequestTarget target){
hoverMenu.setModelObject(LoginTab.class);
target.addComponent(hoverMenu);
}
});
//more tab links below
...
}
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Tabs - hovering and clicking
Posted by Igor Vaynberg <ig...@gmail.com>.
see how TabbedPanel works, what you are building is very similar to
that i think.
-igor
On Tue, Mar 25, 2008 at 10:20 AM, Ryan O'Hara <oh...@genome.chop.edu> wrote:
> Sorry, I should've been more clear. The code actually compiles and
> runs as is (with hoverMenu being of type Label, rather than Panel).
> When the links are hovered, "edu.chop.bic.cnv.ui.LoginTab" is
> displayed. The behavior I'm looking for is for the content of
> LoginTab to be displayed. This class extends Panel. If you need
> anything else, please let me know. Thanks again.
>
> Ryan
>
>
>
> On Mar 25, 2008, at 12:55 PM, Igor Vaynberg wrote:
>
> > seeing the actual stacktrace would be more helpful...
> >
> > -igor
> >
> >
> > On Tue, Mar 25, 2008 at 8:59 AM, Ryan O'Hara
> > <oh...@genome.chop.edu> wrote:
> >> Hey,
> >>
> >> I'm new to Wicket. I'm trying to create a tabbed header, which will
> >> load Tab classes when hovered. The tab classes are panels, as well.
> >> I tried making hoverMenu a panel, but I was getting some errors
> >> about
> >> it not finding markup. Any help would be greatly appreciated.
> >> Below
> >> is a code snippet.
> >>
> >> Thanks,
> >> Ryan
> >>
> >> public class TabbedHeader extends Panel {
> >> private Label hoverMenu;
> >>
> >> public TabbedHeader(final String panelId){
> >> super(panelId);
> >> hoverMenu = new Label("hoverMenu", new Model());
> >> hoverMenu.setOutputMarkupId(true);
> >>
> >> Link link = new Link("loginLink") {
> >> public void onClick(){
> >> setResponsePage(Login.class);
> >> }
> >> };
> >> add(link);
> >> link.add(new Label("login", "Login"));
> >> link.add(new AjaxEventBehavior("onmouseover") {
> >> protected void onEvent(AjaxRequestTarget target){
> >> hoverMenu.setModelObject(LoginTab.class);
> >> target.addComponent(hoverMenu);
> >> }
> >> });
> >>
> >> //more tab links below
> >> ...
> >> }
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> >> For additional commands, e-mail: users-help@wicket.apache.org
> >>
> >>
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > For additional commands, e-mail: users-help@wicket.apache.org
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Tabs - hovering and clicking
Posted by Ryan O'Hara <oh...@genome.chop.edu>.
Sorry, I should've been more clear. The code actually compiles and
runs as is (with hoverMenu being of type Label, rather than Panel).
When the links are hovered, "edu.chop.bic.cnv.ui.LoginTab" is
displayed. The behavior I'm looking for is for the content of
LoginTab to be displayed. This class extends Panel. If you need
anything else, please let me know. Thanks again.
Ryan
On Mar 25, 2008, at 12:55 PM, Igor Vaynberg wrote:
> seeing the actual stacktrace would be more helpful...
>
> -igor
>
>
> On Tue, Mar 25, 2008 at 8:59 AM, Ryan O'Hara
> <oh...@genome.chop.edu> wrote:
>> Hey,
>>
>> I'm new to Wicket. I'm trying to create a tabbed header, which will
>> load Tab classes when hovered. The tab classes are panels, as well.
>> I tried making hoverMenu a panel, but I was getting some errors
>> about
>> it not finding markup. Any help would be greatly appreciated.
>> Below
>> is a code snippet.
>>
>> Thanks,
>> Ryan
>>
>> public class TabbedHeader extends Panel {
>> private Label hoverMenu;
>>
>> public TabbedHeader(final String panelId){
>> super(panelId);
>> hoverMenu = new Label("hoverMenu", new Model());
>> hoverMenu.setOutputMarkupId(true);
>>
>> Link link = new Link("loginLink") {
>> public void onClick(){
>> setResponsePage(Login.class);
>> }
>> };
>> add(link);
>> link.add(new Label("login", "Login"));
>> link.add(new AjaxEventBehavior("onmouseover") {
>> protected void onEvent(AjaxRequestTarget target){
>> hoverMenu.setModelObject(LoginTab.class);
>> target.addComponent(hoverMenu);
>> }
>> });
>>
>> //more tab links below
>> ...
>> }
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Tabs - hovering and clicking
Posted by Igor Vaynberg <ig...@gmail.com>.
seeing the actual stacktrace would be more helpful...
-igor
On Tue, Mar 25, 2008 at 8:59 AM, Ryan O'Hara <oh...@genome.chop.edu> wrote:
> Hey,
>
> I'm new to Wicket. I'm trying to create a tabbed header, which will
> load Tab classes when hovered. The tab classes are panels, as well.
> I tried making hoverMenu a panel, but I was getting some errors about
> it not finding markup. Any help would be greatly appreciated. Below
> is a code snippet.
>
> Thanks,
> Ryan
>
> public class TabbedHeader extends Panel {
> private Label hoverMenu;
>
> public TabbedHeader(final String panelId){
> super(panelId);
> hoverMenu = new Label("hoverMenu", new Model());
> hoverMenu.setOutputMarkupId(true);
>
> Link link = new Link("loginLink") {
> public void onClick(){
> setResponsePage(Login.class);
> }
> };
> add(link);
> link.add(new Label("login", "Login"));
> link.add(new AjaxEventBehavior("onmouseover") {
> protected void onEvent(AjaxRequestTarget target){
> hoverMenu.setModelObject(LoginTab.class);
> target.addComponent(hoverMenu);
> }
> });
>
> //more tab links below
> ...
> }
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org