You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Alec Swan <al...@gmail.com> on 2010/06/14 03:54:18 UTC

How to implement tabs without using panels?

Hello,

I am working with a web designer who delivers a single HTML page which
should display a panel with arbitrary number of tabs. In the HTML the
tabbed panel consists of a <ul> list of links and the content of the
first tab. The content for the remaining tabs is loaded from the
database at runtime.

I know how to implement tabbing using tab swapping or TabbedPanel.
However, both of these approaches require a separate panel object and
markup for the tabs. Instead, I would like to be able to use the HTML
page I received from the designer unmodified.

Is there a way to create a WebMarkupContainerWithAssociatedMarkup
object which is mapped to a specific element on the page markup? If
so, can I implement tabbing by swapping such objects when tabs are
clicked?

Any ideas would be appreciated.

Thanks

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


Re: How to implement tabs without using panels?

Posted by Pedro Santos <pe...@gmail.com>.
> 1. Is it OK to create multiple Fragment objects for the same markup
fragment?
yes, the relation is: 1 "markup fragment", 1 "fragment type", n "fragment
objects"

> 2. Is it possible to nest Fragments so that I can support multiple
> levels of tabs?
yes, the Fragment extends from Component, and as an Component, it can to be
placed where you want.

On Mon, Jun 14, 2010 at 4:35 PM, Alec Swan <al...@gmail.com> wrote:

> Hello Pedro,
>
> I am not sure what you mean by "wrapped panels", but I am planning to
> have a l<ul/> list and single fragment with wicket:id="tabTemplate"
> on my page.
>
> When the user accesses the page the first time, the Page code will
> populate the list and display the first tab with the content pulled
> from the database. The code will also keep a reference to that
> fragment object.
>
> When the user selects a different tab, the code will create a new
> fragment and will swap it with the one from the previous step.
>
> The two issues that I am concerned about are:
> 1. Is it OK to create multiple Fragment objects for the same markup
> fragment?
> 2. Is it possible to nest Fragments so that I can support multiple
> levels of tabs?
>
> Thanks,
>
> Alec
>
> On Mon, Jun 14, 2010 at 11:17 AM, Pedro Santos <pe...@gmail.com>
> wrote:
> > wicket:container are meant to don't output invalid markup when using
> > repeaters. You can use AjaxTabbedPanel to implement your tabbed panel,
> and
> > ITab for the complexity of swap your tabs contents...
> > In my last mail I said that is preferably to have you logic that use
> > database info to assemble your tabbed panel in an Wicket component,
> rather
> > than in javascript.
> >
> > About create an new component TabbedContents, I exaggerated. There is no
> > good reason to create an new type and api for that. If the component
> initial
> > component design don't solve all user cases, we can always write
> > customizations. Do you considered to use an wrapper panels for your
> > fragments, your write panels for them?
> >
> > On Mon, Jun 14, 2010 at 1:39 PM, Alec Swan <al...@gmail.com> wrote:
> >
> >> Pedro, could you clarify your last message?
> >>
> >> I also came across wicket:container. I don't think it is possible to
> >> swap container components at runtime because they don't have HTML ids
> >> and hence cannot be reference via AJAX. Is that right?
> >>
> >> Thanks
> >>
> >> On Mon, Jun 14, 2010 at 10:11 AM, Pedro Santos <pe...@gmail.com>
> >> wrote:
> >> > "I am working with a web designer who delivers a single HTML page
> which
> >> > should display a panel with  tabs."
> >> > Simply use javascript
> >> >
> >> > With "arbitrary number of", " loaded from the database at runtime"
> >> > Is preferable to implement an component at server side with the tabs
> >> > assemble and presentation rules.
> >> >
> >> > On Mon, Jun 14, 2010 at 12:16 PM, Igor Vaynberg <
> igor.vaynberg@gmail.com
> >> >wrote:
> >> >
> >> >> you can simply use javascript tabs. all js frameworks provide them.
> >> >>
> >> >> -igor
> >> >>
> >> >> On Sun, Jun 13, 2010 at 6:54 PM, Alec Swan <al...@gmail.com>
> wrote:
> >> >> > Hello,
> >> >> >
> >> >> > I am working with a web designer who delivers a single HTML page
> which
> >> >> > should display a panel with arbitrary number of tabs. In the HTML
> the
> >> >> > tabbed panel consists of a <ul> list of links and the content of
> the
> >> >> > first tab. The content for the remaining tabs is loaded from the
> >> >> > database at runtime.
> >> >> >
> >> >> > I know how to implement tabbing using tab swapping or TabbedPanel.
> >> >> > However, both of these approaches require a separate panel object
> and
> >> >> > markup for the tabs. Instead, I would like to be able to use the
> HTML
> >> >> > page I received from the designer unmodified.
> >> >> >
> >> >> > Is there a way to create a WebMarkupContainerWithAssociatedMarkup
> >> >> > object which is mapped to a specific element on the page markup? If
> >> >> > so, can I implement tabbing by swapping such objects when tabs are
> >> >> > clicked?
> >> >> >
> >> >> > Any ideas would be appreciated.
> >> >> >
> >> >> > Thanks
> >> >> >
> >> >> >
> ---------------------------------------------------------------------
> >> >> > 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
> >> >>
> >> >>
> >> >
> >> >
> >> > --
> >> > Pedro Henrique Oliveira dos Santos
> >> >
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> >> For additional commands, e-mail: users-help@wicket.apache.org
> >>
> >>
> >
> >
> > --
> > Pedro Henrique Oliveira dos Santos
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>


