mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Fixed refresh issue with sidebar actions
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@4568 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -73,9 +73,9 @@ public class UISidebar extends SelfRenderingComponent
|
|||||||
out.write("<div id=\"sidebar\">");
|
out.write("<div id=\"sidebar\">");
|
||||||
|
|
||||||
// render the start of the header panel
|
// render the start of the header panel
|
||||||
PanelGenerator.generatePanelStart(out,
|
PanelGenerator.generatePanelStart(out,
|
||||||
context.getExternalContext().getRequestContextPath(),
|
context.getExternalContext().getRequestContextPath(),
|
||||||
"blue", "#D3E6FE");
|
"blue", "#D3E6FE");
|
||||||
|
|
||||||
// generate the required child components if not present
|
// generate the required child components if not present
|
||||||
if (this.getChildCount() == 1)
|
if (this.getChildCount() == 1)
|
||||||
@@ -110,27 +110,20 @@ public class UISidebar extends SelfRenderingComponent
|
|||||||
createComponent("org.alfresco.faces.Actions");
|
createComponent("org.alfresco.faces.Actions");
|
||||||
actions.setId("sidebarActions");
|
actions.setId("sidebarActions");
|
||||||
actions.setShowLink(false);
|
actions.setShowLink(false);
|
||||||
// TODO: we need to setup the context for the actions component
|
setupActionGroupId(context, actions);
|
||||||
// but when the app first starts there is no context yet,
|
|
||||||
// also the tree will not update the context as it is
|
|
||||||
// navigated so what do we use? we may have to only support
|
|
||||||
// global non-context actions
|
|
||||||
String actionsGroupId = null;
|
|
||||||
SidebarConfigElement config = SidebarBean.getSidebarConfig(context);
|
|
||||||
if (config != null)
|
|
||||||
{
|
|
||||||
SidebarPluginConfig plugin = config.getPlugin(getActivePlugin());
|
|
||||||
if (plugin != null)
|
|
||||||
{
|
|
||||||
actionsGroupId = plugin.getActionsConfigId();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
actions.setValue(actionsGroupId);
|
|
||||||
|
|
||||||
// add components to the sidebar
|
// add components to the sidebar
|
||||||
this.getChildren().add(0, modeList);
|
this.getChildren().add(0, modeList);
|
||||||
this.getChildren().add(1, actions);
|
this.getChildren().add(1, actions);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// update the child UIActions component with the correct
|
||||||
|
// action group id and clear it's current children
|
||||||
|
UIActions actions = (UIActions)this.getChildren().get(1);
|
||||||
|
actions.getChildren().clear();
|
||||||
|
setupActionGroupId(context, actions);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -217,7 +210,28 @@ public class UISidebar extends SelfRenderingComponent
|
|||||||
{
|
{
|
||||||
this.activePlugin = activePlugin;
|
this.activePlugin = activePlugin;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets up the corrent actions config group id on the given actions
|
||||||
|
* component.
|
||||||
|
*
|
||||||
|
* @param context Faces context
|
||||||
|
* @param actionsComponent The actions component to set the group id for
|
||||||
|
*/
|
||||||
|
protected void setupActionGroupId(FacesContext context, UIActions actionsComponent)
|
||||||
|
{
|
||||||
|
String actionsGroupId = null;
|
||||||
|
SidebarConfigElement config = SidebarBean.getSidebarConfig(context);
|
||||||
|
if (config != null)
|
||||||
|
{
|
||||||
|
SidebarPluginConfig plugin = config.getPlugin(getActivePlugin());
|
||||||
|
if (plugin != null)
|
||||||
|
{
|
||||||
|
actionsGroupId = plugin.getActionsConfigId();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
actionsComponent.setValue(actionsGroupId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user