return viewId;
}
private void updateViewChainAttribute(String mode, String viewId, boolean modeChanged)
{
QueryString qs = new QueryString("UTF8");
// always encode the mode in the viewId as this is used for mode transitions
qs.setParameter(Bridge.PORTLET_MODE_PARAMETER, mode);
if (!modeChanged)
{
// Build a QueryString from the request's render parameters so can preserve
// with the viewId
Map m = getRequestParameterValuesMap();
if (!m.isEmpty())
{
Set <Map.Entry<String, String[]>> set = m.entrySet();
Iterator <Map.Entry<String,String[]>> i = set.iterator();
while (i.hasNext())
{
Map.Entry<String,String[]> e = i.next();
// only add if not a viewId or viewState parameter
if (!e.getKey().equals(JSF_TARGET_VIEWID_RENDER_PARAMETER)
&& !e.getKey().equals(ResponseStateManager.VIEW_STATE_PARAM))
{
for (String s : e.getValue())
{
qs.addParameter(e.getKey(), s);
}
}
}
}
}
String toAppend = qs.toString();
StringBuffer sb = new StringBuffer(viewId.length() + toAppend.length() + 1);
viewId = sb.append(viewId).append("?").append(toAppend).toString();
// Now add to the appropriate session attribute based on Mode
Map sessionMap = getSessionMap();