Overriding MultiValueEditor Breaks edit-node-categories.jsp

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-25-2008 01:24 PM
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
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?
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?
Labels:
- Labels:
-
Archive
2 REPLIES 2

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-29-2008 06:31 AM
Can you post the code of your Java class ?
Denis
Denis

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-29-2008 06:27 PM
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
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
