Search in sources :

Example 6 with ValidationResult

use of org.olat.core.gui.render.ValidationResult in project openolat by klemens.

the class GuiStackNiceImpl method pushCallout.

@Override
public void pushCallout(Component content, String targetId, CalloutSettings settings) {
    // wrap the component into a modal foreground dialog with alpha-blended-background
    final Panel guiMsgPlace = new Panel("guimsgplace_for_callout");
    VelocityContainer inset = new VelocityContainer("inset", VELOCITY_ROOT + "/callout.html", null, null) {

        public void validate(UserRequest ureq, ValidationResult vr) {
            super.validate(ureq, vr);
            // just before rendering, we need to tell the windowbackoffice that we are a favorite for accepting gui-messages.
            // the windowbackoffice doesn't know about guimessages, it is only a container that keeps them for one render cycle
            List<ZIndexWrapper> zindexed = wbo.getGuiMessages();
            zindexed.add(new ZIndexWrapper(guiMsgPlace, 10));
        }
    };
    inset.put("cont", content);
    inset.put("guimsgplace", guiMsgPlace);
    inset.contextPut("guimsgtarget", targetId);
    int zindex = 900 + (modalLayers * 100) + 5;
    inset.contextPut("zindexoverlay", zindex + 1);
    inset.contextPut("zindexshim", zindex);
    inset.contextPut("zindexarea", zindex + 5);
    inset.contextPut("zindexextwindows", zindex + 50);
    if (settings != null) {
        inset.contextPut("arrow", settings.isArrow());
        inset.contextPut("orientation", settings.getOrientation().name());
    } else {
        inset.contextPut("arrow", Boolean.TRUE);
        inset.contextPut("orientation", CalloutOrientation.bottom.name());
    }
    modalPanel.pushContent(inset);
    modalLayers++;
}
Also used : SimpleStackedPanel(org.olat.core.gui.components.panel.SimpleStackedPanel) LayeredPanel(org.olat.core.gui.components.panel.LayeredPanel) Panel(org.olat.core.gui.components.panel.Panel) StackedPanel(org.olat.core.gui.components.panel.StackedPanel) ZIndexWrapper(org.olat.core.gui.control.util.ZIndexWrapper) ValidationResult(org.olat.core.gui.render.ValidationResult) UserRequest(org.olat.core.gui.UserRequest) VelocityContainer(org.olat.core.gui.components.velocity.VelocityContainer)

Aggregations

ValidationResult (org.olat.core.gui.render.ValidationResult)6 UserRequest (org.olat.core.gui.UserRequest)4 LayeredPanel (org.olat.core.gui.components.panel.LayeredPanel)4 Panel (org.olat.core.gui.components.panel.Panel)4 SimpleStackedPanel (org.olat.core.gui.components.panel.SimpleStackedPanel)4 StackedPanel (org.olat.core.gui.components.panel.StackedPanel)4 VelocityContainer (org.olat.core.gui.components.velocity.VelocityContainer)4 ZIndexWrapper (org.olat.core.gui.control.util.ZIndexWrapper)4 IOException (java.io.IOException)2 ArrayList (java.util.ArrayList)2 HttpServletRequest (javax.servlet.http.HttpServletRequest)2 HttpServletResponse (javax.servlet.http.HttpServletResponse)2 MapperKey (org.olat.core.dispatcher.mapper.manager.MapperKey)2 GlobalSettings (org.olat.core.gui.GlobalSettings)2 Windows (org.olat.core.gui.Windows)2 InvalidRequestParameterException (org.olat.core.gui.components.form.flexible.impl.InvalidRequestParameterException)2 ChiefController (org.olat.core.gui.control.ChiefController)2 Command (org.olat.core.gui.control.winmgr.Command)2 JSCommand (org.olat.core.gui.control.winmgr.JSCommand)2 MediaResourceMapper (org.olat.core.gui.control.winmgr.MediaResourceMapper)2