12-20-2010 04:55 AM
package com.example.web.bean;
import org.alfresco.web.bean.search.AdvancedSearchDialog;
public class CustomAdvancedSearchDialog extends AdvancedSearchDialog {
protected String example = new String("Example");
public String getExample() {
return this.example;
}
public void setExample(String example) {
this.example = example;
}
}
2. I have added a manage bean in META-INF/faces-config.xml
<!– Advanced Search –>
<managed-bean>
<description>
The bean that holds a state for the Advanced Search screen.
</description>
<managed-bean-name>CustomAdvancedSearchDialog</managed-bean-name>
<managed-bean-class>com.example.web.bean.CustomAdvancedSearchDialog</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
<managed-property>
<property-name>navigator</property-name>
<value>#{NavigationBean}</value>
</managed-property>
<managed-property>
<property-name>nodeService</property-name>
<value>#{NodeService}</value>
</managed-property>
<managed-property>
<property-name>namespaceService</property-name>
<value>#{NamespaceService}</value>
</managed-property>
<managed-property>
<property-name>searchService</property-name>
<value>#{SearchService}</value>
</managed-property>
<managed-property>
<property-name>permissionService</property-name>
<value>#{PermissionService}</value>
</managed-property>
<managed-property>
<property-name>properties</property-name>
<value>#{SearchProperties}</value>
</managed-property>
</managed-bean>
<!– Advanced Search –>
<navigation-rule>
<from-view-id>/jsp/*</from-view-id>
<navigation-case>
<from-outcome>advSearch</from-outcome>
<to-view-id>/jsp/extension/search/advanced-search.jsp</to-view-id>
</navigation-case>
</navigation-rule>
<bean id="CustomAdvancedSearchDialog" class="com.example.web.bean.CustomAdvancedSearchDialog" >
</bean>
<h:outputText value="#{CustomAdvancedSearchDialog.example}"/>
And it works
<h:outputText value="#{CustomAdvancedSearchDialog.categoriesDataModel.rowCount}"/>
it doesn't work.
javax.faces.FacesException: javax.faces.el.EvaluationException: Cannot get value for expression '#{CustomAdvancedSearchDialog.categoriesDataModel.rowCount != 0}'
caused by:
org.apache.jasper.JasperException: javax.faces.el.EvaluationException: Cannot get value for expression '#{CustomAdvancedSearchDialog.categoriesDataModel.rowCount != 0}'
caused by:
javax.faces.el.EvaluationException: Cannot get value for expression '#{CustomAdvancedSearchDialog.categoriesDataModel.rowCount != 0}'
caused by:
javax.faces.el.EvaluationException: Exception getting value of property categoriesDataModel of base of type : com.example.web.bean.CustomAdvancedSearchDialog
caused by:
javax.faces.el.EvaluationException: Bean: es.citic.web.bean.CustomAdvancedSearchDialog, property: categoriesDataModel
caused by:
java.lang.reflect.InvocationTargetException
caused by:
java.lang.NullPointerException
When you extend a class in java, the class keeps the methods of parent class, doesn't it?, 12-22-2010 04:07 AM
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.