-- 
Pedro Henrique Oliveira dos Santos

Re: How to implement tabs without using panels?

Posted by Alec Swan <al...@gmail.com>.
Hello Pedro,

I am not sure what you mean by "wrapped panels", but I am planning to
have a l<ul/> list and single fragment with wicket:id="tabTemplate"
on my page.

When the user accesses the page the first time, the Page code will
populate the list and display the first tab with the content pulled
from the database. The code will also keep a reference to that
fragment object.

When the user selects a different tab, the code will create a new
fragment and will swap it with the one from the previous step.

The two issues that I am concerned about are:
1. Is it OK to create multiple Fragment objects for the same markup fragment?
2. Is it possible to nest Fragments so that I can support multiple
levels of tabs?

Thanks,

Alec

On Mon, Jun 14, 2010 at 11:17 AM, Pedro Santos <pe...@gmail.com> wrote:
> wicket:container are meant to don't output invalid markup when using
> repeaters. You can use AjaxTabbedPanel to implement your tabbed panel, and
> ITab for the complexity of swap your tabs contents...
> In my last mail I said that is preferably to have you logic that use
> database info to assemble your tabbed panel in an Wicket component, rather
> than in javascript.
>
> About create an new component TabbedContents, I exaggerated. There is no
> good reason to create an new type and api for that. If the component initial
> component design don't solve all user cases, we can always write
> customizations. Do you considered to use an wrapper panels for your
> fragments, your write panels for them?
>
> On Mon, Jun 14, 2010 at 1:39 PM, Alec Swan <al...@gmail.com> wrote:
>
>> Pedro, could you clarify your last message?
>>
>> I also came across wicket:container. I don't think it is possible to
>> swap container components at runtime because they don't have HTML ids
>> and hence cannot be reference via AJAX. Is that right?
>>
>> Thanks
>>
>> On Mon, Jun 14, 2010 at 10:11 AM, Pedro Santos <pe...@gmail.com>
>> wrote:
>> > "I am working with a web designer who delivers a single HTML page which
>> > should display a panel with  tabs."
>> > Simply use javascript
>> >
>> > With "arbitrary number of", " loaded from the database at runtime"
>> > Is preferable to implement an component at server side with the tabs
>> > assemble and presentation rules.
>> >
>> > On Mon, Jun 14, 2010 at 12:16 PM, Igor Vaynberg <igor.vaynberg@gmail.com
>> >wrote:
>> >
>> >> you can simply use javascript tabs. all js frameworks provide them.
>> >>
>> >> -igor
>> >>
>> >> On Sun, Jun 13, 2010 at 6:54 PM, Alec Swan <al...@gmail.com> wrote:
>> >> > Hello,
>> >> >
>> >> > I am working with a web designer who delivers a single HTML page which
>> >> > should display a panel with arbitrary number of tabs. In the HTML the
>> >> > tabbed panel consists of a <ul> list of links and the content of the
>> >> > first tab. The content for the remaining tabs is loaded from the
>> >> > database at runtime.
>> >> >
>> >> > I know how to implement tabbing using tab swapping or TabbedPanel.
>> >> > However, both of these approaches require a separate panel object and
>> >> > markup for the tabs. Instead, I would like to be able to use the HTML
>> >> > page I received from the designer unmodified.
>> >> >
>> >> > Is there a way to create a WebMarkupContainerWithAssociatedMarkup
>> >> > object which is mapped to a specific element on the page markup? If
>> >> > so, can I implement tabbing by swapping such objects when tabs are
>> >> > clicked?
>> >> >
>> >> > Any ideas would be appreciated.
>> >> >
>> >> > Thanks
>> >> >
>> >> > ---------------------------------------------------------------------
>> >> > 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
>> >>
>> >>
>> >
>> >
>> > --
>> > Pedro Henrique Oliveira dos Santos
>> >
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>
>
> --
> Pedro Henrique Oliveira dos Santos
>

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


Re: How to implement tabs without using panels?

Posted by Pedro Santos <pe...@gmail.com>.
wicket:container are meant to don't output invalid markup when using
repeaters. You can use AjaxTabbedPanel to implement your tabbed panel, and
ITab for the complexity of swap your tabs contents...
In my last mail I said that is preferably to have you logic that use
database info to assemble your tabbed panel in an Wicket component, rather
than in javascript.

