Dashboard with dynamic source

Components, Ajax Framework, Utilities and More.
Post Reply
Posts: 4
Joined: 27 Jan 2011, 19:21

27 Jan 2011, 19:45

Hi All,
I came across one situation when using dashboard component of primefaces.
Running code bellow gives me following error
Caused by: javax.faces.FacesException: Cannot find dashboard "board" in view
What could be possible solution if I need to have scenario like following?

Code: Select all

<p:growl id="growl" showDetail="true" />
<p:dashboard id="board" model="#{dashboardBean.model}" 
<ui:repeat var="species" value="#{dashboardBean.speciesList}">
			<p:panel id="travel" header="Travel" toggleable="true" closable="true" style="width:200px">
		                <h:outputText value="#{species.name}" />
			<p:draggable for="travel" dashboard="board" helper="clone"/>

Posts: 4
Joined: 27 Jan 2011, 19:21

27 Jan 2011, 21:19

Sorry for bothering,
adding full path for board as dashboard=":board" helped me out

Posts: 13
Joined: 24 Oct 2011, 14:40

24 Nov 2011, 18:23

Sorry for re-opening this thread,
but I have exactly the same problem, and I've tried with the ":board" id for the draggable's dashboard attribute, but still it does not find the component in the tree.
here the code:

Code: Select all

<ui:define name="centerArea">	
				<p:fieldset legend="Available Widgets" styleClass="hidden startClosed avWidget">
					<p:dataGrid id="availableWidgets" var="widget" value="#{dashboardBean.availableWidgets}" columns="1">
							<p:panel id="pnl" header="#{widget.name}" style="text-align:center">
								<h:panelGrid columns="1" style="width:100%">
									<h:outputText value="#{widget.description}" />
							<!--p:draggable for="pnl" revert="true" helper="clone" handle=".ui-panel-titlebar" stack=".ui-panel" opacity="0.3" scope="w" dashboard="board" /-->
							<p:draggable for="pnl"  helper="clone" dashboard=":board" />

			<p:dashboard id="board" model="#{dashboardBean.dashboardModel}" style="min-height: 400px;">
				<p:panel id="sports">
			              Sports Content
				<p:ajax event="reorder" listener="#{dashboardBean.handleReorder}" />
Strangely the component is not found, even if the whole UIView root is traversed!
Could somebody help me?

Thanks and regards,

Posts: 13
Joined: 24 Oct 2011, 14:40

28 Nov 2011, 09:47

I've figured out the correct id to use in order for JSF to find my component.
The problem was that the dashboard component with id 'board' was under a htmlform named 'centerAreaForm'.
Going through the JSF componentBase class, the findComponent method (here below):

Code: Select all

private static UIComponent findComponent(UIComponent base,
                                             String id,
                                             boolean checkId) {
        if (checkId && id.equals(base.getId())) {
            return base;
        // Search through our facets and children
        UIComponent result = null;
        for (Iterator i = base.getFacetsAndChildren(); i.hasNext();) {
            UIComponent kid = (UIComponent) i.next();
            if (!(kid instanceof NamingContainer)) {
                if (checkId && id.equals(kid.getId())) {
                    result = kid;
                result = findComponent(kid, id, true);
                if (result != null) {
            } else if (id.equals(kid.getId())) {
                result = kid;
        return (result);

does not search recursively 'NamingContainer' objects. Since the HTMLForm is a NamingContainer, that part of the tree was skipped.
Changing the id to lookup in ':centerAreaForm:board' in my example above fixed the problem, sinche first is the NamingContainer resolved, and the the board.


User avatar
Posts: 17420
Joined: 05 Jan 2009, 00:21
Location: Cybertron

28 Nov 2011, 10:13

Thanks for sharing.

Post Reply
  • Information
  • Who is online

    Users browsing this forum: Bing [Bot] and 5 guests