You are viewing a plain text version of this content. The canonical link for it is here.
Posted to adffaces-user@incubator.apache.org by Martin Marinschek <ma...@gmail.com> on 2007/04/03 18:45:48 UTC

Dynamic id's with Partial Page Rendering

Hi *,

I'm using partial page rendering, where the triggering component is
supposed to sit in a data-table (e.g. commandButton as a kid of
dataTable, table has 15 rows, so 15 buttons).

The button have an id like:

myTable:1:myButton

When any of the buttons has been clicked, I want to update a separate
part of the page, but I can't specify each button in the
partialTriggers attribute, I don't even know yet how many buttons
there might be.

Tomahawk's pprPanelGroup has a partialTriggerExpression attribute,
where I can put a reg-ex to solve this issue. Is there something like
this in Trinidad as well? Any ideas for a workaround?

regards,

Martin



-- 

http://www.irian.at

Your JSF powerhouse -
JSF Consulting, Development and
Courses in English and German

Professional Support for Apache MyFaces

Re: Dynamic id's with Partial Page Rendering

Posted by Scott O'Bryan <da...@gmail.com>.
I'm not sure how this would play out with stamping, but I do know that 
the ID specified in partial triggers is a component ID and NOT a client 
id.  Have you tried referring to the stamped component's componentId in 
the partial trigger?  I would expect that whenever ANY of them are 
clicked or changed that the partialTrigger would update which sounds 
like the behavior you're expecting.  But I could be wrong.

The other thing you could do is programatically do an addPartialTarget 
in response to the event generated by the items in the table.  That will 
always force an update if you are able to do it there.

Scott

Matthias Wessendorf wrote:
> Not sure, but I think that isn't supported.
> I saw the reg_expr in Tomahawk and I like it!
>
> Wouldn't that be a valid enhancement ?
>
> -M
>
> On 4/3/07, Martin Marinschek <ma...@gmail.com> wrote:
>> Hi *,
>>
>> I'm using partial page rendering, where the triggering component is
>> supposed to sit in a data-table (e.g. commandButton as a kid of
>> dataTable, table has 15 rows, so 15 buttons).
>>
>> The button have an id like:
>>
>> myTable:1:myButton
>>
>> When any of the buttons has been clicked, I want to update a separate
>> part of the page, but I can't specify each button in the
>> partialTriggers attribute, I don't even know yet how many buttons
>> there might be.
>>
>> Tomahawk's pprPanelGroup has a partialTriggerExpression attribute,
>> where I can put a reg-ex to solve this issue. Is there something like
>> this in Trinidad as well? Any ideas for a workaround?
>>
>> regards,
>>
>> Martin
>>
>>
>>
>> -- 
>>
>> http://www.irian.at
>>
>> Your JSF powerhouse -
>> JSF Consulting, Development and
>> Courses in English and German
>>
>> Professional Support for Apache MyFaces
>>
>
>


Re: Dynamic id's with Partial Page Rendering

Posted by Matthias Wessendorf <ma...@apache.org>.
Not sure, but I think that isn't supported.
I saw the reg_expr in Tomahawk and I like it!

Wouldn't that be a valid enhancement ?

-M

On 4/3/07, Martin Marinschek <ma...@gmail.com> wrote:
> Hi *,
>
> I'm using partial page rendering, where the triggering component is
> supposed to sit in a data-table (e.g. commandButton as a kid of
> dataTable, table has 15 rows, so 15 buttons).
>
> The button have an id like:
>
> myTable:1:myButton
>
> When any of the buttons has been clicked, I want to update a separate
> part of the page, but I can't specify each button in the
> partialTriggers attribute, I don't even know yet how many buttons
> there might be.
>
> Tomahawk's pprPanelGroup has a partialTriggerExpression attribute,
> where I can put a reg-ex to solve this issue. Is there something like
> this in Trinidad as well? Any ideas for a workaround?
>
> regards,
>
> Martin
>
>
>
> --
>
> http://www.irian.at
>
> Your JSF powerhouse -
> JSF Consulting, Development and
> Courses in English and German
>
> Professional Support for Apache MyFaces
>


-- 
Matthias Wessendorf
http://tinyurl.com/fmywh

further stuff:
blog: http://jroller.com/page/mwessendorf
mail: mwessendorf-at-gmail-dot-com

Re: Dynamic id's with Partial Page Rendering

Posted by Matthias Wessendorf <ma...@apache.org>.
the funny thing is; I was searching that in Tomahawk and found the
attribute for the pattern.
You did it vice versa :)