About create an new component TabbedContents, I exaggerated. There is no
good reason to create an new type and api for that. If the component initial
component design don't solve all user cases, we can always write
customizations. Do you considered to use an wrapper panels for your
fragments, your write panels for them?

On Mon, Jun 14, 2010 at 1:39 PM, Alec Swan <al...@gmail.com> wrote:

> Pedro, could you clarify your last message?
>
> I also came across wicket:container. I don't think it is possible to
> swap container components at runtime because they don't have HTML ids
> and hence cannot be reference via AJAX. Is that right?
>
> Thanks
>
> On Mon, Jun 14, 2010 at 10:11 AM, Pedro Santos <pe...@gmail.com>
> wrote:
> > "I am working with a web designer who delivers a single HTML page which
> > should display a panel with  tabs."
> > Simply use javascript
> >
> > With "arbitrary number of", " loaded from the database at runtime"
> > Is preferable to implement an component at server side with the tabs
> > assemble and presentation rules.
> >
> > On Mon, Jun 14, 2010 at 12:16 PM, Igor Vaynberg <igor.vaynberg@gmail.com
> >wrote:
> >
> >> you can simply use javascript tabs. all js frameworks provide them.
> >>
> >> -igor
> >>
> >> On Sun, Jun 13, 2010 at 6:54 PM, Alec Swan <al...@gmail.com> wrote:
> >> > Hello,
> >> >
> >> > I am working with a web designer who delivers a single HTML page which
> >> > should display a panel with arbitrary number of tabs. In the HTML the
> >> > tabbed panel consists of a <ul> list of links and the content of the
> >> > first tab. The content for the remaining tabs is loaded from the
> >> > database at runtime.
> >> >
> >> > I know how to implement tabbing using tab swapping or TabbedPanel.
> >> > However, both of these approaches require a separate panel object and
> >> > markup for the tabs. Instead, I would like to be able to use the HTML
> >> > page I received from the designer unmodified.
> >> >
> >> > Is there a way to create a WebMarkupContainerWithAssociatedMarkup
> >> > object which is mapped to a specific element on the page markup? If
> >> > so, can I implement tabbing by swapping such objects when tabs are
> >> > clicked?
> >> >
> >> > Any ideas would be appreciated.
> >> >
> >> > Thanks
> >> >
> >> > ---------------------------------------------------------------------
> >> > 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
> >>
> >>
> >
> >
> > --
> > Pedro Henrique Oliveira dos Santos
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>


-- 
Pedro Henrique Oliveira dos Santos

Re: How to implement tabs without using panels?

Posted by Alec Swan <al...@gmail.com>.
Pedro, could you clarify your last message?

I also came across wicket:container. I don't think it is possible to
swap container components at runtime because they don't have HTML ids
and hence cannot be reference via AJAX. Is that right?

Thanks

On Mon, Jun 14, 2010 at 10:11 AM, Pedro Santos <pe...@gmail.com> wrote:
> "I am working with a web designer who delivers a single HTML page which
> should display a panel with  tabs."
> Simply use javascript
>
> With "arbitrary number of", " loaded from the database at runtime"
> Is preferable to implement an component at server side with the tabs
> assemble and presentation rules.
>
> On Mon, Jun 14, 2010 at 12:16 PM, Igor Vaynberg <ig...@gmail.com>wrote:
>
>> you can simply use javascript tabs. all js frameworks provide them.
>>
>> -igor
>>
>> On Sun, Jun 13, 2010 at 6:54 PM, Alec Swan <al...@gmail.com> wrote:
>> > Hello,
>> >
>> > I am working with a web designer who delivers a single HTML page which
>> > should display a panel with arbitrary number of tabs. In the HTML the
>> > tabbed panel consists of a <ul> list of links and the content of the
>> > first tab. The content for the remaining tabs is loaded from the
>> > database at runtime.
>> >
>> > I know how to implement tabbing using tab swapping or TabbedPanel.
>> > However, both of these approaches require a separate panel object and
>> > markup for the tabs. Instead, I would like to be able to use the HTML
>> > page I received from the designer unmodified.
>> >
>> > Is there a way to create a WebMarkupContainerWithAssociatedMarkup
>> > object which is mapped to a specific element on the page markup? If
>> > so, can I implement tabbing by swapping such objects when tabs are
>> > clicked?
>> >
>> > Any ideas would be appreciated.
>> >
>> > Thanks
>> >
>> > ---------------------------------------------------------------------
>> > 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
>>
>>
>
>
> --
> Pedro Henrique Oliveira dos Santos
>

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


Re: How to implement tabs without using panels?

Posted by Pedro Santos <pe...@gmail.com>.
"I am working with a web designer who delivers a single HTML page which
should display a panel with  tabs."
Simply use javascript

With "arbitrary number of", " loaded from the database at runtime"
Is preferable to implement an component at server side with the tabs
assemble and presentation rules.

