DefaultTreeModel and Wicket Tree: setAsksAllowsChildren doesn't work

后端 未结 4 754
萌比男神i
萌比男神i 2021-01-24 08:49

I\'m using Wicket\'s Tree component in a web app. But empty folders are shown in a file-way. Just like this: \"enter

4条回答
  •  深忆病人
    2021-01-24 09:14

    The problem is with the line if(i < 4){ in the outer for loop. You allow the node to have children but you don't create any children for this last node.

    Edit: You are correct about the empty folder so my answer is incorrect. In Swing this works as expected. When the tree row is rendered the decision to draw a folder or file icon is based upon the flag setAsksAllowsChildren. So the problem seems to be on Wicket's tree component

提交回复
热议问题