You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Patrick Davids <pa...@nuboit.de> on 2013/07/05 11:15:56 UTC

conditional component / as singleton on page

Hi all,
does anyone have a best practice putting a component on a page (as 
singleton) independendly how many other components on that page "needs" it?

e.g. a global dialog, which can be used from different components.
Not to have 20 invisible dialogs aleady rendered and opened on request.

In out special to achieve this we do not want use page inheritence.
This component shouldn't be on page, if no other component needs it.

thanx for help...
kind regards
Patrick
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


RE: conditional component / as singleton on page

Posted by Chris Colman <ch...@stepaheadsoftware.com>.
ModalX allows you to create set of 'generic' modal windows waiting in
the wings ready for display.

Any specific modal that you want simply needs to derive from a generic
modal class and you can then open it at will.

See here for info and demo:

http://www.visualclassworks.com/list/modalx-for-wicket/modalx

All open source Wicket and it's part of WicketStuff

https://github.com/wicketstuff/core/wiki/ModalX

I'm not sure it's exactly what you're after when when you said you want
to avoid having 20 invisible dialogs already rendered and opened on
request that reminded me of the very reason we created ModalX in the
first place.

Regards,
Chris

>-----Original Message-----
>From: Patrick Davids [mailto:patrick.davids@nuboit.de]
>Sent: Friday, 5 July 2013 7:16 PM
>To: users@wicket.apache.org
>Subject: conditional component / as singleton on page
>
>Hi all,
>does anyone have a best practice putting a component on a page (as
>singleton) independendly how many other components on that page "needs"
it?
>
>e.g. a global dialog, which can be used from different components.
>Not to have 20 invisible dialogs aleady rendered and opened on request.
>
>In out special to achieve this we do not want use page inheritence.
>This component shouldn't be on page, if no other component needs it.
>
>thanx for help...
>kind regards
>Patrick
>---------------------------------------------------------------------
>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: conditional component / as singleton on page

Posted by Martin Grigorov <mg...@apache.org>.
On Fri, Jul 5, 2013 at 1:41 PM, Patrick Davids <pa...@nuboit.de>wrote:

> Hi Sebastien, Hi Martin,
> the dialog was just an example.
>
> My question was more focused on a feature similar to the javascript or
> css resource "wicket feature".
> Putting a resource only once into the page header no matter how many
> components "requested" to do that.
>

What do you mean by requested component ?

To show a component you need a markup for it (an HTML element with
wicket:id attribute). Without markup you won't be able to add it in the
page.
So, this component must be in the page. It could be invisible if no one
"requested" it.


