treenode and styles bug or code issue?

UI Components for JSF
Post Reply
tcasasent
Posts: 21
Joined: 06 Jan 2010, 21:39

29 Jan 2010, 16:55

I'm using the nightly builds for 2.0 and IE and Firefox 3.5.7.

The elements I'm displaying in the tree all contain backslashes. When I first started, the backslashes caused issues with the tree, so I replaced with the appropriate character codes (\). This made everything work OK.

Then I added styles to my treenodes.

When the tree is first displayed, it does not process the character codes. That is, the labels for the nodes are all:

\foo\bar\

If I select one of the nodes, then when the tree is refreshed (to change the color of the selected node), it displays properly:

\foo\bar\

Here is my tree and treenode.

<p:tree id="mytree314"
value="#{TreeBean.mRoot}"
var="node"
dynamic="true"
cache="false"
nodeSelectListener="#{TreeBean.listenerNodeSelect}"
update="formSelectedNode,formButtons,mytree314"
>
<p:treeNode>
<h:outputText value="#{node.displayName}"
style="color: #{(TreeBean.mConceptKey==node.mConceptKey)?'#FF4444':'#4444FF' };" />
</p:treeNode>
</p:tree>

If I simplify style to a fixed color, the problem still occurs.

Any ideas?

Thanks,
Tod

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

29 Jan 2010, 18:55

Can you try escaping backslashes like;

"#{node.displayName}" should return \\foo\\bar\\

tcasasent
Posts: 21
Joined: 06 Jan 2010, 21:39

29 Jan 2010, 20:34

Escaping with that method gives the same sort of inconsistent processing.

In this case, the top level elements of the tree came out OK.

\foo\

But the elements below did not. They were "unescaped".

\\foo\\bar\\

Clicking on one of the \\foo\\bar\\ elements causes all "unescaped" elements to redraw properly.

But the elements not shown on the screen until their nodes are opened are still incorrect.

\\foo\\bar\\qwerrty\\

It really looks like the nodes are not processed identically each time the tree is displayed/updated.

-Tod

tcasasent
Posts: 21
Joined: 06 Jan 2010, 21:39

01 Feb 2010, 22:32

Tested with the latest build and I'm still getting the same problem.

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: Google [Bot] and 41 guests