Update / 24.10.2014
Small corrections for the component, eg. opening the same window again is working, and there is a fallback option in case the window is already opened.
Purpose
Generic Drag & Drop Control for all use cases. I have styled it a bit, now it can be used.
This component is created as response to APPLICATION.openNewWindow when upper limit to URL length is hit
How does it looks like?
the URL boundaries (2048 characters or so) can be only overcome via POST method.
Available Properties
Property Name | Description |
---|---|
url | Url which should be opened |
windowId | NEW (24.10.2014) Id for the window (same id means that the window can be reused) |
fallbackSencario | NEW (24.10.2014) option to decide what to do in case the window is already open |
Scripting Functions (preview)
Scripts | Short Description |
---|---|
void setWindowId ( /**window id*/String windowId) | NEW (24.10.2014) you can set window id to open more windows |
void setUrl ( /**url*/String url) | NEW (24.10.2014) you can set the url per script |
void triggerExecution () | triggers the execution of opening the URL |
void addParameter ( /**name*/String name, /**value*/String value) | allows to add parameters to the URL via name / value pairs |
void removeAllParameters () | removes all parameters |
Example Implementation for this call:
OPENWINDOWPOST_1.removeAllParameters(); OPENWINDOWPOST_1.setUrl("http://localhost:55555/aad/web.do"); OPENWINDOWPOST_1.addParameter("APPLICATION", "SDK_OPENWINDOW_POST"); OPENWINDOWPOST_1.addParameter("designersessionid", "25d9c2721c084d8c98684721835379d8"); OPENWINDOWPOST_1.triggerExecution();
Comparison before and after
Assumption:
you want to call URL http://localhost:8080/web.do?P1=V1&P2=V2
Technical View:
URL: http://localhost:8080/web.do
Param1: P1
Value1: V1
Param2: P2
Value2: V2
Your code before:
var url = "http://localhost:8080/web.do"; url = url + "?"; url = url + "P1" + "=" + "V1"; url = url + "P2" + "=" + "V2"; APPLICATION.openNewWindow(url);
Your code after:
1) in Properties View you have tto set the url property to "http://localhost:8080/web.do"
2) in script you need to add all parameters:
OPENWINDOWPOST_1.removeAllParameters(); OPENWINDOWPOST_1.addParameter("P1", "V1"); OPENWINDOWPOST_1.addParameter("P2", "V2"); OPENWINDOWPOST_1.triggerExecution();
This code will create a "form" in browser and submit the content via POST.
Example Application
An Application with example can be downloaded at the BIAPP Repository:
- KarolKalisz/DesignStudioBiAppRepository · GitHub
- or take it as newest ZIP: Releases · KarolKalisz/DesignStudioBiAppRepository · GitHub
Releases
Source Code & Licensing
This component is for free use. It is under the Open Source Apache Version 2.0 License.
Important MaintenanceNotice (... as I am SAP Employee)
The component is NOT delivered under SAP maintenance license.
You cannot claim any Support on this component from SAP!
The components are created on "private" basis - you can use them as is. I can modify, correct or improve - but there is no obligation to do it. Of course I will try to correct bugs or improve the component as long I can.
Have Fun!
for other components see: Karol's SDK Components