You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Franco Ehrat <fr...@giniality.ch> on 2009/04/08 15:50:20 UTC

Facets Action Handling

Hi...

I'm just new in using Facets.
Now I built a tree (tomahawk tree2) with defining type of tree node with
using Facets.
For specific Facets I'm using "popup" component to show links when mouse
comes to a tree node.

My problem is now, that if I have an easy tree (1 parent, a few childs) and
click to a link on a tree node, the underlying action will be executed for
all children (tree nodes of the same type).


Can anybody help me, what I hav to change, that the action will be executed
just one time (for the selected tree node)?

Greetings
Franco
-- 
View this message in context: http://www.nabble.com/Facets-Action-Handling-tp22950859p22950859.html
Sent from the MyFaces - Users mailing list archive at Nabble.com.


Re: Facets Action Handling

Posted by Franco Ehrat <fr...@giniality.ch>.
For help I post also the code of the jsp:

<t:tree2 id="amsTree" value="#{amsConnectionsDataBean.rootTreeNode}"
		var="node" showRootNode="false" varNodeToggler="t">
		<f:facet name="agentManagementSystem">
			<h:panelGroup>
				<f:facet name="expand">
					<t:graphicImage value="/etc/images/tree/plugin.gif"
						rendered="#{t.nodeExpanded}" border="0" />
				</f:facet>
				<f:facet name="collapse">
					<t:graphicImage value="/etc/images/tree/plugin.gif"
						rendered="#{!t.nodeExpanded}" border="0" />
				</f:facet>
				<f:verbatim>
                    &nbsp;
                </f:verbatim>
				<h:outputText value="#{node.description}" />
			</h:panelGroup>
		</f:facet>
		<f:facet name="agentRuntime">
			<h:panelGroup>
				<f:facet name="expand">
					<t:graphicImage value="/etc/images/tree/plugin.gif"
						rendered="#{t.nodeExpanded}" border="0" />
				</f:facet>
				<f:facet name="collapse">
					<t:graphicImage value="/etc/images/tree/plugin.gif"
						rendered="#{!t.nodeExpanded}" border="0" />
				</f:facet>
				<f:verbatim>
                    &nbsp;
                </f:verbatim>
				<t:popup styleClass="popupMenu" id="agentRuntimePopup">
					<h:outputText value="#{node.description}" />
					<f:facet name="popup">
						<h:panelGroup>
							<h:panelGrid columns="1">
								<h:commandLink action="disconnect" value="#{button.disconnect}"
actionListener="#{t.setNodeSelected}" immediate="true">
									<t:updateActionListener
										property="#{treeNodeController.selectedTreeNode}"
										value="#{node}" />
									<f:actionListener
									
type="com.giniality.aay.v1.display.action.DCDisconnectAMSActionListener" />
								</h:commandLink>
								<htm:hr />
								<h:commandLink action="installBundle"
									value="#{button.installBundle}"
actionListener="#{t.setNodeSelected}" immediate="true">
									<t:updateActionListener
										property="#{treeNodeController.selectedTreeNode}"
										value="#{node}" />
								</h:commandLink>
							</h:panelGrid>
						</h:panelGroup>
					</f:facet>
				</t:popup>
			</h:panelGroup>
		</f:facet>
		<f:facet name="agentBundle">
			<h:panelGroup>
				<f:facet name="expand">
					<t:graphicImage value="/etc/images/tree/plugin.gif"
						rendered="#{t.nodeExpanded}" border="0" />
				</f:facet>
				<f:facet name="collapse">
					<t:graphicImage value="/etc/images/tree/plugin.gif"
						rendered="#{!t.nodeExpanded}" border="0" />
				</f:facet>
				<f:verbatim>
                    &nbsp;
                </f:verbatim>
				<t:popup styleClass="popupMenu" id="agentBundlePopup">
					<h:outputText value="#{node.description}" />
					<f:facet name="popup">
						<h:panelGroup>
							<h:panelGrid columns="1">
								<h:commandLink action="uninstallBundle"
									value="#{button.uninstallBundle}"
