Hi Simon,

Yes the outer DIV component with id="subnavigation_outer" is enclosed in
a subview naming container in the layout.jsp. Following is the code
snipped:

<td width="170px" valign="top" bgcolor="#F8F6F7" nowrap="nowrap">
        <f:subview id="leftnav">
                <tiles:insert attribute="leftnavigation" flush="false"/>

        </f:subview>
</td>

Do you mean to say that in my JSP for left navigation I need to prefix
the naming container id if any? Why is this necessary?

As you can see from the code below I get the inner DIV component via
value binding. It gets me the correct component.

I am able to populate and add a HtmlPanelNavigationMenu to the DIV
component. If then I look at the entire tree then the components added
are present.

If the components are added properly then when it goes to the render
response phase then it should get all the components.

I am missing something or have I misunderstood something.

~madhav

> -----Original Message-----
> From: Simon Kitching [mailto:[EMAIL PROTECTED]
> Sent: Thursday, December 14, 2006 12:40 AM
> To: MyFaces Discussion
> Subject: Re: Problems while programmatically adding components
>
> Madhav Bhargava wrote:
> > Hi All,
> >
> >
> >
> > I have a JSP which uses tiles.
> >
> > The left menu part of the JSP needs to be programmatically created
as
> > the left menu will differ based on the role the use plays.
> >
> >
> >
> > In the leftNavigationMenu.jsp - included as a tile in layout.jsp I
have
> > the following code:
> >
> > <t:div id="subnavigation_outer" forceId="true">
> >
> >     <t:div id="subnavigation" forceId="true"
> > rendered="#{navigationMenu.leftPanelNavigationConstructed}"
> > binding="#{navigationMenu.parentUIComponent}">
> >
> >     </t:div>
> >
> > </t:div>
> >
> >
> >
> > In the method isLeftPanelNavigationConstructed
HtmlPanelNavigationMenu
> > component and child HtmlCommandNavigationItem components are added
to
> > the DIV component with id="subnavigation"
> >
> > At the end of creation of this menu when I view the children of
> > UIViewRoot then all the components are seen and are properly added.
> >
> >
> >
> > However when the JSP gets displayed nothing is displayed in the left
> > navigation.
> >
> >
> >
> > I am puzzled and I am not able to find a reason. Even though the
> > UIViewRoot contains the components still it is unable to render any
of
> > the components.
>
> Are your components nested within a "namespacing container", eg a
table
> or a subview? If so, the id will have a prefix eg
> "subviewname:subnavigation_outer".
>
> Also, when using JSF 1.1 with JSP, on first page render components are
> created and rendered in one pass. That means that when a component is
> being processed, any components further down the page don't yet exist
> (and so cannot be found). Using JSF1.2 (not yet implemented by
MyFaces)
> or Facelets solves this.
>
> Regards,  Simon

**************** CAUTION - Disclaimer *****************
This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely 
for the use of the addressee(s). If you are not the intended recipient, please 
notify the sender by e-mail and delete the original message. Further, you are 
not to copy, disclose, or distribute this e-mail or its contents to any other 
person and any such actions are unlawful. This e-mail may contain viruses. 
Infosys has taken every reasonable precaution to minimize this risk, but is not 
liable for any damage you may sustain as a result of any virus in this e-mail. 
You should carry out your own virus checks before opening the e-mail or 
attachment. Infosys reserves the right to monitor and review the content of all 
messages sent to or from this e-mail address. Messages sent to or from this 
e-mail address may be stored on the Infosys e-mail system.
***INFOSYS******** End of Disclaimer ********INFOSYS***

Reply via email to