cancel
Showing results for 
Search instead for 
Did you mean: 

Overriding MultiValueEditor Breaks edit-node-categories.jsp

stevewickii
Champ in-the-making
Champ in-the-making
I copied org/alfresco/web/ui/repo/component/UIMultiValueEditor.java to com/nkics/alfrescox/web/ui/repo/component/UIMultiValueEditorEx.java and modified the broadcast() method to handle Collections differently.

Then I added it to my faces-config-custom.xml
   <component>
      <component-type>org.alfresco.faces.MultiValueEditor</component-type>
      <component-class>com.nkics.alfrescox.web.ui.repo.component.UIMultiValueEditorEx</component-class>
   </component>

Then I integrated the UIMultiValueEditorEx.class and faces-config-custom.xml into my alfresco.war.

When I open a document in document-details.jsp, then click on the edit categories icon (edit-node-categories.jsp), the JSP loads but the Category Selector does not display on the page, and there are absolutely NO errors in the log files, standard out, or on the page.  I set a breakpoint on all of the methods and constructors in UIMultiValueEditorEx, and found that JSF is creating an instance of UIMultiValueEditorEx.  I just cannot figure out why the component is not rendering on the web page.  Can anyone help?
2 REPLIES 2

dgenard
Champ on-the-rise
Champ on-the-rise
Can you post the code of your Java class ?
Denis

stevewickii
Champ in-the-making
Champ in-the-making
I figured it out!

It was not rendering because BaseMultiValueRenderer.encodeBegin(…) does nothing if the component is not an instance of UIMultiValueEditor.  encodeEnd() does the same.  This is why I didn't see an error message, and nothing was displayed in the browser.

I ended up copying UIMultiValueEditor.java to UIMultiValueEditorEx.java.
I modified the class declaration so that UIMultiValueEditorEx extends UIMultiValueEditor, so that BaseMultiValueRenderer would render the component.
I modified UIMultiValueEditorEx.broadcast(…) to handle Collections, and that was it!

I will document my change to the Category Selector in this thread: http://forums.alfresco.com/viewtopic.php?f=3&t=12018