• Anonymous
  • Login
  • Register
XPages Extension Library - Feature Request: pageTreeNode : selected property should be computable


Hi,

 Currently, thefor the PageTreeNode, the "selected" property does not accept hard coded or computed values.

I looked at the code and it looks for selection (a regexp) ... but does not use the computed expression if we put one in selected.

I suspect it can be true for other properties too, no checked yet.

 

Here is the modified method to correct this :(have to add a selected private variable, and save/restore it in state management part too).

 

 

@Override

public boolean isSelected() {

// Added by Michael : check for a value or a value binding first

if (null != this.selected) {

return this.selected;

}

ValueBinding _vb = getValueBinding("selected"); //$NON-NLS-1$

if (_vb != null) {

Boolean val = (java.lang.Boolean) _vb.getValue(FacesContext.getCurrentInstance());

if(val!=null) {

return val;

}

}

//  end : Added by Michael

 

// Look if there is a selection string and if it matches the navigation path

String selection = getSelection();

if(StringUtil.isNotEmpty(selection)) {

FacesContext ctx = FacesContext.getCurrentInstance();

ConversationState cs = ConversationState.get(ctx, false);

if(cs!=null) {

String navPath = cs.getNavigationPath();

if(StringUtil.isNotEmpty(navPath)) {

return navPath.matches(selection);

}

}

return false;

}

 

// Else if it points to a page, then see if the page matches

String page = ExtLibUtil.getPageXspUrl(getPage());

if(StringUtil.isNotEmpty(page)) {

FacesContext ctx = FacesContext.getCurrentInstance();

String currentPage = ((UIViewRootEx)ctx.getViewRoot()).getPageName();

return StringUtil.equals(page, currentPage);

}

 

return super.isSelected();

}




Taken Actions by Owners

No actions have been taken yet.


Documents
In this field you can enter the actual request.

You can use the rich text editor for rich text formating. You can also enter HTML to embed objects, e.g. to embed a YouTube video or a screenshot of the project. In this case use '[' and ']' to mark the passthrough HTML as such.

Please note that the first time you use the new UI your description is converted from rich text to MIME. You might want to copy and paste the raw plain text from the old UI in the new UI so that you don't loose information.
In this field owners can describe what they have done or want to do.

You can use the rich text editor for rich text formating. You can also enter HTML to embed objects, e.g. to embed a YouTube video or a screenshot of the project. In this case use '[' and ']' to mark the passthrough HTML as such.

Please note that the first time you use the new UI your description is converted from rich text to MIME. You might want to copy and paste the raw plain text from the old UI in the new UI so that you don't loose information.