actionListener="#{t.setNodeSelected}" immediate="true">
									<t:updateActionListener
										property="#{treeNodeController.selectedTreeNode}"
										value="#{node}" />
									<f:actionListener
									
type="com.giniality.aay.v1.display.action.DCUninstallBundleActionListener"
/>
								</h:commandLink>
								<htm:hr />
								<h:commandLink action="startBundle"
									value="#{button.startBundle}" actionListener="#{t.setNodeSelected}"
immediate="true">
									<t:updateActionListener
										property="#{treeNodeController.selectedTreeNode}"
										value="#{node}" />
									<f:actionListener
									
type="com.giniality.aay.v1.display.action.DCStartBundleActionListener" />
								</h:commandLink>
								<h:commandLink action="stopBundle" value="#{button.stopBundle}"
actionListener="#{t.setNodeSelected}" immediate="true">
									<t:updateActionListener
										property="#{treeNodeController.selectedTreeNode}"
										value="#{node}" />
									<f:actionListener
									
type="com.giniality.aay.v1.display.action.DCStopBundleActionListener" />
								</h:commandLink>
								<htm:hr />
								<h:commandLink action="createInstance"
									value="#{button.createInstance}"
actionListener="#{t.setNodeSelected}" immediate="true">
									<t:updateActionListener
										property="#{treeNodeController.selectedTreeNode}"
										value="#{node}" />
									<f:actionListener
									
type="com.giniality.aay.v1.display.action.DCCreateInstanceActionListener" />
								</h:commandLink>
							</h:panelGrid>
						</h:panelGroup>
					</f:facet>
				</t:popup>
			</h:panelGroup>
		</f:facet>
		<f:facet name="agentInstance">
			<h:panelGroup>
				<f:facet name="expand">
					<t:graphicImage value="/etc/images/tree/plugin.gif"
						rendered="#{t.nodeExpanded}" border="0" />
				</f:facet>
				<f:facet name="collapse">
					<t:graphicImage value="/etc/images/tree/plugin.gif"
						rendered="#{!t.nodeExpanded}" border="0" />
				</f:facet>
				<f:verbatim>
                    &nbsp;
                </f:verbatim>
				<t:popup styleClass="popupMenu" id="agentInstancePopup">
					<h:outputText value="#{node.description}" />
					<f:facet name="popup">
						<h:panelGroup>
							<h:panelGrid columns="1">
								<h:commandLink action="destroyInstance"
									value="#{button.destroyInstance}"
actionListener="#{t.setNodeSelected}" immediate="true">
									<t:updateActionListener
										property="#{treeNodeController.selectedTreeNode}"
										value="#{node}" />
									<f:actionListener
									
type="com.giniality.aay.v1.display.action.DCDestroyInstanceActionListener"
/>
								</h:commandLink>
							</h:panelGrid>
						</h:panelGroup>
					</f:facet>
				</t:popup>
			</h:panelGroup>
		</f:facet>
	</t:tree2>

and the screenshot of the tree:
http://www.nabble.com/file/p22967248/a.png 


Franco Ehrat wrote:
> 
> Hi...
> 
> I'm just new in using Facets.
> Now I built a tree (tomahawk tree2) with defining type of tree node with
> using Facets.
> For specific Facets I'm using "popup" component to show links when mouse
> comes to a tree node.
> 
> My problem is now, that if I have an easy tree (1 parent, a few childs)
> and click to a link on a tree node, the underlying action will be executed
> for all children (tree nodes of the same type).
> 
> 
> Can anybody help me, what I hav to change, that the action will be
> executed just one time (for the selected tree node)?
> 
> Greetings
> Franco
> 

-- 
View this message in context: http://www.nabble.com/Facets-Action-Handling-tp22950859p22967248.html
Sent from the MyFaces - Users mailing list archive at Nabble.com.