You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Pedro Calcao <pc...@opensoft.pt> on 2008/04/23 18:30:55 UTC

Using a tr:panelPopup with dynamic content

Greetings,

I have a page with a tr:table, in each row I would like to be able to use a
tr:panelPopup to, on click, query the database and return me some aditional
info on the row I clicked.
So far, I've been unable to figure if there is a way to trigger an event and
execute a bean method before displaying the popup.

Am I missing something, or is this an actual limitation?

I have tried to emulate this behavior using the Dialog framework, which
works as expected, unfortunatly, since the lightweight dialogs are modal and
cannot be moved from the center of the page, this isn't a usable solution to
my needs.

Furthermore, I'm using Trinidad version 1.0.7.


-- 
Best Regards,

Pedro Calção

Re: Using a tr:panelPopup with dynamic content

Posted by Andrew Robinson <an...@gmail.com>.
Have a look at org.apache.myfaces.trinidad.render.ExtendedRenderKitService.addScript(FacesContext,
String). Use this to send a <script/> element down to the client from
an action method (or custom component).

Then look in the popup JS code for the method to open the popup using
a client ID.

On Wed, Apr 23, 2008 at 12:07 PM, Pedro Calcao <pc...@opensoft.pt> wrote:
> Thanks for the answer :)
>
> I understand the strategy you propose, except the part of sending down
> Javascript to open the popup.
> What exactly do you mean, how can I set this when returning from a PPR
> action triggered by the command link?
>
> Thanks again,
>
> Pedro
>
>
>
> On Wed, Apr 23, 2008 at 6:29 PM, Andrew Robinson
> <an...@gmail.com> wrote:
> > There is currently no way to show a dialog during a PPR or generate a
> > PPR from a popup trigger, so your best bet IMO is to:
> >
> > 1. Hide the panelPopup trigger.
> > 2. Use a command link it your table
> > 3. In the action of the command link:
> >  a. Add the popup as a partial target
> >  b. Send down JavaScript to open the popup programmatically.
> >
> > Since the popup will be replaced via PPR you can use EL to change what
> > the popup looks like (tr:switcher, use of rendered attribute, etc.)
> >
> > -Andrew
> >
> >
> >
> >
> >
> > On Wed, Apr 23, 2008 at 10:30 AM, Pedro Calcao <pc...@opensoft.pt>
> wrote:
> > > Greetings,
> > >
> > > I have a page with a tr:table, in each row I would like to be able to
> use a
> > > tr:panelPopup to, on click, query the database and return me some
> aditional
> > > info on the row I clicked.
> > > So far, I've been unable to figure if there is a way to trigger an event
> and
> > > execute a bean method before displaying the popup.
> > >
> > > Am I missing something, or is this an actual limitation?
> > >
> > > I have tried to emulate this behavior using the Dialog framework, which
> > > works as expected, unfortunatly, since the lightweight dialogs are modal
> and
> > > cannot be moved from the center of the page, this isn't a usable
> solution to
> > > my needs.
> > >
> > > Furthermore, I'm using Trinidad version 1.0.7.
> > >
> > >
> > > --
> > > Best Regards,
> > >
> > > Pedro Calção
> >
>
>
>
> --
> Os melhores cumprimentos,
>
> Pedro Calção

Re: Using a tr:panelPopup with dynamic content

Posted by Pedro Calcao <pc...@opensoft.pt>.
Thanks for the answer :)

I understand the strategy you propose, except the part of sending down
Javascript to open the popup.
What exactly do you mean, how can I set this when returning from a PPR
action triggered by the command link?

Thanks again,

Pedro

On Wed, Apr 23, 2008 at 6:29 PM, Andrew Robinson <
andrew.rw.robinson@gmail.com> wrote:

> There is currently no way to show a dialog during a PPR or generate a
> PPR from a popup trigger, so your best bet IMO is to:
>
> 1. Hide the panelPopup trigger.
> 2. Use a command link it your table
> 3. In the action of the command link:
>  a. Add the popup as a partial target
>  b. Send down JavaScript to open the popup programmatically.
>
> Since the popup will be replaced via PPR you can use EL to change what
> the popup looks like (tr:switcher, use of rendered attribute, etc.)
>
> -Andrew
>
>
> On Wed, Apr 23, 2008 at 10:30 AM, Pedro Calcao <pc...@opensoft.pt>
> wrote:
> > Greetings,
> >
> > I have a page with a tr:table, in each row I would like to be able to
> use a
> > tr:panelPopup to, on click, query the database and return me some
> aditional
> > info on the row I clicked.
> > So far, I've been unable to figure if there is a way to trigger an event
> and
> > execute a bean method before displaying the popup.
> >
> > Am I missing something, or is this an actual limitation?
> >
> > I have tried to emulate this behavior using the Dialog framework, which
> > works as expected, unfortunatly, since the lightweight dialogs are modal
> and
> > cannot be moved from the center of the page, this isn't a usable
> solution to
> > my needs.
> >
> > Furthermore, I'm using Trinidad version 1.0.7.
> >
> >
> > --
> > Best Regards,
> >
> > Pedro Calção
>



-- 
Os melhores cumprimentos,

Pedro Calção

Re: Using a tr:panelPopup with dynamic content

Posted by Andrew Robinson <an...@gmail.com>.
There is currently no way to show a dialog during a PPR or generate a
PPR from a popup trigger, so your best bet IMO is to:

1. Hide the panelPopup trigger.
2. Use a command link it your table
3. In the action of the command link:
  a. Add the popup as a partial target
  b. Send down JavaScript to open the popup programmatically.

Since the popup will be replaced via PPR you can use EL to change what
the popup looks like (tr:switcher, use of rendered attribute, etc.)

-Andrew


On Wed, Apr 23, 2008 at 10:30 AM, Pedro Calcao <pc...@opensoft.pt> wrote:
> Greetings,
>
> I have a page with a tr:table, in each row I would like to be able to use a
> tr:panelPopup to, on click, query the database and return me some aditional
> info on the row I clicked.
> So far, I've been unable to figure if there is a way to trigger an event and
> execute a bean method before displaying the popup.
>
> Am I missing something, or is this an actual limitation?
>
> I have tried to emulate this behavior using the Dialog framework, which
> works as expected, unfortunatly, since the lightweight dialogs are modal and
> cannot be moved from the center of the page, this isn't a usable solution to
> my needs.
>
> Furthermore, I'm using Trinidad version 1.0.7.
>
>
> --
> Best Regards,
>
> Pedro Calção