On Mon, Jun 14, 2010 at 12:16 PM, Igor Vaynberg <ig...@gmail.com>wrote:

> you can simply use javascript tabs. all js frameworks provide them.
>
> -igor
>
> On Sun, Jun 13, 2010 at 6:54 PM, Alec Swan <al...@gmail.com> wrote:
> > Hello,
> >
> > I am working with a web designer who delivers a single HTML page which
> > should display a panel with arbitrary number of tabs. In the HTML the
> > tabbed panel consists of a <ul> list of links and the content of the
> > first tab. The content for the remaining tabs is loaded from the
> > database at runtime.
> >
> > I know how to implement tabbing using tab swapping or TabbedPanel.
> > However, both of these approaches require a separate panel object and
> > markup for the tabs. Instead, I would like to be able to use the HTML
> > page I received from the designer unmodified.
> >
> > Is there a way to create a WebMarkupContainerWithAssociatedMarkup
> > object which is mapped to a specific element on the page markup? If
> > so, can I implement tabbing by swapping such objects when tabs are
> > clicked?
> >
> > Any ideas would be appreciated.
> >
> > Thanks
> >
> > ---------------------------------------------------------------------
> > 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
>
>


-- 
Pedro Henrique Oliveira dos Santos

Re: How to implement tabs without using panels?

Posted by Igor Vaynberg <ig...@gmail.com>.
you can simply use javascript tabs. all js frameworks provide them.

-igor

On Sun, Jun 13, 2010 at 6:54 PM, Alec Swan <al...@gmail.com> wrote:
> Hello,
>
> I am working with a web designer who delivers a single HTML page which
> should display a panel with arbitrary number of tabs. In the HTML the
> tabbed panel consists of a <ul> list of links and the content of the
> first tab. The content for the remaining tabs is loaded from the
> database at runtime.
>
> I know how to implement tabbing using tab swapping or TabbedPanel.
> However, both of these approaches require a separate panel object and
> markup for the tabs. Instead, I would like to be able to use the HTML
> page I received from the designer unmodified.
>
> Is there a way to create a WebMarkupContainerWithAssociatedMarkup
> object which is mapped to a specific element on the page markup? If
> so, can I implement tabbing by swapping such objects when tabs are
> clicked?
>
> Any ideas would be appreciated.
>
> Thanks
>
> ---------------------------------------------------------------------
> 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: How to implement tabs without using panels?

Posted by Jeremy Thomerson <je...@wickettraining.com>.
Then use fragments.  I must not be understanding what you actually want to
do or why you're so afraid to break up separate things into separate markup.

On Mon, Jun 14, 2010 at 12:02 AM, Alec Swan <al...@gmail.com> wrote:

> Hello,
>
> If I understood your suggestion correctly it involves to markup files:
> one - for the content area and another one - for the tab content.
> However, I would like to use a single markup file for the entire page.
>
> Did I understand your solution correctly?
>
> Thanks
>
> On Sun, Jun 13, 2010 at 8:04 PM, Jeremy Thomerson
> <je...@wickettraining.com> wrote:
> > On Sun, Jun 13, 2010 at 8:54 PM, Alec Swan <al...@gmail.com> wrote:
> >
> >> Hello,
> >>
> >> I am working with a web designer who delivers a single HTML page which
> >> should display a panel with arbitrary number of tabs. In the HTML the
> >> tabbed panel consists of a <ul> list of links and the content of the
> >> first tab. The content for the remaining tabs is loaded from the
> >> database at runtime.
> >>
> >> I know how to implement tabbing using tab swapping or TabbedPanel.
> >> However, both of these approaches require a separate panel object and
> >> markup for the tabs. Instead, I would like to be able to use the HTML
> >> page I received from the designer unmodified.
> >>
> >> Is there a way to create a WebMarkupContainerWithAssociatedMarkup
> >> object which is mapped to a specific element on the page markup? If
> >> so, can I implement tabbing by swapping such objects when tabs are
> >> clicked?
> >>
> >> Any ideas would be appreciated.
> >>
> >> Thanks
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> >> For additional commands, e-mail: users-help@wicket.apache.org
> >>
> >>
> > Just make the content area a panel, add links to each of the tabs, and in
> > the onClick, call replace(...) with the panel that contains the content
> for
> > that tab.  This will make each content area (for each tab) into a panel,
> but
> > you will not have to modify the markup of the tabs themselves.
> >
> > --
> > Jeremy Thomerson
> > http://www.wickettraining.com
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>


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

Re: How to implement tabs without using panels?

Posted by Jeremy Thomerson <je...@wickettraining.com>.
Then use fragments.  I must not be understanding what you actually want to
do or why you're so afraid to break up separate things into separate markup.

On Mon, Jun 14, 2010 at 12:02 AM, Alec Swan <al...@gmail.com> wrote:

