You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by "Oellien, F (Frank)" <Fr...@intervet.com> on 2006/12/11 09:45:10 UTC

CommandLink and Tree2

Hello,

I have a problem with commandLink and Tree2 in a multi-frames
environment. My application has a left frame containing the tree2 and a
right frame (name=workspaceContentFrame) which should represent the
results of the commandLink action. I have set the target attribute in
the commandLink. From reading several postings on mailing lists I have
learned that setting target will not solve my problem and I have to add
some Javascript to the commandLink to set the target on the form.
This workaround works with Firefox (2) but not with IE6 or IE7. Has
anybody a solution for this issue?
Is there another way to solve the target problem with commandLink/Tree2?

Thank you
Frank


        <h:form id="workflowTreeForm" styleClass="tree"
onsubmit="alert('OnSubmit: ' +
document.forms['workflowTreeForm'].target)">
            <t:tree2 id="workflowTree"
value="#{workflowsBean.workflowTree}" var="node" varNodeToggler="t"
clientSideToggle="false" showRootNode="false">
...
                <f:facet name="workflow">
                        <h:panelGrid id="a" columns="2" cellpadding="2"
cellspacing="0">
                            <t:graphicImage value="/images/module.gif"
rendered="#{!node.iconSet}" border="0"/>
                            <t:graphicImage value="#{node.iconPath}"
rendered="#{node.iconSet}" border="0"/>
                            
                            <h:panelGroup>
                                <t:commandLink immediate="true"
id="LoadTest" target="workspaceContentFrame" 
 
action="#{workflowsBean.loadWorkflow}"
actionListener="#{workflowsBean.selectTemplateID}"
 
onmouseup="document.forms['workflowTreeForm'].target = this.target">
                                    <h:outputText value="#{node.name}"
styleClass="nodeFolder"/>
                                    <f:param name="workflowID"
value="#{node.identifier}"/>
                                </t:commandLink>
                            </h:panelGroup>
                        </h:panelGrid>

                        
                </f:facet>
            </t:tree2>
--------------------------------------
This message, including attachments, is confidential and may be privileged.
If you are not an intended recipient, please notify the sender then delete
and destroy the original message and all copies. You should not copy, forward
and/or disclose this message, in whole or in part, without permission of
the sender.
--------------------------------------

TabPanel with unknown number of initial tabs

Posted by "Oellien, F (Frank)" <Fr...@intervet.com>.
Hello,

I am wondering, if it is possible to define a Tabpanel (by using
standard components) that contains a undefined number of tabs? Usually,
you have to define each tab in the JSF page.
I think that this requirement should occur quite often, because a lot of
applications (IE7, Firefox, Eclipse, Netbeans...) also use this kind of
tabbing.

Regards
Frank
--------------------------------------
This message, including attachments, is confidential and may be privileged.
If you are not an intended recipient, please notify the sender then delete
and destroy the original message and all copies. You should not copy, forward
and/or disclose this message, in whole or in part, without permission of
the sender.
--------------------------------------

RE: CommandLink and Tree2

Posted by "Oellien, F (Frank)" <Fr...@intervet.com>.
Hello,

I am not very familiar with the facelet approach. However, as I
understand the conecept you can use facelets to design layouts and to
combine different components. But, I am not sure how this can solve the
target problem of the tree2/commandLink framework.
However, I have tried your advice to save the tree state in the backing
bean. And finally this solves the problem. If you save the tree state in
the backing bean, no problem with frames, commandLink and tree2 will
occur.

Thank you
Frank

