I'm making xhtml page with master-detail view pattern. In master panel I use tree component from PrimeFaces. Name of child branch must contain 4 nonbreaking space as a divider of brand, colour and year and use tag for type attribute. I use tag with concatenation String in value. Is it possible to use tag in JSF and more than one nonbreaking space in value ? Because all spaces are eliminated automatically.
fragment of home.xhtml
<p:tree id="tree1" value="#{treeDNDView.root1}" var="node" .... >
<p:treeNode>
<h:outputText value="#{node}"/>
</p:treeNode>
</p:tree>
fragment of Car.java
@Override public String toString() {
String result = "";
if(year != "")
result += " brand" + brand + " ";
if(color != "")
result += " color" + color + " ";
if(year != "")
result += " year" + year;
return result;
}
fragment of DragDropView.java
@ManagedBean(name="treeDNDView")
@ViewScoped
public class DragDropView implements Serializable {
private TreeNode root1;
private String year;
private String color;
private String brand;
// setters getters
@PostConstruct
public void init() {
root1 = new DefaultTreeNode(new Car("Transport", "", "", ""), null);
TreeNode cabrio1 = new DefaultTreeNode(new Car("004", "1991", "Red", "Toyota"), root1);}
Output example: brand Toyota color Red year 1991
Need: brand Toyota (4 spaces) color Red (4 spaces) year 1991