> Hello,
>
> If I understood your suggestion correctly it involves to markup files:
> one - for the content area and another one - for the tab content.
> However, I would like to use a single markup file for the entire page.
>
> Did I understand your solution correctly?
>
> Thanks
>
> On Sun, Jun 13, 2010 at 8:04 PM, Jeremy Thomerson
> <je...@wickettraining.com> wrote:
> > On Sun, Jun 13, 2010 at 8:54 PM, Alec Swan <al...@gmail.com> wrote:
> >
> >> Hello,
> >>
> >> I am working with a web designer who delivers a single HTML page which
> >> should display a panel with arbitrary number of tabs. In the HTML the
> >> tabbed panel consists of a <ul> list of links and the content of the
> >> first tab. The content for the remaining tabs is loaded from the
> >> database at runtime.
> >>
> >> I know how to implement tabbing using tab swapping or TabbedPanel.
> >> However, both of these approaches require a separate panel object and
> >> markup for the tabs. Instead, I would like to be able to use the HTML
> >> page I received from the designer unmodified.
> >>
> >> Is there a way to create a WebMarkupContainerWithAssociatedMarkup
> >> object which is mapped to a specific element on the page markup? If
> >> so, can I implement tabbing by swapping such objects when tabs are
> >> clicked?
> >>
> >> Any ideas would be appreciated.
> >>
> >> Thanks
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> >> For additional commands, e-mail: users-help@wicket.apache.org
> >>
> >>
> > Just make the content area a panel, add links to each of the tabs, and in
> > the onClick, call replace(...) with the panel that contains the content
> for
> > that tab.  This will make each content area (for each tab) into a panel,
> but
> > you will not have to modify the markup of the tabs themselves.
> >
> > --
> > Jeremy Thomerson
> > http://www.wickettraining.com
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>


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

Re: How to implement tabs without using panels?

Posted by Igor Vaynberg <ig...@gmail.com>.
yep, javascript tabs do that...

-igor

On Mon, Jun 14, 2010 at 8:29 AM, Alec Swan <al...@gmail.com> wrote:
> Pedro, I agree that ITab.getPanel() could just return Component type.
>
> Jeremy and Igor, the goal of the project is to automatically generate
> tabs given tab markup template and a database which provides content
> for all tabs. Note that the number of tabs can vary depending on the
> database state.
>
> It seems to me that automating this by switching tab components in
> Wicket is easier than using JavaScript because in Wicket we have
> direct access to the database and can decide right then how many tabs
> need to be created.
>
> I am planning to try creating and swapping multiple Fragment objects
> mapped to the same fragment markup (wicket:id="tabTemplateFragment").
> Please let me know if there is a reason not to do this.
>
> Thanks
>
> On Mon, Jun 14, 2010 at 8:26 AM, Pedro Santos <pe...@gmail.com> wrote:
>> Hi Alec, you can create an wrapper panel, that receive as parameter an
>> component, in your case an fragment, to use in your tabbed panel. Actually I
>> think that will to be more natural if the ITab interface had an getTab
>> method, that return an Component object instead of the getPanel one, since
>> there is no good reason to force users to have the tab content implemented
>> as an Panel. If some one else think this way, I can open on request for.
>> I know that the component name is TabbedPANEL, which implies that it work
>> with panels... So it can to be an reason to create another component?
>> TabbedContents?
>>
>> Ex:
>> public WrapperPanel extends Panel{
>>  public static String WICKET_ID_FOR_WRAPPED_COM ="component";
>>  public WrapperPanel (wrappedComponent){
>>     add(wrappedComponent);
>>  }
>> }
>>
>> On Mon, Jun 14, 2010 at 2:14 AM, Alec Swan <al...@gmail.com> wrote:
>>
>>> I wonder if I can use Wicket fragments for this. My page markup will
>>> contain a single fragment for the tab content. At runtime I will
>>> create multiple Fragment objects - one for each tab, each of which
>>> will be mapped to the same fragment section in the markup file. After
>>> this I can just swap tab fragments when tabs are selected.
>>>
>>> I am not sure if it's legal to create multiple Fragment objects that
>>> use the same fragment markup. Any thoughts?
>>>
>>> Thanks
>>>
>>> On Sun, Jun 13, 2010 at 11:02 PM, Alec Swan <al...@gmail.com> wrote:
>>> > Hello,
>>> >
>>> > If I understood your suggestion correctly it involves to markup files:
>>> > one - for the content area and another one - for the tab content.
>>> > However, I would like to use a single markup file for the entire page.
>>> >
>>> > Did I understand your solution correctly?
>>> >
>>> > Thanks
>>> >
>>> > On Sun, Jun 13, 2010 at 8:04 PM, Jeremy Thomerson
>>> > <je...@wickettraining.com> wrote:
>>> >> On Sun, Jun 13, 2010 at 8:54 PM, Alec Swan <al...@gmail.com> wrote:
>>> >>
>>> >>> Hello,
>>> >>>
>>> >>> I am working with a web designer who delivers a single HTML page which
>>> >>> should display a panel with arbitrary number of tabs. In the HTML the
>>> >>> tabbed panel consists of a <ul> list of links and the content of the
>>> >>> first tab. The content for the remaining tabs is loaded from the
>>> >>> database at runtime.
>>> >>>
>>> >>> I know how to implement tabbing using tab swapping or TabbedPanel.
>>> >>> However, both of these approaches require a separate panel object and
>>> >>> markup for the tabs. Instead, I would like to be able to use the HTML
>>> >>> page I received from the designer unmodified.
>>> >>>
>>> >>> Is there a way to create a WebMarkupContainerWithAssociatedMarkup
>>> >>> object which is mapped to a specific element on the page markup? If
>>> >>> so, can I implement tabbing by swapping such objects when tabs are
>>> >>> clicked?
>>> >>>
>>> >>> Any ideas would be appreciated.
>>> >>>
>>> >>> Thanks
>>> >>>
>>> >>> ---------------------------------------------------------------------
>>> >>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>> >>> For additional commands, e-mail: users-help@wicket.apache.org
>>> >>>
>>> >>>
>>> >> Just make the content area a panel, add links to each of the tabs, and
>>> in
>>> >> the onClick, call replace(...) with the panel that contains the content
>>> for
>>> >> that tab.  This will make each content area (for each tab) into a panel,
>>> but
>>> >> you will not have to modify the markup of the tabs themselves.
>>> >>
>>> >> --
>>> >> Jeremy Thomerson
>>> >> http://www.wickettraining.com
>>> >>
>>> >
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>
>>>
>>
>>
>> --
>> Pedro Henrique Oliveira dos Santos
>>
>
> ---------------------------------------------------------------------
> 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: How to implement tabs without using panels?

