*
*/
public static void updateMasterDetailPath(String thisBeanName, String label, Object id)
{
// Context session = Contexts.getSessionContext();
Context conversation = Contexts.getConversationContext();
if (!conversation.isSet("path"))
{
// Non esiste ancora
Stack<PathItem> path = new Stack<PathItem>();
path.push(new PathItem(thisBeanName, label, id));
conversation.set("path", path);
}
else
{
// Esiste
Stack<PathItem> path = (Stack<PathItem>) conversation.get("path");
if (path.contains(new PathItem(thisBeanName, label, null)))
{
PathItem item = path.peek();
while (!path.peek().getBeanName().equals(thisBeanName))
{
path.pop();
}
path.pop();
path.push(new PathItem(thisBeanName, label, id));
}
else
{
path.push(new PathItem(thisBeanName, label, id));
}
conversation.set("path", path);
}
}