setDragMode on UIBackbaseWindow and UIBackbaseModal

Hi all,

I was expecting to see the set/getDragMode(..) method on both UIBackbaseWindow and UIBackbaseModal. I tried using the attribute on the client edition and found that the following worked as I expected, so I expected to find a mirror method on the JSF flavour.

The following code is taken from the examples in the Backbase Explorer. I have simply added dragMode to the window and modal declaration.

Modal Version

<b:modal label="Warning" id="exampleModal" padding="10px" dragConstraint="/*" icon="icon-bb-window" dragMode="real">
    You have pushed the button anyway. Luckily, nothing bad happened. </b:modal>

Normal Window

<b:window label="Window" id="window" width="500px" height="300px" left="100px" top="50px" open="false" dragConstraint=".." resizeConstraint=".." padding="5px" icon="icon-bb-window" dragMode="real">
    This window was opened by setting the open attribute to "true". The window can be closed, maximized or minimized by clicking on the buttons in the top right corner.
   <p>
       Use the "Open window" button again to re-open the window after closing. </p>
</b:window>

Thanks
Stuart

Additionally...

Is there a way to set window resizability for both modal and modeless windows?

Hi Stuart, For now you can

Hi Stuart,

For now you can set the attributes (dragMode, dragConstraint, resizeConstraint ) and corresponding values the following way using javaScript in within <bjsf:script/>.

<bjsf:window id="window02">
<bjsf:script>
<e:handler event="DOMNodeInsertedIntoDocument" type="text/javascript">
var oWindow = bb.document.getElementById('window02');
oWindow.setAttribute('dragConstraint', '..');
oWindow.setAttribute('resizeConstraint', '..');
oWindow.setAttribute('dragMode', 'real');
</e:handler>
</bjsf:script>
</bjsf:window>

If you require to set the attributes dynamically, this can be done client side or serverside via DeltaActionJavaScript

public void setDM(ActionEvent event)
{
BackbaseContext context = BackbaseContext.getCurrentInstance();
UIComponent destComp = ComponentUtils.findComponent(context.getViewRoot(),"window02");
String command = "var oWindow = bb.document.getElementById('window02');oWindow.setAttribute('dragMode', 'real');oWindow.setAttribute('dragConstraint', '..');oWindow.setAttribute('resizeConstraint', '..');";
DeltaActionJavaScript jsAction = new DeltaActionJavaScript(destComp, command);
context.addDeltaAction(jsAction);
}

Hope this helps

-Senaka