Posted by Alec Swan <al...@gmail.com>.
Pedro, I agree that ITab.getPanel() could just return Component type.

Jeremy and Igor, the goal of the project is to automatically generate
tabs given tab markup template and a database which provides content
for all tabs. Note that the number of tabs can vary depending on the
database state.

It seems to me that automating this by switching tab components in
Wicket is easier than using JavaScript because in Wicket we have
direct access to the database and can decide right then how many tabs
need to be created.

I am planning to try creating and swapping multiple Fragment objects
mapped to the same fragment markup (wicket:id="tabTemplateFragment").
Please let me know if there is a reason not to do this.

Thanks

On Mon, Jun 14, 2010 at 8:26 AM, Pedro Santos <pe...@gmail.com> wrote:
> Hi Alec, you can create an wrapper panel, that receive as parameter an
> component, in your case an fragment, to use in your tabbed panel. Actually I
> think that will to be more natural if the ITab interface had an getTab
> method, that return an Component object instead of the getPanel one, since
> there is no good reason to force users to have the tab content implemented
> as an Panel. If some one else think this way, I can open on request for.
> I know that the component name is TabbedPANEL, which implies that it work
> with panels... So it can to be an reason to create another component?
> TabbedContents?
>
> Ex:
> public WrapperPanel extends Panel{
>  public static String WICKET_ID_FOR_WRAPPED_COM ="component";
>  public WrapperPanel (wrappedComponent){
>     add(wrappedComponent);
>  }
> }
>
> On Mon, Jun 14, 2010 at 2:14 AM, Alec Swan <al...@gmail.com> wrote:
>
>> I wonder if I can use Wicket fragments for this. My page markup will
>> contain a single fragment for the tab content. At runtime I will
>> create multiple Fragment objects - one for each tab, each of which
>> will be mapped to the same fragment section in the markup file. After
>> this I can just swap tab fragments when tabs are selected.
>>
>> I am not sure if it's legal to create multiple Fragment objects that
>> use the same fragment markup. Any thoughts?
>>
>> Thanks
>>
>> On Sun, Jun 13, 2010 at 11:02 PM, Alec Swan <al...@gmail.com> wrote:
>> > Hello,
>> >
>> > If I understood your suggestion correctly it involves to markup files:
>> > one - for the content area and another one - for the tab content.
>> > However, I would like to use a single markup file for the entire page.
>> >
>> > Did I understand your solution correctly?
>> >
>> > Thanks
>> >
>> > On Sun, Jun 13, 2010 at 8:04 PM, Jeremy Thomerson
>> > <je...@wickettraining.com> wrote:
>> >> On Sun, Jun 13, 2010 at 8:54 PM, Alec Swan <al...@gmail.com> wrote:
>> >>
>> >>> Hello,
>> >>>
>> >>> I am working with a web designer who delivers a single HTML page which
>> >>> should display a panel with arbitrary number of tabs. In the HTML the
>> >>> tabbed panel consists of a <ul> list of links and the content of the
>> >>> first tab. The content for the remaining tabs is loaded from the
>> >>> database at runtime.
>> >>>
>> >>> I know how to implement tabbing using tab swapping or TabbedPanel.
>> >>> However, both of these approaches require a separate panel object and
>> >>> markup for the tabs. Instead, I would like to be able to use the HTML
>> >>> page I received from the designer unmodified.
>> >>>
>> >>> Is there a way to create a WebMarkupContainerWithAssociatedMarkup
>> >>> object which is mapped to a specific element on the page markup? If
>> >>> so, can I implement tabbing by swapping such objects when tabs are
>> >>> clicked?
>> >>>
>> >>> Any ideas would be appreciated.
>> >>>
>> >>> Thanks
>> >>>
>> >>> ---------------------------------------------------------------------
>> >>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> >>> For additional commands, e-mail: users-help@wicket.apache.org
>> >>>
>> >>>
>> >> Just make the content area a panel, add links to each of the tabs, and
>> in
>> >> the onClick, call replace(...) with the panel that contains the content
>> for
>> >> that tab.  This will make each content area (for each tab) into a panel,
>> but
>> >> you will not have to modify the markup of the tabs themselves.
>> >>
>> >> --
>> >> Jeremy Thomerson
>> >> http://www.wickettraining.com
>> >>
>> >
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>
>
> --
> Pedro Henrique Oliveira dos Santos
>

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