On 4/3/07, Martin Marinschek <ma...@gmail.com> wrote:
> Yes, that's definitely a workaround!
>
> regards,
>
> Martin
>
> On 4/3/07, Matthias Wessendorf <ma...@apache.org> wrote:
> > Martin,
> >
> > do you know the ID of the part that should be rendered, or are you
> > able to *calculate* it on the server?
> >
> > RequestContext.addPartialTarget(UIComp) might be an option:
> >
> > <sample>
> >     UIXTable table = (UIXTable) event.getComponent().findComponent("userTable");
> >     table.setValue(this.users);
> >     RequestContext afContext = RequestContext.getCurrentInstance();
> >     afContext.addPartialTarget(table);
> > </sample>
> >
> >
> > On 4/3/07, Martin Marinschek <ma...@gmail.com> wrote:
> > > Hi *,
> > >
> > > I'm using partial page rendering, where the triggering component is
> > > supposed to sit in a data-table (e.g. commandButton as a kid of
> > > dataTable, table has 15 rows, so 15 buttons).
> > >
> > > The button have an id like:
> > >
> > > myTable:1:myButton
> > >
> > > When any of the buttons has been clicked, I want to update a separate
> > > part of the page, but I can't specify each button in the
> > > partialTriggers attribute, I don't even know yet how many buttons
> > > there might be.
> > >
> > > Tomahawk's pprPanelGroup has a partialTriggerExpression attribute,
> > > where I can put a reg-ex to solve this issue. Is there something like
> > > this in Trinidad as well? Any ideas for a workaround?
> > >
> > > regards,
> > >
> > > Martin
> > >
> > >
> > >
> > > --
> > >
> > > http://www.irian.at
> > >
> > > Your JSF powerhouse -
> > > JSF Consulting, Development and
> > > Courses in English and German
> > >
> > > Professional Support for Apache MyFaces
> > >
> >
> >
> > --
> > Matthias Wessendorf
> > http://tinyurl.com/fmywh
> >
> > further stuff:
> > blog: http://jroller.com/page/mwessendorf
> > mail: mwessendorf-at-gmail-dot-com
> >
>
>
> --
>
> http://www.irian.at
>
> Your JSF powerhouse -
> JSF Consulting, Development and
> Courses in English and German
>
> Professional Support for Apache MyFaces
>


-- 
Matthias Wessendorf
http://tinyurl.com/fmywh

further stuff:
blog: http://jroller.com/page/mwessendorf
mail: mwessendorf-at-gmail-dot-com

Re: Dynamic id's with Partial Page Rendering

Posted by Martin Marinschek <ma...@gmail.com>.
Yes, that's definitely a workaround!

regards,

Martin

On 4/3/07, Matthias Wessendorf <ma...@apache.org> wrote:
> Martin,
>
> do you know the ID of the part that should be rendered, or are you
> able to *calculate* it on the server?
>
> RequestContext.addPartialTarget(UIComp) might be an option:
>
> <sample>
>     UIXTable table = (UIXTable) event.getComponent().findComponent("userTable");
>     table.setValue(this.users);
>     RequestContext afContext = RequestContext.getCurrentInstance();
>     afContext.addPartialTarget(table);
> </sample>
>
>
> On 4/3/07, Martin Marinschek <ma...@gmail.com> wrote:
> > Hi *,
> >
> > I'm using partial page rendering, where the triggering component is
> > supposed to sit in a data-table (e.g. commandButton as a kid of
> > dataTable, table has 15 rows, so 15 buttons).
> >
> > The button have an id like:
> >
> > myTable:1:myButton
> >
> > When any of the buttons has been clicked, I want to update a separate
> > part of the page, but I can't specify each button in the
> > partialTriggers attribute, I don't even know yet how many buttons
> > there might be.
> >
> > Tomahawk's pprPanelGroup has a partialTriggerExpression attribute,
> > where I can put a reg-ex to solve this issue. Is there something like
> > this in Trinidad as well? Any ideas for a workaround?
> >
> > regards,
> >
> > Martin
> >
> >
> >
> > --
> >
> > http://www.irian.at
> >
> > Your JSF powerhouse -
> > JSF Consulting, Development and
> > Courses in English and German
> >
> > Professional Support for Apache MyFaces
> >
>
>
> --
> Matthias Wessendorf
> http://tinyurl.com/fmywh
>
> further stuff:
> blog: http://jroller.com/page/mwessendorf
> mail: mwessendorf-at-gmail-dot-com
>


-- 

http://www.irian.at

Your JSF powerhouse -
JSF Consulting, Development and
Courses in English and German

Professional Support for Apache MyFaces

Re: Dynamic id's with Partial Page Rendering

Posted by Matthias Wessendorf <ma...@apache.org>.
Martin,

do you know the ID of the part that should be rendered, or are you
able to *calculate* it on the server?

RequestContext.addPartialTarget(UIComp) might be an option:

<sample>
    UIXTable table = (UIXTable) event.getComponent().findComponent("userTable");
    table.setValue(this.users);
    RequestContext afContext = RequestContext.getCurrentInstance();
    afContext.addPartialTarget(table);
</sample>


On 4/3/07, Martin Marinschek <ma...@gmail.com> wrote:
> Hi *,
>
> I'm using partial page rendering, where the triggering component is
> supposed to sit in a data-table (e.g. commandButton as a kid of
> dataTable, table has 15 rows, so 15 buttons).
>
> The button have an id like:
>
> myTable:1:myButton
>
> When any of the buttons has been clicked, I want to update a separate
> part of the page, but I can't specify each button in the
> partialTriggers attribute, I don't even know yet how many buttons
> there might be.
>
> Tomahawk's pprPanelGroup has a partialTriggerExpression attribute,
> where I can put a reg-ex to solve this issue. Is there something like
> this in Trinidad as well? Any ideas for a workaround?
>
> regards,
>
> Martin
>
>
>
> --
>
> http://www.irian.at
>
> Your JSF powerhouse -
> JSF Consulting, Development and
> Courses in English and German
>
> Professional Support for Apache MyFaces
>


-- 
Matthias Wessendorf
http://tinyurl.com/fmywh

further stuff:
blog: http://jroller.com/page/mwessendorf
mail: mwessendorf-at-gmail-dot-com