2013年12月19日星期四

java how to write the menu on the left tree

action in the transfer of the code below:
public String listValueStandard(){
System.out.println("listValueStandard");
List<ValueStandard> types=basicNormService.getAllValueStandard();
List<TreeJson> trees = new ArrayList<TreeJson>();
for(int i=0;i<types.size();i++){
TreeJson json = new TreeJson();
json.setId(types.get(i).getValueStandardId()+"");
System.out.println("pid"+types.get(i).getParentId());
if(types.get(i).getParentId()==null){
json.setPid(null);
}else{
json.setPid(types.get(i).getParentId()+"");
}
json.setText(types.get(i).getName());
trees.add(json);
}
List<TreeJson> jsons = ListToTree.formatTree(trees);
JSONArray jsonarray=JSONArray.fromObject(types);
listValueStandard=jsonarray.toString();
return "tovaluestandard";
}


write unable retrieval success , the following is called the tree

entity classes :
 

public class ValueStandard implements java.io.Serializable {

// Fields

private Integer valueStandardId;
private Integer parentId;
private String name;
private String note;
private String sequence;

// Constructors

/** default constructor */
public ValueStandard() {
}

/** minimal constructor */
public ValueStandard(Integer parentId) {
this.parentId = parentId;
}

/** full constructor */
public ValueStandard(Integer parentId, String name, String note,
String sequence) {
this.parentId = parentId;
this.name = name;
this.note = note;
this.sequence = sequence;
}

// Property accessors

public Integer getValueStandardId() {
return this.valueStandardId;
}

public void setValueStandardId(Integer valueStandardId) {
this.valueStandardId = valueStandardId;
}

public Integer getParentId() {
return this.parentId;
}

public void setParentId(Integer parentId) {
this.parentId = parentId;
}

public String getName() {
return this.name;
}

public void setName(String name) {
this.name = name;
}

public String getNote() {
return this.note;
}

public void setNote(String note) {
this.note = note;
}

public String getSequence() {
return this.sequence;
}

public void setSequence(String sequence) {
this.sequence = sequence;
}

}

------ Solution ------------------------------------- -------
java tree menu on the left to do http://blog.sina.com.cn/s/blog_6c7f922d0100q9xo.html
------ Solution ---------------------------------------- ----
do it in the page , with the z-tree, well used
------ Solution ------------------- -------------------------
tree menu can be done is ugly
------ Solution ----- ---------------------------------------
a look at how to achieve a recursive algorithm , imitate what you can . This simple recursive menu easier to achieve
------ Solution ------------------------------- -------------
entity class encapsulates error
------ Solution -------------------- ------------------------
feel easyUI foreground framework written in this more convenient
------ Solution ---- ----------------------------------------
http://blog.csdn .net/yeness/article/details/9496647
------ Solution ------------------------------ --------------
after setting up the data sets in the foreground show , this is a graphic design in general , and their own words to the Internet to look for your favorite style , but also a lot of
------ Solution ---------------------------------------- ----

I 've written a tree , and now mainly to the transfer of this tree , as an attribute of another one table.  


Oh misunderstood you mean, you want to call is now showing a tree in another page? If so you can use ajax call to this method alone extracted directly return a json string or data can be of
------ Solution --------------- -----------------------------
http://www.ztree.me/v3/demo.php
------ For reference only ---------- -----------------------------
their top .
------ For reference only -------------------------------------- -

Well using easyUI reception
------ For reference only ---------------------- -----------------

I 've written a tree , and now mainly to the transfer of this tree , as an attribute of another one table.
------ For reference only -------------------------------------- -

I 've written a tree , and now mainly to the transfer of this tree , as an attribute of another one table. Write
how to modify the above action
------ For reference only --------------------------- ------------

I 've written a tree , and now mainly to the transfer of this tree , as an attribute of another one table.          
  
  
Oh misunderstood you mean, you want to call is now showing a tree in another page? If so you can use ajax call to this method alone extracted directly return a json string or the data can be  
Well I use ajax, but backstage action retrieval tree method is not so, the above is the transfer of a tree way I write, but can not be adjusted to take, you help me look at the code , where there are problems.
------ For reference only -------------------------------------- -
been resolved , thank you.

没有评论:

发表评论