Re: How to implement tabs without using panels?

Posted by Pedro Santos <pe...@gmail.com>.
Hi Alec, you can create an wrapper panel, that receive as parameter an
component, in your case an fragment, to use in your tabbed panel. Actually I
think that will to be more natural if the ITab interface had an getTab
method, that return an Component object instead of the getPanel one, since
there is no good reason to force users to have the tab content implemented
as an Panel. If some one else think this way, I can open on request for.
I know that the component name is TabbedPANEL, which implies that it work
with panels... So it can to be an reason to create another component?
TabbedContents?

Ex:
public WrapperPanel extends Panel{
  public static String WICKET_ID_FOR_WRAPPED_COM ="component";
  public WrapperPanel (wrappedComponent){
     add(wrappedComponent);
  }
}

On Mon, Jun 14, 2010 at 2:14 AM, Alec Swan <al...@gmail.com> wrote:

> I wonder if I can use Wicket fragments for this. My page markup will
> contain a single fragment for the tab content. At runtime I will
> create multiple Fragment objects - one for each tab, each of which
> will be mapped to the same fragment section in the markup file. After
> this I can just swap tab fragments when tabs are selected.
>
> I am not sure if it's legal to create multiple Fragment objects that
> use the same fragment markup. Any thoughts?
>
> Thanks
>
> On Sun, Jun 13, 2010 at 11:02 PM, Alec Swan <al...@gmail.com> wrote:
> > Hello,
> >
> > If I understood your suggestion correctly it involves to markup files:
> > one - for the content area and another one - for the tab content.
> > However, I would like to use a single markup file for the entire page.
> >
> > Did I understand your solution correctly?
> >
> > Thanks
> >
> > On Sun, Jun 13, 2010 at 8:04 PM, Jeremy Thomerson
> > <je...@wickettraining.com> wrote:
> >> On Sun, Jun 13, 2010 at 8:54 PM, Alec Swan <al...@gmail.com> wrote:
> >>
> >>> Hello,
> >>>
> >>> I am working with a web designer who delivers a single HTML page which
> >>> should display a panel with arbitrary number of tabs. In the HTML the
> >>> tabbed panel consists of a <ul> list of links and the content of the
> >>> first tab. The content for the remaining tabs is loaded from the
> >>> database at runtime.
> >>>
> >>> I know how to implement tabbing using tab swapping or TabbedPanel.
> >>> However, both of these approaches require a separate panel object and
> >>> markup for the tabs. Instead, I would like to be able to use the HTML
> >>> page I received from the designer unmodified.
> >>>
> >>> Is there a way to create a WebMarkupContainerWithAssociatedMarkup
> >>> object which is mapped to a specific element on the page markup? If
> >>> so, can I implement tabbing by swapping such objects when tabs are
> >>> clicked?
> >>>
> >>> Any ideas would be appreciated.
> >>>
> >>> Thanks
> >>>
> >>> ---------------------------------------------------------------------
> >>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> >>> For additional commands, e-mail: users-help@wicket.apache.org
> >>>
> >>>
> >> Just make the content area a panel, add links to each of the tabs, and
> in
> >> the onClick, call replace(...) with the panel that contains the content
> for
> >> that tab.  This will make each content area (for each tab) into a panel,
> but
> >> you will not have to modify the markup of the tabs themselves.
> >>
> >> --
> >> Jeremy Thomerson
> >> http://www.wickettraining.com
> >>
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>


-- 
Pedro Henrique Oliveira dos Santos

Re: How to implement tabs without using panels?

Posted by Alec Swan <al...@gmail.com>.
I wonder if I can use Wicket fragments for this. My page markup will
contain a single fragment for the tab content. At runtime I will
create multiple Fragment objects - one for each tab, each of which
will be mapped to the same fragment section in the markup file. After
this I can just swap tab fragments when tabs are selected.