> -----Original Message-----
> From: turbomanage@gmail.com [mailto:turbomanage@gmail.com] On 
> Behalf Of David Chandler
> Sent: Montag, 11. Dezember 2006 13:36
> To: MyFaces Discussion
> Subject: Re: CommandLink and Tree2
> 
> As an alternative to frames, I've had good success with Tree2 
> and command links using a Facelets template with Tree2 in the 
> template.
> You have to keep the tree state in a managed bean property 
> for this to work (as described on the Tree2 wiki).
> 
> /dmc
> 
> On 12/11/06, Oellien, F (Frank) <Fr...@intervet.com> wrote:
> > Hello,
> >
> > I have a problem with commandLink and Tree2 in a multi-frames 
> > environment. My application has a left frame containing the 
> tree2 and 
> > a right frame (name=workspaceContentFrame) which should 
> represent the 
> > results of the commandLink action. I have set the target 
> attribute in 
> > the commandLink. From reading several postings on mailing 
> lists I have 
> > learned that setting target will not solve my problem and I have to 
> > add some Javascript to the commandLink to set the target on 
> the form.
> > This workaround works with Firefox (2) but not with IE6 or IE7. Has 
> > anybody a solution for this issue?
> > Is there another way to solve the target problem with 
> commandLink/Tree2?
> >
> > Thank you
> > Frank
> >
> >
> >        <h:form id="workflowTreeForm" styleClass="tree"
> > onsubmit="alert('OnSubmit: ' +
> > document.forms['workflowTreeForm'].target)">
> >            <t:tree2 id="workflowTree"
> > value="#{workflowsBean.workflowTree}" var="node" varNodeToggler="t"
> > clientSideToggle="false" showRootNode="false"> ...
> >                <f:facet name="workflow">
> >                        <h:panelGrid id="a" columns="2" 
> cellpadding="2"
> > cellspacing="0">
> >                            <t:graphicImage 
> value="/images/module.gif"
> > rendered="#{!node.iconSet}" border="0"/>
> >                            <t:graphicImage value="#{node.iconPath}"
> > rendered="#{node.iconSet}" border="0"/>
> >
> >                            <h:panelGroup>
> >                                <t:commandLink immediate="true"
> > id="LoadTest" target="workspaceContentFrame"
> >
> > action="#{workflowsBean.loadWorkflow}"
> > actionListener="#{workflowsBean.selectTemplateID}"
> >
> > onmouseup="document.forms['workflowTreeForm'].target = this.target">
> >                                    <h:outputText 
> value="#{node.name}"
> > styleClass="nodeFolder"/>
> >                                    <f:param name="workflowID"
> > value="#{node.identifier}"/>
> >                                </t:commandLink>
> >                            </h:panelGroup>
> >                        </h:panelGrid>
> >
> >
> >                </f:facet>
> >            </t:tree2>
> > --------------------------------------
> > This message, including attachments, is confidential and 
> may be privileged.
> > If you are not an intended recipient, please notify the sender then 
> > delete and destroy the original message and all copies. You 
> should not 
> > copy, forward and/or disclose this message, in whole or in part, 
> > without permission of the sender.
> > --------------------------------------
> >
> 
> 
> --
> David Chandler
> Development Coach
> learnjsf.com
> 
--------------------------------------
This message, including attachments, is confidential and may be privileged.
If you are not an intended recipient, please notify the sender then delete
and destroy the original message and all copies. You should not copy, forward
and/or disclose this message, in whole or in part, without permission of
the sender.
--------------------------------------

Re: CommandLink and Tree2

Posted by David Chandler <da...@learnjsf.com>.
As an alternative to frames, I've had good success with Tree2 and
command links using a Facelets template with Tree2 in the template.
You have to keep the tree state in a managed bean property for this to
work (as described on the Tree2 wiki).

/dmc

On 12/11/06, Oellien, F (Frank) <Fr...@intervet.com> wrote:
> Hello,
>
> I have a problem with commandLink and Tree2 in a multi-frames
> environment. My application has a left frame containing the tree2 and a
> right frame (name=workspaceContentFrame) which should represent the
> results of the commandLink action. I have set the target attribute in
> the commandLink. From reading several postings on mailing lists I have
> learned that setting target will not solve my problem and I have to add
> some Javascript to the commandLink to set the target on the form.
> This workaround works with Firefox (2) but not with IE6 or IE7. Has
> anybody a solution for this issue?
> Is there another way to solve the target problem with commandLink/Tree2?
>
> Thank you
> Frank
>
>
>        <h:form id="workflowTreeForm" styleClass="tree"
> onsubmit="alert('OnSubmit: ' +
> document.forms['workflowTreeForm'].target)">
>            <t:tree2 id="workflowTree"
> value="#{workflowsBean.workflowTree}" var="node" varNodeToggler="t"
> clientSideToggle="false" showRootNode="false">
> ...
>                <f:facet name="workflow">
>                        <h:panelGrid id="a" columns="2" cellpadding="2"
> cellspacing="0">
>                            <t:graphicImage value="/images/module.gif"
> rendered="#{!node.iconSet}" border="0"/>
>                            <t:graphicImage value="#{node.iconPath}"
> rendered="#{node.iconSet}" border="0"/>
>
>                            <h:panelGroup>
>                                <t:commandLink immediate="true"
> id="LoadTest" target="workspaceContentFrame"
>
> action="#{workflowsBean.loadWorkflow}"
> actionListener="#{workflowsBean.selectTemplateID}"
>
> onmouseup="document.forms['workflowTreeForm'].target = this.target">
>                                    <h:outputText value="#{node.name}"
> styleClass="nodeFolder"/>
>                                    <f:param name="workflowID"
> value="#{node.identifier}"/>
>                                </t:commandLink>
>                            </h:panelGroup>
>                        </h:panelGrid>
>
>
>                </f:facet>
>            </t:tree2>
> --------------------------------------
> This message, including attachments, is confidential and may be privileged.
> If you are not an intended recipient, please notify the sender then delete
> and destroy the original message and all copies. You should not copy, forward
> and/or disclose this message, in whole or in part, without permission of
> the sender.
> --------------------------------------
>