>
> But on component level.
>
> (I am in a case with a repeating view.)
>
> Patrick
>
> Am 05.07.2013 11:55, schrieb Sebastien:
> > Hi Patrick,
> >
> > I am using the same approach as Martin.
> >
> > Just a little additional note: if you want to have only one dialog
> > placeholder for different dialogs/purposes and as I am thinking you are
> > using jQuery UI's dialog, I would suggest you to have a look at this
> issue
> > for the dialog to open correctly (it is a common problem while using
> jQuery
> > UI's dialog)
> >
> > https://github.com/sebfz1/wicket-jquery-ui/issues/44
> >
> > Explanations here:
> > http://blog.nemikor.com/2009/04/08/basic-usage-of-the-jquery-ui-dialog/
> >
> > Best regards,
> > Sebastien.
> >
> >
> > On Fri, Jul 5, 2013 at 11:39 AM, Martin Grigorov <mgrigorov@apache.org
> >wrote:
> >
> >> Hi,
> >>
> >> We use something similar for showing dialog/flyout.
> >> The component is always in the page, but it renders itself only when it
> has
> >> contents.
> >> You can put your component anywhere in the page hierarchy and use Wicket
> >> events to update it.
> >>
> >>
> >> On Fri, Jul 5, 2013 at 12:15 PM, Patrick Davids <
> patrick.davids@nuboit.de
> >>> wrote:
> >>
> >>> Hi all,
> >>> does anyone have a best practice putting a component on a page (as
> >>> singleton) independendly how many other components on that page "needs"
> >> it?
> >>>
> >>> e.g. a global dialog, which can be used from different components.
> >>> Not to have 20 invisible dialogs aleady rendered and opened on request.
> >>>
> >>> In out special to achieve this we do not want use page inheritence.
> >>> This component shouldn't be on page, if no other component needs it.
> >>>
> >>> thanx for help...
> >>> kind regards
> >>> Patrick
> >>> ---------------------------------------------------------------------
> >>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> >>> For additional commands, e-mail: users-help@wicket.apache.org
> >>>
> >>>
> >>
> >
>
> --
> Mit freundlichen Grüßen,
>
> Patrick Davids
>
> NuboIT GmbH & Co. KG
> Kieler Str. 103-107 • 25474 Bönningstedt
>
> Email: patrick.davids@nuboit.de
>
> Handelsregister: HRA6819 Pi  | Amtsgericht Pinneberg
>
> Geschäftsführung der Verwaltungsgesellschaft
> Daniel Fraga Zander
>
> HRB10145Pi | Amtsgericht Pinneberg

Re: conditional component / as singleton on page

Posted by Patrick Davids <pa...@nuboit.de>.
Hi Sebastien, Hi Martin,
the dialog was just an example.

My question was more focused on a feature similar to the javascript or 
css resource "wicket feature".
Putting a resource only once into the page header no matter how many 
components "requested" to do that.

But on component level.

(I am in a case with a repeating view.)

Patrick

Am 05.07.2013 11:55, schrieb Sebastien:
> Hi Patrick,
>
> I am using the same approach as Martin.
>
> Just a little additional note: if you want to have only one dialog
> placeholder for different dialogs/purposes and as I am thinking you are
> using jQuery UI's dialog, I would suggest you to have a look at this issue
> for the dialog to open correctly (it is a common problem while using jQuery
> UI's dialog)
>
> https://github.com/sebfz1/wicket-jquery-ui/issues/44
>
> Explanations here:
> http://blog.nemikor.com/2009/04/08/basic-usage-of-the-jquery-ui-dialog/
>
> Best regards,
> Sebastien.
>
>
> On Fri, Jul 5, 2013 at 11:39 AM, Martin Grigorov <mg...@apache.org>wrote:
>
>> Hi,
>>
>> We use something similar for showing dialog/flyout.
>> The component is always in the page, but it renders itself only when it has
>> contents.
>> You can put your component anywhere in the page hierarchy and use Wicket
>> events to update it.
>>
>>
>> On Fri, Jul 5, 2013 at 12:15 PM, Patrick Davids <patrick.davids@nuboit.de
>>> wrote:
>>
>>> Hi all,
>>> does anyone have a best practice putting a component on a page (as
>>> singleton) independendly how many other components on that page "needs"
>> it?
>>>
>>> e.g. a global dialog, which can be used from different components.
>>> Not to have 20 invisible dialogs aleady rendered and opened on request.
>>>
>>> In out special to achieve this we do not want use page inheritence.
>>> This component shouldn't be on page, if no other component needs it.
>>>
>>> thanx for help...
>>> kind regards
>>> Patrick
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>
>>>
>>
>

-- 
Mit freundlichen Grüßen,

Patrick Davids

NuboIT GmbH & Co. KG
Kieler Str. 103-107 • 25474 Bönningstedt

Email: patrick.davids@nuboit.de

Handelsregister: HRA6819 Pi  | Amtsgericht Pinneberg

Geschäftsführung der Verwaltungsgesellschaft
Daniel Fraga Zander

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


Re: conditional component / as singleton on page

Posted by Sebastien <se...@gmail.com>.
Hi Patrick,

I am using the same approach as Martin.

Just a little additional note: if you want to have only one dialog
placeholder for different dialogs/purposes and as I am thinking you are
using jQuery UI's dialog, I would suggest you to have a look at this issue
for the dialog to open correctly (it is a common problem while using jQuery
UI's dialog)

https://github.com/sebfz1/wicket-jquery-ui/issues/44

Explanations here:
http://blog.nemikor.com/2009/04/08/basic-usage-of-the-jquery-ui-dialog/

Best regards,
Sebastien.


On Fri, Jul 5, 2013 at 11:39 AM, Martin Grigorov <mg...@apache.org>wrote:

> Hi,
>
> We use something similar for showing dialog/flyout.
> The component is always in the page, but it renders itself only when it has
> contents.
> You can put your component anywhere in the page hierarchy and use Wicket
> events to update it.
>
>
> On Fri, Jul 5, 2013 at 12:15 PM, Patrick Davids <patrick.davids@nuboit.de
> >wrote:
>
> > Hi all,
> > does anyone have a best practice putting a component on a page (as
> > singleton) independendly how many other components on that page "needs"
> it?
> >
> > e.g. a global dialog, which can be used from different components.
> > Not to have 20 invisible dialogs aleady rendered and opened on request.
> >
> > In out special to achieve this we do not want use page inheritence.
> > This component shouldn't be on page, if no other component needs it.
> >
> > thanx for help...
> > kind regards
> > Patrick
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > For additional commands, e-mail: users-help@wicket.apache.org
> >
> >
>

Re: conditional component / as singleton on page

Posted by Martin Grigorov <mg...@apache.org>.
Hi,

We use something similar for showing dialog/flyout.
The component is always in the page, but it renders itself only when it has
contents.
You can put your component anywhere in the page hierarchy and use Wicket
events to update it.


On Fri, Jul 5, 2013 at 12:15 PM, Patrick Davids <pa...@nuboit.de>wrote:

> Hi all,
> does anyone have a best practice putting a component on a page (as
> singleton) independendly how many other components on that page "needs" it?
>
> e.g. a global dialog, which can be used from different components.
> Not to have 20 invisible dialogs aleady rendered and opened on request.
>
> In out special to achieve this we do not want use page inheritence.
> This component shouldn't be on page, if no other component needs it.
>
> thanx for help...
> kind regards
> Patrick
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>