Skip to content

Commit

Permalink
Fix #228: allow tree visit anyway when model is empty (state saving)
Browse files Browse the repository at this point in the history
  • Loading branch information
Bauke Scholtz committed Apr 11, 2016
1 parent d467b4c commit cd97323
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/main/java/org/omnifaces/component/tree/Tree.java
Expand Up @@ -236,11 +236,17 @@ public Void invoke() {
*/
@Override
public boolean visitTree(final VisitContext context, final VisitCallback callback) {
TreeModel model = getModel(PhaseId.ANY_PHASE);

if (model.isLeaf()) {
return super.visitTree(context, callback);
}

if (!isVisitable(context)) {
return false;
}

return process(context.getFacesContext(), getModel(PhaseId.ANY_PHASE), new Callback.Returning<Boolean>() {
return process(context.getFacesContext(), model, new Callback.Returning<Boolean>() {
@Override
public Boolean invoke() {
VisitResult result = context.invokeVisitCallback(Tree.this, callback);
Expand Down

0 comments on commit cd97323

Please sign in to comment.