You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Ma...@sanofi-aventis.com on 2008/03/28 11:14:16 UTC

Is it possible to have a renderer do its rendering at the end of the document?

Hi,

 

The subject is vague so here's a more detailed description.

 

I have a context menu component that I've written. The way it works is
by rendering a <div> with the context menu items, anything that's in the
javax.output.Command family is an item. The div is initially set to
hidden. In the renderer I'm also creating a value binding of this
context menu component using its ID.

 

To use the context menu I have a sub class/components of commandLink
which has the added attribute of contextMenu. The command link then can
reference the context menu with an expression like
contextMenu="#{myContextMenu}".

 

This all works great. The problem is accessibility is very important for
this particular site. Currently the context menu has to be defined
before using the context menu command link. With this the div is
generated somewhere higher up on the page. For accessibility purposes we
want the div to be at the end of page. When you disable CSS which is
what the accessibility screen readers essentially do, the hidden div is
no longer hidden. 

 

I've done a lot of things with the AddResource interface, I have a whole
resource component which works very well. I've looked through the
extension filter code and I understand how that works with the
positioned info. I'm wondering if there is a similar way to do this with
a renderer. You know with AddResource you can do something like
addJavascriptAtPostion(AddResource.HEADER_BEGIN ....) and I think there
is also BODY_END. I want to do the rendering where it is in the page,
but write all the HTML at BODY_END. Is this possible?

 

Thanks,

Matt


Re: Is it possible to have a renderer do its rendering at the end of the document?

Posted by Martin Marinschek <ma...@gmail.com>.
Short answer: no, not really. What I would do in your case is I would
create a new component, and put it before the closing of your </body>
(or even create a new component which renders the body for you). Then
the renderer can register the stuff it wants to render with this new
component...

regards,

Martin

On Fri, Mar 28, 2008 at 12:14 PM,
<Ma...@sanofi-aventis.com> wrote:
>
>
>
>
> Hi,
>
>
>
> The subject is vague so here's a more detailed description.
>
>
>
> I have a context menu component that I've written. The way it works is by
> rendering a <div> with the context menu items, anything that's in the
> javax.output.Command family is an item. The div is initially set to hidden.
> In the renderer I'm also creating a value binding of this context menu
> component using its ID.
>
>
>
> To use the context menu I have a sub class/components of commandLink which
> has the added attribute of contextMenu. The command link then can reference
> the context menu with an expression like contextMenu="#{myContextMenu}".
>
>
>
> This all works great. The problem is accessibility is very important for
> this particular site. Currently the context menu has to be defined before
> using the context menu command link. With this the div is generated
> somewhere higher up on the page. For accessibility purposes we want the div
> to be at the end of page. When you disable CSS which is what the
> accessibility screen readers essentially do, the hidden div is no longer
> hidden.
>
>
>
> I've done a lot of things with the AddResource interface, I have a whole
> resource component which works very well. I've looked through the extension
> filter code and I understand how that works with the positioned info. I'm
> wondering if there is a similar way to do this with a renderer. You know
> with AddResource you can do something like
> addJavascriptAtPostion(AddResource.HEADER_BEGIN ….) and I think there is
> also BODY_END. I want to do the rendering where it is in the page, but write
> all the HTML at BODY_END. Is this possible?
>
>
>
> Thanks,
>
> Matt



-- 

http://www.irian.at

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

Professional Support for Apache MyFaces

Re: How to clear data already t:saveState manually in code?

Posted by jimmyau <ji...@privasia.com>.
i am not saving bean. is it the id of saveState is the key in the map?

<t:saveState id="srn" value="#{srnAddBean.selectedTab}"></t:saveState>

 FacesContext facesContext = FacesContext.getCurrentInstance();
facesContext.getExternalContext().getRequestMap().remove("srn");

----- Original Message ----- 
From: "Gerald Müllan" <gm...@apache.org>
To: "MyFaces Discussion" <us...@myfaces.apache.org>
Sent: Friday, March 28, 2008 6:48 PM ii
Subject: Re: How to clear data already t:saveState manually in code?


> Hi,
>
> FacesContext facesContext = FacesContext.getCurrentInstance();
> facesContext.getExternalContext().getRequestMap().remove(beanName);
>
> cheers,
>
> Gerald
>
> On Fri, Mar 28, 2008 at 11:26 AM, jimmyau <ji...@privasia.com> wrote:
>>
>>
>> How to clear data already t:saveState manually in code?
>> --
>> This message has been scanned for viruses and
>> dangerous content by MailScanner, and is
>> believed to be clean.
>
>
>
> -- 
> http://www.irian.at
>
> Your JSF powerhouse -
> JSF Consulting, Development and
> Courses in English and German
>
> Professional Support for Apache MyFaces
>
> -- 
> This message has been scanned for viruses and
> dangerous content by MailScanner, and is
> believed to be clean.
>
>
>
>
> -- 
> No virus found in this incoming message.
> Checked by AVG.
> Version: 7.5.519 / Virus Database: 269.22.1/1345 - Release Date: 3/26/2008 
> 6:50 PM
>
> 


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.


Re: How to clear data already t:saveState manually in code?

Posted by Gerald Müllan <gm...@apache.org>.
Hi,

FacesContext facesContext = FacesContext.getCurrentInstance();
facesContext.getExternalContext().getRequestMap().remove(beanName);

cheers,

Gerald

On Fri, Mar 28, 2008 at 11:26 AM, jimmyau <ji...@privasia.com> wrote:
>
>
> How to clear data already t:saveState manually in code?
> --
> This message has been scanned for viruses and
> dangerous content by MailScanner, and is
> believed to be clean.



-- 
http://www.irian.at

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

Professional Support for Apache MyFaces

How to clear data already t:saveState manually in code?

Posted by jimmyau <ji...@privasia.com>.
How to clear data already t:saveState manually in code? 
-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.