You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@beehive.apache.org by Srini <k_...@yahoo.com> on 2005/04/24 04:11:05 UTC

Help me out on netui:tree tag

Hi,
 
I am trying out an example with the <netui:tree> and <netui:treeItem> and <netui:treeLabel> tags
 
I am getting the following error
 
Caught exception when evaluating expression "{session.myTree}" with available binding contexts [actionForm, pageFlow, globalApp, request, session, application, pageContext, bundle, container, url, pageInput]. Root cause: java.lang.RuntimeException: Can not evaluate the identifier "myTree" on a null value object
 
I am trying to use the same example that is  given in the documentation of netui:tree tag
 
<netui:tree
    dataSource="pageflow.myTree"
    selectionAction="treeState"
    tagId="myTree">
      <netui:treeItem expanded="true" >
          <netui:treeLabel>Root Folder</netui:treeLabel>
          <netui:treeItem expanded="false">
              <netui:treeLabel>I</netui:treeLabel>
              <netui:treeItem expanded="false">
                  <netui:treeLabel>A</netui:treeLabel>
                  <netui:treeItem>1</netui:treeItem>
                  <netui:treeItem>2</netui:treeItem>
              </netui:treeItem>
          </netui:treeItem>
      </netui:treeItem>
  </netui:tree>
 
Here is the code  in controller.jpf
 
        public Forward treeState() {
        TreeElement rootNode = this.getMyTree();
        String selectedNode = null;
        String expandedNode = null;
        selectedNode = getRequest().getParameter(TreeElement.SELECTED_NODE);
        expandedNode = getRequest().getParameter(TreeElement.EXPAND_NODE);
        if (expandedNode != null) {
            TreeElement node = rootNode.findNode(expandedNode);
            if (node != null) {
                node.setExpanded(!node.isExpanded());
            }
            return new Forward("tree");
        }
        return new Forward(selectedNode);
    }
 
I have "myTree" variable of type TreeElement in the controller.
 
I think an example of netui:tree on the beehive site will be very very helpful. 
 
Thanks
Srini
 

Re: Help me out on netui:tree tag

Posted by Eddie O'Neil <ek...@bea.com>.
   One other comment here; once the tree is exposed as a JavaBean 
property as Daryl mentioned, it should be bound in the JSP with an 
expression like:

   pageFlow.myTree

NetUI stores the current JPF under the key "pageFlow" as a request 
scoped JSP 2.0 EL implicit object.  As such, the attribute key is case 
sensitive.

   Hope that helps.

Eddie



Daryl Olander wrote:
> In Beehive, the variables being bound to for all expressions must be
> properties and not member variables in the page flow.
> 
> BTW, in Beehive the framework sill take care of selection/expansion
> for you if you bind to the same tree variable from request to request.
> 
> On 4/23/05, Srini <k_...@yahoo.com> wrote:
> 
>>Hi,
>>
>>I am trying out an example with the <netui:tree> and <netui:treeItem> and <netui:treeLabel> tags
>>
>>I am getting the following error
>>
>>Caught exception when evaluating expression "{session.myTree}" with available binding contexts [actionForm, pageFlow, globalApp, request, session, application, pageContext, bundle, container, url, pageInput]. Root cause: java.lang.RuntimeException: Can not evaluate the identifier "myTree" on a null value object
>>
>>I am trying to use the same example that is  given in the documentation of netui:tree tag
>>
>><netui:tree
>>    dataSource="pageflow.myTree"
>>    selectionAction="treeState"
>>    tagId="myTree">
>>      <netui:treeItem expanded="true" >
>>          <netui:treeLabel>Root Folder</netui:treeLabel>
>>          <netui:treeItem expanded="false">
>>              <netui:treeLabel>I</netui:treeLabel>
>>              <netui:treeItem expanded="false">
>>                  <netui:treeLabel>A</netui:treeLabel>
>>                  <netui:treeItem>1</netui:treeItem>
>>                  <netui:treeItem>2</netui:treeItem>
>>              </netui:treeItem>
>>          </netui:treeItem>
>>      </netui:treeItem>
>>  </netui:tree>
>>
>>Here is the code  in controller.jpf
>>
>>        public Forward treeState() {
>>        TreeElement rootNode = this.getMyTree();
>>        String selectedNode = null;
>>        String expandedNode = null;
>>        selectedNode = getRequest().getParameter(TreeElement.SELECTED_NODE);
>>        expandedNode = getRequest().getParameter(TreeElement.EXPAND_NODE);
>>        if (expandedNode != null) {
>>            TreeElement node = rootNode.findNode(expandedNode);
>>            if (node != null) {
>>                node.setExpanded(!node.isExpanded());
>>            }
>>            return new Forward("tree");
>>        }
>>        return new Forward(selectedNode);
>>    }
>>
>>I have "myTree" variable of type TreeElement in the controller.
>>
>>I think an example of netui:tree on the beehive site will be very very helpful.
>>
>>Thanks
>>Srini
>>
>>
> 
> 


Re: Help me out on netui:tree tag

Posted by Daryl Olander <do...@gmail.com>.
In Beehive, the variables being bound to for all expressions must be
properties and not member variables in the page flow.

BTW, in Beehive the framework sill take care of selection/expansion
for you if you bind to the same tree variable from request to request.

On 4/23/05, Srini <k_...@yahoo.com> wrote:
> Hi,
> 
> I am trying out an example with the <netui:tree> and <netui:treeItem> and <netui:treeLabel> tags
> 
> I am getting the following error
> 
> Caught exception when evaluating expression "{session.myTree}" with available binding contexts [actionForm, pageFlow, globalApp, request, session, application, pageContext, bundle, container, url, pageInput]. Root cause: java.lang.RuntimeException: Can not evaluate the identifier "myTree" on a null value object
> 
> I am trying to use the same example that is  given in the documentation of netui:tree tag
> 
> <netui:tree
>     dataSource="pageflow.myTree"
>     selectionAction="treeState"
>     tagId="myTree">
>       <netui:treeItem expanded="true" >
>           <netui:treeLabel>Root Folder</netui:treeLabel>
>           <netui:treeItem expanded="false">
>               <netui:treeLabel>I</netui:treeLabel>
>               <netui:treeItem expanded="false">
>                   <netui:treeLabel>A</netui:treeLabel>
>                   <netui:treeItem>1</netui:treeItem>
>                   <netui:treeItem>2</netui:treeItem>
>               </netui:treeItem>
>           </netui:treeItem>
>       </netui:treeItem>
>   </netui:tree>
> 
> Here is the code  in controller.jpf
> 
>         public Forward treeState() {
>         TreeElement rootNode = this.getMyTree();
>         String selectedNode = null;
>         String expandedNode = null;
>         selectedNode = getRequest().getParameter(TreeElement.SELECTED_NODE);
>         expandedNode = getRequest().getParameter(TreeElement.EXPAND_NODE);
>         if (expandedNode != null) {
>             TreeElement node = rootNode.findNode(expandedNode);
>             if (node != null) {
>                 node.setExpanded(!node.isExpanded());
>             }
>             return new Forward("tree");
>         }
>         return new Forward(selectedNode);
>     }
> 
> I have "myTree" variable of type TreeElement in the controller.
> 
> I think an example of netui:tree on the beehive site will be very very helpful.
> 
> Thanks
> Srini
> 
>