Fix to handle edit properties failure when the uifacets aspect has been applied to a content type

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@3679 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Gavin Cornwell
2006-09-04 14:34:59 +00:00
parent a0dda61597
commit 7f29160f72
2 changed files with 33 additions and 19 deletions

View File

@@ -40,6 +40,7 @@ warning_inline=This is only recommended for HTML or plain text documents.
categories_description=This view allows you to browse and modify the categories hiearchy. categories_description=This view allows you to browse and modify the categories hiearchy.
new_category_description=Enter information about the new Category then click Create Category. new_category_description=Enter information about the new Category then click Create Category.
status_message_default=No messages. status_message_default=No messages.
no_icons_found=No icons found
# UI Component messages # UI Component messages
yes=Yes yes=Yes

View File

@@ -25,6 +25,7 @@ import javax.faces.component.UIComponent;
import javax.faces.component.UIInput; import javax.faces.component.UIInput;
import javax.faces.context.FacesContext; import javax.faces.context.FacesContext;
import javax.faces.context.ResponseWriter; import javax.faces.context.ResponseWriter;
import javax.faces.el.PropertyNotFoundException;
import org.alfresco.config.Config; import org.alfresco.config.Config;
import org.alfresco.config.ConfigElement; import org.alfresco.config.ConfigElement;
@@ -162,34 +163,46 @@ public class ImagePickerRadioRenderer extends BaseRenderer
} }
else else
{ {
// get the child components try
for (Iterator i = imagePicker.getChildren().iterator(); i.hasNext(); /**/)
{ {
UIComponent child = (UIComponent)i.next(); // get the child components
if (child instanceof UIListItems) for (Iterator i = imagePicker.getChildren().iterator(); i.hasNext(); /**/)
{ {
// get the value of the list items component and iterate UIComponent child = (UIComponent)i.next();
// through it's collection if (child instanceof UIListItems)
Object listItems = ((UIListItems)child).getValue();
if (listItems instanceof Collection)
{ {
Iterator iter = ((Collection)listItems).iterator(); // get the value of the list items component and iterate
while (iter.hasNext()) // through it's collection
Object listItems = ((UIListItems)child).getValue();
if (listItems instanceof Collection)
{ {
UIListItem item = (UIListItem)iter.next(); Iterator iter = ((Collection)listItems).iterator();
if (item.isRendered()) while (iter.hasNext())
{ {
renderItem(context, out, imagePicker, item, onclick); UIListItem item = (UIListItem)iter.next();
if (item.isRendered())
{
renderItem(context, out, imagePicker, item, onclick);
}
} }
} }
} }
else if (child instanceof UIListItem && child.isRendered() == true)
{
// found a valid UIListItem child to render
UIListItem item = (UIListItem)child;
renderItem(context, out, imagePicker, item, onclick);
}
} }
else if (child instanceof UIListItem && child.isRendered() == true) }
{ catch (PropertyNotFoundException pnfe)
// found a valid UIListItem child to render {
UIListItem item = (UIListItem)child; // handle the scenario where the bean does not have the
renderItem(context, out, imagePicker, item, onclick); // method specified in the value binding expression
} if (logger.isWarnEnabled())
logger.warn("Failed to retrieve icons: " + pnfe.toString());
out.write(Application.getMessage(context, "no_icons_found"));
} }
} }