Search in sources :

Example 1 with UrlFragment

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){}");
    }
}
Also used : UrlFragment(org.wicketstuff.urlfragment.UrlFragment) AnnotatorState(de.tudarmstadt.ukp.clarin.webanno.api.annotation.model.AnnotatorState)

Example 2 with UrlFragment

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());
        }
    }
}
Also used : UrlFragment(org.wicketstuff.urlfragment.UrlFragment) OmUrlFragment(org.apache.openmeetings.web.util.OmUrlFragment)

Aggregations

UrlFragment (org.wicketstuff.urlfragment.UrlFragment)2 AnnotatorState (de.tudarmstadt.ukp.clarin.webanno.api.annotation.model.AnnotatorState)1 OmUrlFragment (org.apache.openmeetings.web.util.OmUrlFragment)1