Board index JavaServer Faces General Dashboard with dynamic source

Dashboard with dynamic source

Components, Ajax Framework, Utilities and More.

Post 27 Jan 2011, 19:45

Posts: 4
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?

<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="#{}" />
         <p:draggable for="travel" dashboard="board" helper="clone"/>

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

Posts: 13
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:

<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="#{}" 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
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):

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);
            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.


Posts: 17241
Location: Cybertron

Thanks for sharing.

Return to General