use of org.wicketstuff.urlfragment.UrlFragment in project webanno by webanno.
the class AnnotationPage method updateUrlFragment.
private void updateUrlFragment(AjaxRequestTarget aTarget) {
if (aTarget != null) {
AnnotatorState state = getModelObject();
UrlFragment fragment = new UrlFragment(aTarget);
// Current project
fragment.putParameter(PAGE_PARAM_PROJECT_ID, state.getDocument().getProject().getId());
// Current document
fragment.putParameter(PAGE_PARAM_DOCUMENT_ID, state.getDocument().getId());
// Current focus unit
if (state.getFocusUnitIndex() > 0) {
fragment.putParameter(PAGE_PARAM_FOCUS, state.getFocusUnitIndex());
} else {
fragment.removeParameter(PAGE_PARAM_FOCUS);
}
// If we do not manually set editedFragment to false, then changing the URL
// manually or using the back/forward buttons in the browser only works every
// second time. Might be a but in wicketstuff urlfragment... not sure.
aTarget.appendJavaScript("try{if(window.UrlUtil){window.UrlUtil.editedFragment = false;}}catch(e){}");
}
}
use of org.wicketstuff.urlfragment.UrlFragment in project openmeetings by apache.
the class MainPanel method updateContents.
public void updateContents(OmUrlFragment f, IPartialPageRequestHandler handler, boolean updateFragment) {
BasePanel npanel = getPanel(f.getArea(), f.getType());
if (npanel != null) {
if (getClient() != null) {
updateContents(npanel, handler);
} else {
this.panel = npanel;
}
if (updateFragment) {
UrlFragment uf = new UrlFragment(handler);
uf.set(f.getArea().name(), f.getType());
}
}
}
Aggregations