try { FacesContext.getCurrentInstance().getExternalContext().dispatch(selectedViewId); } catch (IOException e) {  e.printStackTrace();
if(_selectedViewId==null || !_selectedViewId.equals(selectedViewId)){ _selectedViewId = selectedViewId;       try { ExternalContext extContext = FacesContext.getCurrentInstance().getExternalContext(); HttpServletRequest request = (HttpServletRequest)extContext.getRequest(); String requestURI = request.getRequestURI();  if(!requestURI.endsWith(selectedViewId)){  extContext.dispatch(selectedViewId); } } catch (IOException e) {  e.printStackTrace(); }
	public void setViewId(String selectedViewId) {		if (!_actionListenerAdded) {			addActionListener(this);			_actionListenerAdded = true;					}		_selectedViewId = selectedViewId;		//ActionEvent event = new ActionEvent(this);		//queueEvent(event);				//String viewId = this.getViewId();		//WFUtil.setViewRoot(selectedViewId);				try {			FacesContext.getCurrentInstance().getExternalContext().dispatch(selectedViewId);		}		catch (IOException e) {			// TODO Auto-generated catch block			e.printStackTrace();		}			}	