I am not sure if it's legal to create multiple Fragment objects that
use the same fragment markup. Any thoughts?

Thanks

On Sun, Jun 13, 2010 at 11:02 PM, Alec Swan <al...@gmail.com> wrote:
> Hello,
>
> If I understood your suggestion correctly it involves to markup files:
> one - for the content area and another one - for the tab content.
> However, I would like to use a single markup file for the entire page.
>
> Did I understand your solution correctly?
>
> Thanks
>
> On Sun, Jun 13, 2010 at 8:04 PM, Jeremy Thomerson
> <je...@wickettraining.com> wrote:
>> On Sun, Jun 13, 2010 at 8:54 PM, Alec Swan <al...@gmail.com> wrote:
>>
>>> Hello,
>>>
>>> I am working with a web designer who delivers a single HTML page which
>>> should display a panel with arbitrary number of tabs. In the HTML the
>>> tabbed panel consists of a <ul> list of links and the content of the
>>> first tab. The content for the remaining tabs is loaded from the
>>> database at runtime.
>>>
>>> I know how to implement tabbing using tab swapping or TabbedPanel.
>>> However, both of these approaches require a separate panel object and
>>> markup for the tabs. Instead, I would like to be able to use the HTML
>>> page I received from the designer unmodified.
>>>
>>> Is there a way to create a WebMarkupContainerWithAssociatedMarkup
>>> object which is mapped to a specific element on the page markup? If
>>> so, can I implement tabbing by swapping such objects when tabs are
>>> clicked?
>>>
>>> Any ideas would be appreciated.
>>>
>>> Thanks
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>
>>>
>> Just make the content area a panel, add links to each of the tabs, and in
>> the onClick, call replace(...) with the panel that contains the content for
>> that tab.  This will make each content area (for each tab) into a panel, but
>> you will not have to modify the markup of the tabs themselves.
>>
>> --
>> Jeremy Thomerson
>> http://www.wickettraining.com
>>
>

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


Re: How to implement tabs without using panels?

Posted by Alec Swan <al...@gmail.com>.
Hello,

If I understood your suggestion correctly it involves to markup files:
one - for the content area and another one - for the tab content.
However, I would like to use a single markup file for the entire page.

Did I understand your solution correctly?

Thanks

On Sun, Jun 13, 2010 at 8:04 PM, Jeremy Thomerson
<je...@wickettraining.com> wrote:
> On Sun, Jun 13, 2010 at 8:54 PM, Alec Swan <al...@gmail.com> wrote:
>
>> Hello,
>>
>> I am working with a web designer who delivers a single HTML page which
>> should display a panel with arbitrary number of tabs. In the HTML the
>> tabbed panel consists of a <ul> list of links and the content of the
>> first tab. The content for the remaining tabs is loaded from the
>> database at runtime.
>>
>> I know how to implement tabbing using tab swapping or TabbedPanel.
>> However, both of these approaches require a separate panel object and
>> markup for the tabs. Instead, I would like to be able to use the HTML
>> page I received from the designer unmodified.
>>
>> Is there a way to create a WebMarkupContainerWithAssociatedMarkup
>> object which is mapped to a specific element on the page markup? If
>> so, can I implement tabbing by swapping such objects when tabs are
>> clicked?
>>
>> Any ideas would be appreciated.
>>
>> Thanks
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
> Just make the content area a panel, add links to each of the tabs, and in
> the onClick, call replace(...) with the panel that contains the content for
> that tab.  This will make each content area (for each tab) into a panel, but
> you will not have to modify the markup of the tabs themselves.
>
> --
> Jeremy Thomerson
> http://www.wickettraining.com
>

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


Re: How to implement tabs without using panels?

Posted by Jeremy Thomerson <je...@wickettraining.com>.
On Sun, Jun 13, 2010 at 8:54 PM, Alec Swan <al...@gmail.com> wrote:

> Hello,
>
> I am working with a web designer who delivers a single HTML page which
> should display a panel with arbitrary number of tabs. In the HTML the
> tabbed panel consists of a <ul> list of links and the content of the
> first tab. The content for the remaining tabs is loaded from the
> database at runtime.
>
> I know how to implement tabbing using tab swapping or TabbedPanel.
> However, both of these approaches require a separate panel object and
> markup for the tabs. Instead, I would like to be able to use the HTML
> page I received from the designer unmodified.
>
> Is there a way to create a WebMarkupContainerWithAssociatedMarkup
> object which is mapped to a specific element on the page markup? If
> so, can I implement tabbing by swapping such objects when tabs are
> clicked?
>
> Any ideas would be appreciated.
>
> Thanks
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
Just make the content area a panel, add links to each of the tabs, and in
the onClick, call replace(...) with the panel that contains the content for
that tab.  This will make each content area (for each tab) into a panel, but
you will not have to modify the markup of the tabs themselves.

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