-- 
David Chandler
Development Coach
learnjsf.com

CommandLink and Tree2 - addendum

Posted by "Oellien, F (Frank)" <Fr...@intervet.com>.
Obviously, action and actionListener are not fired with IE6/7, if the
onmouseup event is present!? 

> -----Original Message-----
> From: Oellien, F (Frank) [mailto:Frank.Oellien@intervet.com] 
> Sent: Montag, 11. Dezember 2006 09:45
> To: MyFaces Discussion
> Subject: CommandLink and Tree2
> 
> Hello,
> 
> I have a problem with commandLink and Tree2 in a multi-frames 
> environment. My application has a left frame containing the 
> tree2 and a right frame (name=workspaceContentFrame) which 
> should represent the results of the commandLink action. I 
> have set the target attribute in the commandLink. From 
> reading several postings on mailing lists I have learned that 
> setting target will not solve my problem and I have to add 
> some Javascript to the commandLink to set the target on the form.
> This workaround works with Firefox (2) but not with IE6 or 
> IE7. Has anybody a solution for this issue?
> Is there another way to solve the target problem with 
> commandLink/Tree2?
> 
> Thank you
> Frank
> 
> 
>         <h:form id="workflowTreeForm" styleClass="tree"
> onsubmit="alert('OnSubmit: ' +
> document.forms['workflowTreeForm'].target)">
>             <t:tree2 id="workflowTree"
> value="#{workflowsBean.workflowTree}" var="node" varNodeToggler="t"
> clientSideToggle="false" showRootNode="false"> ...
>                 <f:facet name="workflow">
>                         <h:panelGrid id="a" columns="2" 
> cellpadding="2"
> cellspacing="0">
>                             <t:graphicImage value="/images/module.gif"
> rendered="#{!node.iconSet}" border="0"/>
>                             <t:graphicImage value="#{node.iconPath}"
> rendered="#{node.iconSet}" border="0"/>
>                             
>                             <h:panelGroup>
>                                 <t:commandLink immediate="true"
> id="LoadTest" target="workspaceContentFrame" 
>  
> action="#{workflowsBean.loadWorkflow}"
> actionListener="#{workflowsBean.selectTemplateID}"
>  
> onmouseup="document.forms['workflowTreeForm'].target = this.target">
>                                     <h:outputText value="#{node.name}"
> styleClass="nodeFolder"/>
>                                     <f:param name="workflowID"
> value="#{node.identifier}"/>
>                                 </t:commandLink>
>                             </h:panelGroup>
>                         </h:panelGrid>
> 
>                         
>                 </f:facet>
>             </t:tree2>
> --------------------------------------
> This message, including attachments, is confidential and may 
> be privileged.
> If you are not an intended recipient, please notify the 
> sender then delete and destroy the original message and all 
> copies. You should not copy, forward and/or disclose this 
> message, in whole or in part, without permission of the sender.
> --------------------------------------
> 
--------------------------------------
This message, including attachments, is confidential and may be privileged.
If you are not an intended recipient, please notify the sender then delete
and destroy the original message and all copies. You should not copy, forward
and/or disclose this message, in whole or in part, without permission of
the sender.
--------------------------------------