You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by spaduri <ja...@gmail.com> on 2008/05/12 21:36:02 UTC

RE: MyFaces Tree2 Component

I have implemented the Dynamic Tree , wrtiing a component which is similar to
tree2
will post the information in next message.


Singh, Kiran 1. (NSN - IN/India - MiniMD) wrote:
> 
> Hi,
> 
> I have constructed a similar tree as in the below mail based on schema
> elements.
> Im using clientSideToggle="true", the tree is expanded on click.
> 
> But the problem im facing is on click of child elements the actionListener
> (spmlTreeBacker.displayAttributes) is not getting invoked.
> 
> If any one has a solution, please let me know.
> 
> 
> 
> Code Snippet:
> =============
> <faces-config>
>     <managed-bean>
>         <managed-bean-name>spmlTreeBacker</managed-bean-name>
>        
> <managed-bean-class>com.nsn.cntdb.wgt.mbean.SPMLTreeBean</managed-bean-class>
>         <managed-bean-scope>session</managed-bean-scope>
>     </managed-bean>
> 
> 
> JSP Code:
> <h:form id="spmlTreeForm">
> 	<t:tree2 id="spmlTree" value="#{spmlTreeBacker.treeData}" var="node"
> varNodeToggler="t" clientSideToggle="true" showRootNode="false">
> 	        <f:facet name="schema">
> 	            <h:panelGroup>
> 	                <t:graphicImage value="/img/yellow-folder-open.png"
> rendered="#{t.nodeExpanded}"/>
> 	                <t:graphicImage value="/img/yellow-folder-closed.png"
> rendered="#{!t.nodeExpanded}"/>
> 	                <h:outputText value="#{node.description}"
> styleClass="nodeFolder"/>
> 	            </h:panelGroup>
> 	        </f:facet>
> 	        
> 	        <f:facet name="fcoNode">
> 	            <h:panelGroup>
> 	            	<h:commandLink
> actionListener="#{spmlTreeBacker.displayAttributes}">	            		
> 		                <h:outputText value="#{node.description}"/>		                
> 			</h:commandLink>
> 	            </h:panelGroup>
> 	        </f:facet>
> 	        
> 	        <f:facet name="scoNode">
> 	            <h:panelGroup>
> 	            	<h:commandLink id="scoLink" immediate="true"
> styleClass="#{t.nodeSelected ? 'documentSelected':'document'}" 																
> actionListener="#{spmlTreeBacker.displayAttributes}" >
> 		                <t:graphicImage id="img1"
> value="/img/yellow-folder-open.png" rendered="#{t.nodeExpanded}"
> border="0"/>
> 		                <t:graphicImage id="img2"
> value="/img/yellow-folder-closed.png" rendered="#{!t.nodeExpanded}"
> border="0"/>
> 		                <h:outputText value="#{node.description}"
> styleClass="nodeFolder" style="font-size: 13px"/>
> 		                <f:param name="selectedNodeName"
> value="#{node.description}"/>
> 	                </h:commandLink>                
> 	            </h:panelGroup>
> 	        </f:facet>
>     </t:tree2>
> </h:form>
> 
> 
> Thanks & Regards,
> Kiran Singh K
> 
> 
> -----Original Message-----
> From: ext spaduri [mailto:javadevreddi@gmail.com] 
> Sent: Friday, April 25, 2008 1:55 AM
> To: users@myfaces.apache.org
> Subject: RE: MyFaces Tree2 Component
> 
> 
> Hi Matt
> Thanks for the reply.
> Well My environments doesn't let me know use AJAX4JSF, the maximum I can
> use
> is older version of MyFaces and Tomahawk components to build the
> Navigation
> tree..
> 
> Like .....
> 
> Conditions: 
> 
> 
> 1) Need to construct the Tree based on backend data.
> 2) All the Parents and Children should be links, like when I click on any
> link, I need to call an action and forward it some other page.
> 
> For testing I hardcoded and built one tree, which look similar...but the 
> dynamic tree needs server side toggling..which requires...handling of
> backend data...constructing a tree...
> If  you could share a sample, I will be appreciated...mean while I will
> try
> to do this...
> 
> Parent1
>    |
>    --Child1__
>                 |--sub child 1
>    --Child2
>    --Child3
> 
> Parent2
>    |
>    --Child1__
>                 |--sub child 1
>    --Child2
>    --Child3
> 
> Thanks Matt
> Jack
> 
> 
> 
> Matt.Rossner-prest wrote:
>> 
>> Hi Jack,
>> 
>> I can tell you this about Tree2, it doesn't handle dynamic data changes
>> very well. I'm using it on a project now for a similar type of project
>> and
>> I've had to do a lot of extra work to get it to do what I want.
>> Specifically with the tree state, I've also more or less rewritten the
>> renderer. But if you don't mind having a ton of HTML tables generated
>> then
>> you can keep that one. I would start here for more info
>> http://wiki.apache.org/myfaces/Tree2. I'm also using AJAX4JSF with this.
>> I
>> had originally started with William's example:
>> http://www.jroller.com/plainoldweblog/entry/use_tomahawk_tree2_and_ajax4jsf
>> and built on top of that. 
>> 
>> Matt
>> 
>> -----Message d'origine-----
>> De : spaduri [mailto:javadevreddi@gmail.com] 
>> Envoyé : lundi 21 avril 2008 17:48
>> À : users@myfaces.apache.org
>> Objet : Re: MyFaces Tree2 Component
>> 
>> 
>> Hi there....
>> 
>> I am planning to recommend JSF and MyFaces for the development of the
>> application.
>> like Navigation Tree on the left side, header, footer and body ..
>>  
>> 1) Can any one share a piece of code or share any Ideas to develop
>> Dynamic
>> Navigation Tree(like ServerSideToggling ..I will get the data from
>> backend
>> based on the I will build the Tree with leafs, when we click on leafs we
>> need to call action to redirect to other jsps ) we can achieve this using
>> MyFaces Tree2 Component,Just wondering if anybody know some information,
>> any
>> info is appreciated.
>> 
>> 
>> Thanks
>> Jack
>> 
>> 
>> simon.kitching@chello.at wrote:
>>> 
>>> This isn't correct; Tomahawk can be used with any JSF implementation, eg
>>> Sun's.
>>> 
>>> In very old Tomahawk versions, you needed to add a "shared" jar if you
>>> weren't using myfaces but that was removed long ago.
>>> 
>>> Regards,
>>> Simon
>>> 
>>> Grzesiek schrieb:
>>>> Personally I regret tomahawk can't be used without myfaces
>>>> (dependencies on `_shared` jars).
>>> 
>>> 
>>> 
>> 
>> -- 
>> View this message in context:
>> http://www.nabble.com/MyFaces-Tree2-Component-tp16764781p16808008.html
>> Sent from the MyFaces - Users mailing list archive at Nabble.com.
>> 
>> 
>> 
> 
> -- 
> View this message in context:
> http://www.nabble.com/MyFaces-Tree2-Component-tp16764781p16852440.html
> Sent from the MyFaces - Users mailing list archive at Nabble.com.
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/MyFaces-Tree2-Component-tp16764781p17189948.html
Sent from the MyFaces - Users mailing list archive at Nabble.com.