Quantcast
Channel: SCN : Document List - SAP BusinessObjects Design Studio
Viewing all 575 articles
Browse latest View live

Design Studio SDK: CheckBox Group (with Image) Component

$
0
0

Purpose

today a checkbox group with image (as optional) visualization.

 

How does it looks like? (click to animate GIF)

chekcbox group, with corresponding image per entry.

20140925-185810_capture.gif

 

Styles
scn-pack-CheckBoxGroupthe group itself style
scn-pack-CheckBoxGroup-Layoutthe single entry layout style
scn-pack-CheckBoxGroup-Picturethe picture style
scn-pack-CheckBoxGroup-CheckBoxthe checkbox style
scn-pack-CheckBoxGroup-SelectedValuethe selected layout style (only active when images are available)


Available Properties

 

Property NameDescription
fallbackPicture

Url to the fallback picture (must be set if picture is selected)

withPicture

with picture flag

pictureSizepicture size, 16px or 32px as choice

 

Scripting Functions

 

ScriptsShort Description
void removeAllElements ()removes all elements

void addElement (String elementKey,

               String elementText,

               String imageUrl,

               boolean selected)

adds an element

void insertElement (String elementKey,

               String elementText,

               String imageUrl,

               boolean selected,

               int insertionIndex0based)

inserts element at index

void updateElement (String elementKey,

               String elementText,

               String imageUrl,

               boolean selected)

updates element at key
void deleteElement (String elementKey)deletes element
String getKeyAtIndex (int index)returns key at given index
org.scn.pack.KeyLabelArray getSelectedElementsArray ()returns an array of selected elements
void setSelectedKey (String key, boolean selected)sets element as selectd / unselected
void setSelectedKeys (String keys, String separator)sets many elements as selected (those which are not in the list are unselected)


Events

 

EventShort Description
onSelectionChangedEvent triggered when selection is changed

 

Example Application

An Application with example can be downloaded at the BIAPP Repository:

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

 

Ps. only basic properties are attached, if some are missing - just make a comment.

LInk to SAPUI5: SAPUI5 SDK - Demo Kit


Some extra Performancy knowhows

$
0
0

Some lessons learned I wanted to share with you...

 

Design Studio 1.3

Sap Hana 1.0 SP7

 

  • Adding the same Datasouce or copying the first one makes no difference.
  • Both scenarios  have the same runtime

 

Initialsetupquery(Column:Measure,Rows:Dimension)

DS_1.loaddatasource();

DS_1.setFilter
  (Dimension,Value);


Measure=DS_1.getDataAsString("Ordered", {});

 

 

Initialsetupquery:(Column:Measure,Rows:/)

DS_1.loaddatasource();


DS_1.setFilter (Dimension,Value);


Measure=DS_1.getDataAsString("Ordered", {});


DS_1.MoveDimensionToRows(Dimension);



DS_1.setFilterExt("Year",var_end);



If (var_end != ””){


DS_1.setFilterExt("Year",var_end);


}

 

 

  • Make use of the Global Script Variables, set the value for the GSV once and reuse them

var_end = Convert.subString(APPLICATION.getInfo().dateNowInternalFormat, 0,4);

DS_1.setFilterExt("Year",var_end);

TILE_1_SUBTITLE.setText(var_end);

 

  • Get Data once and filter in later stages.

var var_range = var_start + " - " + var_prev;

DS_6.loadDataSource();

 

Get Data from DS_6 over Multiple years

 

DS_6.setFilterExt(("Year", var_range);

DS_6.setFilterExt("Vendor", var_vendor);

DS_6.setFilterExt("VendorName",var_name);

DS_6.setFilterExt("VATRegistration",var_vat);

 

Filter DS_6 in a later stage for one year

g_vim=(DS_6.getDataAsString("Counter", {"Year": var_prev}));

TILE_6_VALUE.setText(g_vim);

TILE_DETAILS_6_VALUE.setText(g_vim);

 

  • Set Dynamic variables on startup

var_end = Convert.subString(APPLICATION.getInfo().dateNowInternalFormat,0,4);

var_prev = Convert.floatToString((Convert.stringToFloat(var_end)) - 1);

var_prev = Convert.subString(var_prev,0,4);

var_start=Convert.subString(Convert.floatToString((Convert.stringToFloat(var_prev)) - 4),0,4);

var var_range = var_start + " - " + var_prev;

 

 

  • Merged variables does not work on hana when coping with different views.  Workaround =

        Global script varibale

             var_vendor string false false

        on startup

             var_vendor=DS_1.getVariableValueExt("HANA_VARIABLE_VENDOR");

             APPLICATION.doBackgroundProcessing();

        on background

             DS_3.setFilterExt("Vendor", var_vendor);

 

SDK: How to Extend ZTL Grammar with own Return Types

$
0
0

Purpose

you are writing SDK component and want to allow eg. own objects as return types.


Example

you want to return an array from a script function:

 

SomeArray getAsKeyLabelValueArray ();

 

First Step

Define the Array-Element in your ZTL like this:

 

class org.kalisz.karol.scn.pack.KeyLabelValue {  String key;  String label;  float value;
}

 

Second Step

Define the Array in your ZTL like this:

 

class org.kalisz.karol.scn.pack.KeyLabelValueArray extends Array {  org.kalisz.karol.scn.pack.KeyLabelValueArray (org.kalisz.karol.scn.pack.KeyLabelValue b);
}

 

Third Step

now, you can create your method and retrurn this array.

 

org.kalisz.karol.scn.pack.KeyLabelValueArray getAsKeyLabelValueArrayTest () {*    var a = [];    var itemDef1 = {        "key": "A",        "label": "Text A",        "value": 20    };      a.push(itemDef1);   var itemDef2 = {        "key": "B",        "label": "Text B",        "value": 20    };      a.push(itemDef2);    return a;
*}

Result in BIAL

  • you will be able to loop on this object

 

var keysAndlabelsAsArray = OBJECT_COMPONENT.getAsKeyLabelValueArrayTest();
keysAndlabelsAsArray.forEach(function(element, index) {  LISTBOX_1.addItem(element.key, element.label + "( " + element.value + " )");
});

Live Example soon ...

Design Studio SDK: Kpi View Component

$
0
0

Purpose

A KPI View (a bit different to the KPI Tile from samples) but with correct value format and support. The API and properties is very similar to the KPI tile, but some special functions are not available. I hope this is not too big restriction.

 

This component solfs also the problem Problem regional formats setting

 

How does it looks like?

KpiView.png

 

Styles
scn-pack-KpiViewthe image
scn-pack-KpiView-Headerfor header
scn-pack-KpiView-Titlefor title
scn-pack-KpiView-Linkfor link
scn-pack-KpiView-Imagefor image
scn-pack-KpiView-ValuePrefixfor value prefix
scn-pack-KpiView-Valuefor value
scn-pack-KpiView-ValueSuffixfor value suffix
scn-pack-KpiView-Footerfor footer


Available Properties

 

Property NameDescription
data

cell selection

headerText

text for header

headerCssClasscss class for header
titleTexttext for title
titleCssClasscss class for title
valuePrefixTexttext for value prefix
valuePrefixCssClasscss class for value prefix
valueTexttext for value
valueHAlignalign of the value (cannot be changed by scripts, need refresh app when changed)
valueCssClasscss class for value
valueDecimalPlacesnumber of decimal places 0-9
valueSuffixTexttext for value suffix
valueSuffixCssClasscss class for value suffix
footerTexttext for footer
footerHAlignalign of the footer (cannot be changed by scripts, need refresh app when changed)
footerCssClasscss class for footer
linkTexttext for link
linkTooltiptooltip for link
imageurl for image
imageSizeimage size (choice of 16, 32, 64, 128 px)

 

Scripting Functions

 

ScriptsShort Description
setters / getters for the majority of propertiesall those which could be changed in runtime

void setDataSelection(

/* Data cell tha tcontains the value displayed */ ResultCellSelection cellSelection)

for data selection cell


Events


EventDescription
onClick

triggered when user clicks on some space

onLinkClicktriggered when user clicks on link


Example Application

An Application with example can be downloaded at the BIAPP Repository:

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

Design Studio SDK: Image Carousel Component

$
0
0

Purpose

Simple Selection Component (like a drop down) with Image in addition. It supports "selection" event, which can be used for some other actions.

imagecarousel.PNG

Implementation

Using Design Studio SDK, this component is accepting an list of "key, text, image" elements. Those elements are pushed into a carousel.

 

Short Demo (as animated GIF)

20140911-162939_capture.gif

 

Styles

To not overload the component with "default" styles, in basic version it is quite primitive. But, there are 2 declared css classes which you can overwrite. Below an example, you need to set the CSS class on component level, like:

 

css-redefine.PNG

and here the corresponding CSS:

 

.redefined .scn-pack-ImageCarousel-SelectedImage {  border: solid 3px #000000 !important;
}
.redefined .scn-pack-ImageCarousel-Image {  width: 100px !important;  height: 80px !important;  border: solid 3px transparent;  margin-top: 23px; /* for center: (height - width) / 2*/  margin-left: 23px; /* for center: (height - width) / 2*/
}

 

Available Properties

 

Property NameDescription
defaultImage

the default image - required for technical reason, you have to fill in some!

 

Scripting Functions

 

ScriptsShort Description
removeAllElements()

remove all elements

addElement (String elementKey, String elementText, String imageUrl)

add an element

 

!important: you can add two elements with same key (technically it is possible)

insertElement (String elementKey, String elementText, String imageUrl, int insertionIndex0based)insert an element (0 is "before first element")
updateElement (String elementKey, String elementText, String imageUrl)update given element (does not change the key!)
deleteElement (String elementKey)delete an element

String getKeyAtIndex (int index)

returns key at given index
String getSelectedKey ()returns the selected key
setSelectedKey (String key)sets the selected key


Events


EventDescription
onSelectionChanged

triggered when user clicks on some element, use getSelectedKey() to get the selection


Example Application

An Application with example can be downloaded at the BIAPP Repository:

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!

 

P.S.

Michael Howles: wished a carousel in response to Question: What would you like to see as SDK Component?

Design Studio SDK: Simple Date Object Component

$
0
0

Purpose

Date-based navigation (roll days, months) in BIAL script directly, format days to own formats.

 

Show Case

You can use this component like this:

 

var today = APPLICATION.getInfo().dateNowInternalFormat;
DATEOBJECT_1.initializeWithInternalDate(today);
DATEOBJECT_1.rollWeeks(-4); // go back by 4 weeks
var calendarWeek = DATEOBJECT_1.getCalendarWeek();
var dateFormatted = DATEOBJECT_1.format("DD.WW.YYYY"); // -> results in eg. 01.08.2012


Background

Solution for date-based navigation in Filters, eg. get the current date and set the filter on data source by DATE - 4 weeks. Or get the current calendar week from todays day, and get the calendar week which was 2 weeks before. This component contains only some logic in the BIAL script (no rendering).

 

Technical Solution

I have long searched for some option to make this running in BIAL script. The current solution is probably not the best, but this was the only one I can offer for 1.3 release. It is based on "pre-generated JSON values for concrete days.

 

Secont "problem" was that SDK is always sending all properties to the client, therefore I hold only the "oneDay" property as this is small, I need to clean up always the "days" property as this is holding a huge array of days. Seems to work correctly - the array will never be send to client.

 

Available Properties

 

Property NameDescription
N/A

Currently no properties.

 

Scripting Functions

 

ScriptsShort Description

initialize(...)

initializeWithDate (...)

You can initialize the simple date object with any date from January 2009 to December 2019 by giving year, month, day

initializeWithInternalDate (...)

You can initialize by passing the internal date format "20140814" (8 characters). This is for direct passing of the "APPLICATION.getInfo().dateNowInternalFormat;" content.

rollDays(int)

rollWeeks(int)

rollMonths(int)

rollYears(int)

functions for rolling the date object. You can use NEGATIVE numbers to roll down.

get(...)

many getters (in this preview no documentation, but the names are self-explained)

format(Sting)

format method can be used for formatting of the date to some string (primitive format by replacing characters):

  • YYYY -> year (4 chars)
  • YY -> year (last 2 chars)
  • MM -> month (2 chars)
  • M -> month (1 char if < 10)
  • DD -> day ( chars)
  • D -> day (1 char if < 10)
  • WW -> calendar week (2 chars)
  • W -> calendar week (1 char if < 10)
  • Q -> quarters
internal_*some internal methods, do not use directly

 

Example Application

An Application with example can be downloaded at the BIAPP Repository:

 

In this example all methods are shown behind the buttons, try it out!

 

Current Restrictions

  • currently, in BIAL scripts only restricted functional scope is possible, therefore the dates are as "big array" (but performance seems to be ok)
  • restricted to navigation between 31st December 2004 and 1st January 2020 - this shoudl be ok for normal use

 

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 (in compatible way), 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.

 

Q&A

Feel free to add any comments or ideas which can go into future versions, or feel free to take a copy and add extensions on your own.

Design Studio SDK: Kpi View Component

$
0
0

Purpose

A KPI View (a bit different to the KPI Tile from samples) but with correct value format and support. The API and properties is very similar to the KPI tile, but some special functions are not available. I hope this is not too big restriction.

 

This component solfs also the problem Problem regional formats setting

 

How does it looks like?

KpiView.png

 

Styles
scn-pack-KpiViewthe image
scn-pack-KpiView-Headerfor header
scn-pack-KpiView-Titlefor title
scn-pack-KpiView-Linkfor link
scn-pack-KpiView-Imagefor image
scn-pack-KpiView-ValuePrefixfor value prefix
scn-pack-KpiView-Valuefor value
scn-pack-KpiView-ValueSuffixfor value suffix
scn-pack-KpiView-Footerfor footer


Available Properties

 

Property NameDescription
data

cell selection

headerText

text for header

headerCssClasscss class for header
titleTexttext for title
titleCssClasscss class for title
valuePrefixTexttext for value prefix
valuePrefixCssClasscss class for value prefix
valueTexttext for value
valueHAlignalign of the value (cannot be changed by scripts, need refresh app when changed)
valueCssClasscss class for value
valueDecimalPlacesnumber of decimal places 0-9
valueSuffixTexttext for value suffix
valueSuffixCssClasscss class for value suffix
footerTexttext for footer
footerHAlignalign of the footer (cannot be changed by scripts, need refresh app when changed)
footerCssClasscss class for footer
linkTexttext for link
linkTooltiptooltip for link
imageurl for image
imageSizeimage size (choice of 16, 32, 64, 128 px)

 

Scripting Functions

 

ScriptsShort Description
setters / getters for the majority of propertiesall those which could be changed in runtime

void setDataSelection(

/* Data cell tha tcontains the value displayed */ ResultCellSelection cellSelection)

for data selection cell


Events


EventDescription
onClick

triggered when user clicks on some space

onLinkClicktriggered when user clicks on link


Example Application

An Application with example can be downloaded at the BIAPP Repository:

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

Create Cascading DropDowns / Filters using Universe as Datasource

$
0
0

In Design Studio, we would like to create 3 cascading dropdowns (Site > Area > Work Center) which will only show the corresponding areas / work centers in the dropdown list when user select a specific site / area.

 

Using universe as data source, we are not able to use the hierarchy defined within the universe.   To achieve the requirement, we use the following setup.

 

 

Setup

 

1. Define 3 global variables to hold user selected site, area and work center values.

GlobalVars.JPG

 

2. Define the data source query filter with optional prompt on both Site and Area.

 

DefineDSQuery.JPG

 

As the prompt is optional, all sites, areas and work centers are included when prompts have no value.

DSQueryResult.JPG

 

3. Create 3 dropdown for Site , Area and Work Center.  Fill up these 3 dropdowns in the "On Startup" application event using the defined data source DS_1.

OnStartup.JPG

 

4. In site dropdown "On Select" event.  Update global variable g_site, g_area and g_workCenter.  In this example we reset g_area and g_workCenter to default value to illustrate when g_site changed, existing g_area and g_workCenter needs to be invalidate.  Update DS_1 site and area prompts with the new values.

 

SiteOnSelect.JPG

 

5. In area dropdown "On Select" event.  Update global variable g_area and reset g_workCenter.  Update DS_1 area prompt with the selected area.

AreaOnSelect.JPG

 

 

6. In work center dropdown "On Select" event, update global variable g_workCenter.

WorkCenterOnSelect.JPG

 

 

7. In DS_1 "On Result Set Changed" event.  Update both area and work center dropdown.  As the area and work center dropdown are refreshed, set the dropdowns with user selected values.

OnResult.JPG

 

 

Result:

 

When application start, both prompts have no values and all dropdowns are not filter.

DropDownAll.png

By selecting a specific site from the site dropdown, both area and work center drop down are updated to show only area and work center under the selected site.

DropDownHouston.png

Selected a specific area will update the work center dropdown to show only work center under the selected area.

DropDownHoustonArea2.png

Selected a new site from the site dropdown will update both area and work center dropdown with all areas and work centers under the newly selected site.  It also reset the previous selected area and work center to "All".

 

DropDownManitoba.png

When a specific area is selected, the area dropdown will only contain 2 items.  To switch form a selected area back to all areas under the selected site, select the "All" item in the area dropdown, which will refresh both area and work center dropdown to show all areas and work centers again.

DropDownManitobaPierson.png

After selecting "All" in the area dropdown.

DropDownManitoba.png

Note:

Since we are using data source prompt, on each selection it will involve a round trip to update resultset.  This will impact the application performance.


Design Studio SDK: Tree Component

$
0
0

Purpose

Simple Tree, for work manual nodes. You can create own structure by parent-child relations.

 

How does it looks like? (click to animate GIF)

20141001-233033_capture.gif

Or as static image.

Capture.PNG

 

Styles
scn-pack-Treethe tree style


Available Properties

 

Property NameDescription
defaultImage

image property for default image (must be set for use with images)

 

Scripting Functions

 

ScriptsShort Description
void removeAllNodes ()removes all nodes

void addNode (

  /**Node Key (must be unique)*/String nodeKey,

  /**Node text*/String nodeText,

  /**Image URL, if not set, no image*/String imageUrl,

  /**The Key of the parent Node*/String parentNodeKey,

  /**Leafs do not have expand option by default*/optional boolean isLeaf)

adds a node with reference to parent node.

 

"ROOT" is the technical key for the root node

String getExpandedKey ()returns the expanded key
String getSelectedKey ()returns the selected key (by click on the node or leaf)


Events

 

EventShort Description
onSelectionChangedEvent triggered when node or leaf is selected
onFirstExpandEvent triggered when the node is expanded for first time (this is the even where you can load more content

 

Example Application

An Application with example can be downloaded at the BIAPP Repository:

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

 

Ps. only basic properties are attached, if some are missing - just make a comment.

LInk to SAPUI5: SAPUI5 SDK - Demo Kit

Design Studio SDK: Simple Date Object Component

$
0
0

Purpose

Date-based navigation (roll days, months) in BIAL script directly, format days to own formats.

 

Show Case

You can use this component like this:

 

var today = APPLICATION.getInfo().dateNowInternalFormat;
DATEOBJECT_1.initializeWithInternalDate(today);
DATEOBJECT_1.rollWeeks(-4); // go back by 4 weeks
var calendarWeek = DATEOBJECT_1.getCalendarWeek();
var dateFormatted = DATEOBJECT_1.format("DD.WW.YYYY"); // -> results in eg. 01.08.2012


Background

Solution for date-based navigation in Filters, eg. get the current date and set the filter on data source by DATE - 4 weeks. Or get the current calendar week from todays day, and get the calendar week which was 2 weeks before. This component contains only some logic in the BIAL script (no rendering).

 

Technical Solution

I have long searched for some option to make this running in BIAL script. The current solution is probably not the best, but this was the only one I can offer for 1.3 release. It is based on "pre-generated JSON values for concrete days.

 

Secont "problem" was that SDK is always sending all properties to the client, therefore I hold only the "oneDay" property as this is small, I need to clean up always the "days" property as this is holding a huge array of days. Seems to work correctly - the array will never be send to client.

 

Available Properties

 

Property NameDescription
N/A

Currently no properties.

 

Scripting Functions

 

ScriptsShort Description

initialize(...)

initializeWithDate (...)

You can initialize the simple date object with any date from January 2009 to December 2019 by giving year, month, day

initializeWithInternalDate (...)

You can initialize by passing the internal date format "20140814" (8 characters). This is for direct passing of the "APPLICATION.getInfo().dateNowInternalFormat;" content.

rollDays(int)

rollWeeks(int)

rollMonths(int)

rollYears(int)

functions for rolling the date object. You can use NEGATIVE numbers to roll down.

get(...)

many getters (in this preview no documentation, but the names are self-explained)

format(Sting)

format method can be used for formatting of the date to some string (primitive format by replacing characters):

  • YYYY -> year (4 chars)
  • YY -> year (last 2 chars)
  • MM -> month (2 chars)
  • M -> month (1 char if < 10)
  • DD -> day ( chars)
  • D -> day (1 char if < 10)
  • WW -> calendar week (2 chars)
  • W -> calendar week (1 char if < 10)
  • Q -> quarters
internal_*some internal methods, do not use directly

 

Example Application

An Application with example can be downloaded at the BIAPP Repository:

 

In this example all methods are shown behind the buttons, try it out!

 

Current Restrictions

  • currently, in BIAL scripts only restricted functional scope is possible, therefore the dates are as "big array" (but performance seems to be ok)
  • restricted to navigation between 31st December 2004 and 1st January 2020 - this shoudl be ok for normal use

 

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 (in compatible way), 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.

 

Q&A

Feel free to add any comments or ideas which can go into future versions, or feel free to take a copy and add extensions on your own.

Design Studio SDK: Collection Util Component

$
0
0

Purpose

Work with Collections with sorting feature. This is usefull when you have some arrays, which you want to put together and sort.

 

This component is created with collaboration with Michael Howles.

Thanks Michael for allowing the reuse of the sorting-code from your blog Design Studio SDK - Get Top/Bottom N rankings with a little less code, as response on my primitive blog How to get "Top X" our of resultset


Supports

Items with

  • key
  • label
  • value

-> See also available extensions in How to Use Extended Sdk Collection to handle "properties"

 

Functions

 

FunctionDescription

void setItems (

  /*keys*/ String keys,

  /*labels*/ String labels,

  /*values*/ String values,

  /*separator*/ optional String separator)

initialization with 3 arrays, ideally all 3 are equal, if not, the loop is on keys:

  • in case label array is shorter, empty label will be add
  • in case value array is shorter, 0 value will be add

 

Default Separator is comma ,

void addItem (

  /*key*/ String key,

  /*label*/ String label,

  /*value*/ String value)

you can add items one by one as well

String getKeys(

  /*separator*/ optional String separator)

keys separated by separator

 

Default Separator is comma ,

String getLabels(

  /*separator*/ optional String separator)

values separated by separator

 

 

Default Separator is comma ,

String getValues(

  /*separator*/ optional String separator)

values separated by separator

 

 

Default Separator is comma ,

void sortBy...()some sort methods (provided by Michael)
int getLength()length of current array

String getLabelByIndex(

  /* index */ int index)

getLabelByIndex

String getLabelByKey(

  /* index */ String key)

getLabelByKey

String getValueByIndexAsString(

  /* index */ int index)

getValueByIndexAsString

float getValueByIndex(

  /* index */ int index)

getValueByIndex

String getValueByKeyAsString(

  /* key */ String key)

getValueByKeyAsString

float getValueByKey(

  /* index */ String key)

getValueByKey

 

The Coolest Function

 

FunctionDescription

org.kalisz.karol.scn.pack.KeyLabelValueArray getAsKeyLabelValueArray (

  /**max members*/ optional int maxMembers)

returns the complete collection of keys, labels, values as JSON loopable object

 

maxMembers can restrict the length of the returned array

 

Example Application


20140915-234033_capture.gif


An Application with example can be downloaded at the BIAPP Repository:

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

Design Studio SDK: (dynamic) Accordion Component

$
0
0

Purpose

Another response to MANOJ KUMAR's Accordion Menu in SAP Design Studio, and caused by public holiday and weekend trip - unfortunately also to the post by Michael Howleson the SDK way of doing in Design Studio SDK - SAPUI5 Accordion Menu.

 

There are 2 reasons why I place this component:

  • the fist one is - I have already started it directly after Manoj has posted the blog and before Michael has posted his version (work interrupted by no time at evening)
  • and the second one (more important for me) is - this one has completely different approach - and in a blog which I want to write a bit later I would like to have an open discussion on good/not so good ideas and approaches.

 

How does it looks like? (click to animate GIF)

20141006-214651_capture.gif

or with big images like this.

Capture.PNG

 

Styles
scn-pack-Accordionthe accordion style
scn-pack-Accordion-SelectedValuethe selected value style
scn-pack-Accordion-Labelthe label style
scn-pack-Accordion-Imagethe image style
scn-pack-Accordion-Layoutthe item layout style


Available Properties

 

Property NameDescription
defaultImage

image property for default image (must be set for use with images)

withImageflag for "Use Images"
maxSectionHeightMax Height for Section in px
imageSizeSize of the Image (16 or 32 px)

 

Scripting Functions

 

ScriptsShort Description
void removeAllElements ()removes all elements (and sections)

void addSection (

  /**Element Key (must be unique)*/String elementKey,

  /**Element text*/String elementText,

  /**Image URL, if not set, no image*/String imageUrl)

adds a section with unique key

void addElement (

  /**Element Key (must be unique)*/String elementKey,

  /**Element text*/String elementText,

  /**Image URL, if not set, no image*/String imageUrl,

  /**The Key of the parent Element*/String parentElementKey)

adds an element (represented by label with image or without image) to the section
String getExpandedKey ()returns the expanded key
String getSelectedKey ()returns the selected key (by click on the node or leaf)
void setMaxSectionHeight (String height)sets the max height for a section


Events

 

EventShort Description
onSelectionChangedEvent triggered when element is selected
onFirstExpandEvent triggered when the section is expanded for first time (this is the even where you can load more content)

 

Example Application

An Application with example can be downloaded at the BIAPP Repository:

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

How to create a chart selector list

$
0
0

The goal of this document to explain how you can make an charttype selector.  When we click on the chart tab we want to see a list of possible charttypes selectable for the user.

 

 

0000Capture.PNG

we create a POPUP component, inserted a GRID component ROW=6 COLUMN=1

 

Set WIDTH, Height and the positioning of your popup, in the grid you can set width/height to auto and the other parameters to 0.

 

Put in every column a BUTTON component, set as class:

  1. ICON_CHART_PIE
  2. ICON_CHART_LINE
  3. ICON_CHART_RADAR
  4. ICON_CHART_BAR
  5. ICON_CHART_COLUMN
  6. ICON_CHART_BUBBLE

0000Capture.PNG

BUTTON >> Event scripting:

 

CHART.setChartType(ChartType.PIE); respectively for each button.

 

If you want the popup disappear after selection set also: POPUP.hide();

 

On the footer-graph-Icon we have scripted on event: POPUP.show();

On the footer-table-Icon we have scripted on event: POPUP.hide();

Cascading style sheets(CSS) in Design Studio

$
0
0

Applies to:

SAP BusinessObjects Design Studio 1.1 and SAP BusinessObjects Business Intelligence Platform (4.0 SP5 or higher and 4.1). For more information, visit theSAP BusinessObjects Design Studiohomepage.

 

Summary

 

This article describes how to use CSS style editor to modify styles of individual components as well as process of defining common style to set of components across different Analysis apps using CSS Class and custom CSS file. The content in this is intended for beginners in design studio space and developers for those who would wish to change the styling of their existing analysis apps created using design studio 1.0.


 

Author: Mallikarjuna Chary Narayandas


 

 

 

 

Created on:June 08, 2013

 

Author Bio

 

The author has worked on several SAP BusinessObjects projects and has experience on using all the SAPBusinessObjectsBusiness Intelligenceplatform tools. Author has experience on working with SAPBusinessObjectsmobile including designing and accessingBusinessObjectscontent (Webi Reports, Crystal Reports, Dashboards, Analysis and Information Spaces) through IPAD /IPhone/ Android.

 

Introduction

 

This article describes how to use CSS style editor to modify styles of individual components as well as process of defining common style to set of components across different Analysis apps using CSS Class and custom CSS file. The content in this is intended for beginners in design studio space and developers for those who would wish to change the styling of their existing analysis apps that were created using design studio 1.0.

 

CSS Styling Properties


 

Design Studio offers different properties related to CSS styles based on the level such as application level, component level etc. Following sections give the details of these properties and their usage.

 

Application:


 

Custom CSS is the property available in application properties for the design studio apps and this property lets developers choose any custom CSS file to be used for the styling of the analysis application or dashboard. Refer to below sections to read the steps to use this property.

 

Note:CSS style sheets work properly in design studio only if they are in applicable and appropriate format.

 

Component:


 

Custom Class andCSS Style are the properties available at component level within display properties and these properties let developers define the styling of components such as font size,  background etc., for each individual component that has these properties applicable. Custom Class can be assigned to a group of components at a time to perform quick styling by selecting them using Shift>Select. Refer to below sections to read the steps to use these properties.


 

Modify CSS styling of Analysis Application


 

Developers can now change the look and feel of analysis application and it’s components by changing the existing CSS Style of the components using CSS style editor or by defining standard CSS style across a set of components or for a set of applications using CSS class. Developers can define CSS classes in a custom CSS file with the required CSS styling and re-use it across numerous analysis apps designed using Designed studio


 

Steps to change CSS Style of Individual components using CSS Style Editor


 

    1. Select a component that you want to change the styling for such as Text or Panel component.
    2. Go to properties on right side and Click on CSS Style to open the CSS Style editor
    3. Type the code in below format to change the styling of text of the component.

 

Ex:  font-size: 18px; weight: bold; font-style: italic; color: blue;

CSS STyle Editor.jpg

Steps to change CSS Class of Multiple components using CSS Style Editor


 

    1. Use Shift>Select  to choose multiple similar components(Ex: Panels) that you want to update the CSS Class to ensure you get common styling for the set of panels selected.
    2. Go to properties on right side and Choose the CSS Class available.

 

          Ex: CSS Class “myPanel” from “Analysis_template.css” file.

 

     Steps to assign CSS file to Custom CSS property of applications


 

          Developer need to ensure that they have the CSS file in the root folder of the application by navigating to the Application folder using File>Open               Repository Folder option


 

    1. Select the “Application name” on the left side in the layout panel
    2. Go to properties on right side and click on Custom CSS option and select the CSS file from the listed files.

               

               CSS file Analysis Template.jpg

CSS methods for Scripting


Developers can use the methods getCSSClass and setCSSClass within the scripts to read the CSS Class or to assign CSS Class to different set of components respectively.


 

Limitations


 

One of the current limitations is that only CSS attributes (font size, color, weight, style and text decoration) are supported for Text and Panel components. There are many new features planned for future releases of design studio, so I can confidently say SAP would make Design Studio as first choice and best product for all analysis and dashboards requirements on BW and HANA sources.

References

 

SAP BusinessObjects Design Studio

Space: SAP BusinessObjects Design Studio | SCN

For more information, visit  SAP BusinessObjects Design Studio References

 

Disclaimer and Liability Notice

 

This document may discuss sample coding or other information that does not include SAP official interfaces and therefore is not supported by SAP. Changes made based on this information are not supported and can be overwritten during an upgrade.

SAP will not be held liable for any damages caused by using or misusing the information, code or methods suggested in this document and anyone using these methods does so at his/her own risk.

SAP offers no guarantees and assumes no responsibility or liability of any type with respect to the content of this technical article or code sample, including any liability resulting from incompatibility between the content within this document and the materials and services offered by SAP. You agree that you will not hold, or seek to hold, SAP responsible or liable with respect to the content of this document

Design Studio SDK: Data Bound Leader Board (Top/Bottom Selection)

$
0
0

Purpose

Visualize top or bottom members based on the full result set. As you do not always have access to query level, you can use this component for "client side" filtering and sorting - and at the end show only the top 5 members.


Visualization

similar to the original of Design Studio SDK: Leader Board Component, with the big difference: you do not need to fill it in manually.

 

As usual, some animated gif (click to animate):

20141016-224722_capture.gif

 

What is In?

First of all, this is my first data bound component, so probably it is not perfect.. I have just tested it with a simple query, and it is set to only single row/column selection for data binding.

 

  • you can bind data as commonly defined in SDK - data source and data selection properties are available
  • you can set some properties, currently only in the design time (perhaps later some BIAL functions can be add - on request, requirement)
  • you can assign fallback picture and when you place at the same location other pictures with keys, you get also pictures visible
  • option of making it for Top X or Bottom X

 

Data Binding

After you have assigned data source, open the data selection dialog and choose one column, or row with measures, like here:

data_leaderboard_databinding.PNG


Styles
scn-pack-DataLeaderBoardthe complete board
scn-pack-DataLeaderBoard-ValueLayoutsingle value layout
scn-pack-DataLeaderBoard-IndexTextindex text
scn-pack-DataLeaderBoard-Linklink
scn-pack-DataLeaderBoard-Picturepicture
scn-pack-DataLeaderBoard-Texttext
scn-pack-DataLeaderBoard-SelectedValueselected value


Available Properties

 

Property NameDescription
fallbackPicture

the picture which should be visible if value-picture does not exist (must be maintained!)

usePicturesallows to switch off display of pictures (in example 2)
maxNumberMaximum number of displayed members
topBottomwhich direction should it visualize from data set, Top X or Bottom X
addCounterdisplays the counter on left side
valuePrefix

prefix for the text which is displaying the value

valueSuffixsuffix for the text which is displaying the value
addCounterflag for counter (if true, the numbers on left side will be visible)
decimalPlacescurrently can be changed manually, it is not bound to the data source display

 

data_leaderboard.PNG

 

Work with Images

you can assign images to the entries, the image must be named as the key and the extensions must be same as the extension of fallback image. In case the image cannot be taken from repository (not existing) - fallback image will be shown.

data_leaderboard_pictures.PNG


Scripting Functions

 

ScriptsShort Description
String getSelectedKey ()returns the selected key
String getPressedKey ()returns the pressed key (by click on the link)

 

Events

 

EventShort Description
onSelectionChangedEvent triggered when selection has cahnged
onPressEvent triggered when user press on the link

 

Example Application

An Application with example can be downloaded at the BIAPP Repository (name SDK_DATA_LEADERBOARD):

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 or Karol's SDK Data Bound Components


Design Studio SDK: Data Bound Top/Flop (Top/Bottom with Average)

$
0
0

Purpose

Visualize top or bottom members (or both) based on the full result set. As you do not always have access to query level, you can use this component for "client side" filtering and sorting - and at the end show the X tops and flops with delta notification.


Visualization

currently I have not created corresponding non-data-bound component, so here the full description.

 

As usual, some animated gif (click to animate):

20141021-203736_capture.gif

 

What is In?

First of all, this is my second data bound component - it is based on the Design Studio SDK: Data Bound Leader Board (Top/Bottom Selection) component. I have just tested it with a simple query, and it is set to only single row/column selection for data binding.

 

  • you can bind data as commonly defined in SDK - data source and data selection properties are available
  • you can set some properties, currently only in the design time (perhaps later some BIAL functions can be add - on request, requirement)
  • you can assign fallback picture and when you place at the same location other pictures with keys, you get also pictures visible
  • option of making it for Top X or Bottom X or Both (Top/Flop)


Data BindingAfter you have assigned data source, open the data selection dialog and choose one column, or row with measures, like here:data_leaderboard_databinding.PNG

Styles
scn-pack-DataTopFlopthe complete component
scn-pack-DataTopFlop-ValueLayoutsingle value layout
scn-pack-DataTopFlop-ValueLayoutGoodsingle value layout for good values (>= average)
scn-pack-DataTopFlop-ValueLayoutBadsingle value layout for bad values (< average)
scn-pack-DataTopFlop-IndexTextindex text
scn-pack-DataTopFlop-Linklink
scn-pack-DataTopFlop-Picturepicture
scn-pack-DataTopFlop-Texttext
scn-pack-DataTopFlop-DeltaTextdelta text
scn-pack-DataTopFlop-SelectedValueselected value


Available Properties

Property NameDescription
fallbackPicturethe picture which should be visible if value-picture does not exist (must be maintained!)
usePicturesallows to switch off display of pictures (in example 2)
maxNumberMaximum number of displayed members
topBottomwhich direction should it visualize from data set, Top X or Bottom X
addCounterdisplays the counter on left side
valuePrefixprefix for the text which is displaying the value
valueSuffixsuffix for the text which is displaying the value
deltaValueSuffixsuffix for the text which is displaying the delta value
addCounterflag for counter (if true, the numbers on left side will be visible)
decimalPlacescurrently can be changed manually, it is not bound to the data source display
fixedAverageValueby default average will be calculated, but you can set also fixed value here (-1 means default calculation)
averagePrefixprefix for the average value (default is "Average: ")
averageSuffixsuffix for the average value)


Work with Imagesyou can assign images to the entries, the image must be named as the key and the extensions must be same as the extension of fallback image. In case the image cannot be taken from repository (not existing) - fallback image will be shown.data_leaderboard_pictures.PNG
Scripting Functions

ScriptsShort Description
String getSelectedKey ()returns the selected key
String getPressedKey ()returns the pressed key (by click on the link)

Events

EventShort Description
onSelectionChangedEvent triggered when selection has cahnged
onPressEvent triggered when user press on the link

Example ApplicationAn Application with example can be downloaded at the BIAPP Repository (name SDK_DATA_LEADERBOARD):

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 or Karol's SDK Data Bound Components

Design Studio SDK: Data Bound Top/Flop Chart

$
0
0

Purpose

Visualize top or bottom members (or both) based on the full result set as a simple chart based on value or delta. As you do not always have access to query level, you can use this component for "client side" filtering and sorting - and at the end show the X tops and flops with delta notification.


Implementatation

I just used sub components to paint a chart, there is no charting or graphic library behind. This means also that this implementation is good for dashboards, but not so much for charting where many data points are required - there jsut go for standard.


Visualization

As usual, some animated gif (click to animate). This component has more flexibility for Ux changes by properites.

20141023-234713_capture.gif

 

What is In?

First of all, this is my second data bound component - it is based on the Design Studio SDK: Data Bound Top/Flop (Top/Bottom with Average) component. I have just tested it with a simple query, and it is set to only single row/column selection for data binding.

 

  • you can bind data as commonly defined in SDK - data source and data selection properties are available
  • you can set some properties, currently only in the design time (perhaps later some BIAL functions can be add - on request, requirement)
  • you can assign fallback picture and when you place at the same location other pictures with keys, you get also pictures visible
  • option of making it for Top X or Bottom X or Both (Top/Flop)


Data Binding
After you have assigned data source, open the data selection dialog and choose one column, or row with measures, like here:data_leaderboard_databinding.PNG

Styles
scn-pack-DataTopFlopChartthe complete component
scn-pack-DataTopFlopChart-ValueLayoutsingle value layout
scn-pack-DataTopFlopChart-ValueLayoutGoodsingle value layout for good values (>= average)
scn-pack-DataTopFlopChart-ValueLayoutBadsingle value layout for bad values (< average)
scn-pack-DataTopFlopChart-IndexTextindex text
scn-pack-DataTopFlopChart-Linklink
scn-pack-DataTopFlopChart-Picturepicture
scn-pack-DataTopFlopChart-Texttext
scn-pack-DataTopFlopChart-DeltaTextdelta text
scn-pack-DataTopFlopChart-SelectedValueselected value
scn-pack-DataTopFlopChart-BaseLinebase line


Available Properties

Property NameDescription
fallbackPicturethe picture which should be visible if value-picture does not exist (must be maintained!)
usePicturesallows to switch off display of pictures (in example 2)
maxNumberMaximum number of displayed members
topBottomwhich direction should it visualize from data set, Top X or Bottom X
addCounterdisplays the counter on left side
valuePrefixprefix for the text which is displaying the value
valueSuffixsuffix for the text which is displaying the value
deltaValueSuffixsuffix for the text which is displaying the delta value
addCounterflag for counter (if true, the numbers on left side will be visible)
useBackgroundMark Background
useDeltaUse Delta as Value
allowInteractionAllow Any Interaction (Link, Selection)
breakOnIndexPlace an Empty Area after Index
breakOnAveragePlace an Empty Area after Average is Matched
showAverageShow Average Information
valueStartText / Value Split Point in px
maxValueSizeMaximal Size of the Value Area in px
decimalPlacescurrently can be changed manually, it is not bound to the data source display
fixedAverageValueby default average will be calculated, but you can set also fixed value here (-1 means default calculation)
averagePrefixprefix for the average value (default is "Average: ")
averageSuffixsuffix for the average value)


Work with Imagesyou can assign images to the entries, the image must be named as the key and the extensions must be same as the extension of fallback image. In case the image cannot be taken from repository (not existing) - fallback image will be shown.data_leaderboard_pictures.PNG
Scripting Functions

ScriptsShort Description
String getSelectedKey ()returns the selected key
String getPressedKey ()returns the pressed key (by click on the link)

Events

EventShort Description
onSelectionChangedEvent triggered when selection has cahnged
onPressEvent triggered when user press on the link

Example ApplicationAn Application with example can be downloaded at the BIAPP Repository (name SDK_DATA_LEADERBOARD):

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 or Karol's SDK Data Bound Components

Design Studio SDK: Collection Util Component

$
0
0

Purpose

Work with Collections with sorting feature. This is usefull when you have some arrays, which you want to put together and sort.

 

This component is created with collaboration with Michael Howles.

Thanks Michael for allowing the reuse of the sorting-code from your blog Design Studio SDK - Get Top/Bottom N rankings with a little less code, as response on my primitive blog How to get "Top X" our of resultset


Supports

Items with

  • key
  • label
  • value

-> See also available extensions in How to Use Extended Sdk Collection to handle "properties"

 

Functions

 

FunctionDescription

void setItems (

  /*keys*/ String keys,

  /*labels*/ String labels,

  /*values*/ String values,

  /*separator*/ optional String separator)

initialization with 3 arrays, ideally all 3 are equal, if not, the loop is on keys:

  • in case label array is shorter, empty label will be add
  • in case value array is shorter, 0 value will be add

 

Default Separator is comma ,

void addItem (

  /*key*/ String key,

  /*label*/ String label,

  /*value*/ String value)

you can add items one by one as well

String getKeys(

  /*separator*/ optional String separator)

keys separated by separator

 

Default Separator is comma ,

String getLabels(

  /*separator*/ optional String separator)

values separated by separator

 

 

Default Separator is comma ,

String getValues(

  /*separator*/ optional String separator)

values separated by separator

 

 

Default Separator is comma ,

void sortBy...()some sort methods (provided by Michael)
int getLength()length of current array

String getLabelByIndex(

  /* index */ int index)

getLabelByIndex

String getLabelByKey(

  /* index */ String key)

getLabelByKey

String getValueByIndexAsString(

  /* index */ int index)

getValueByIndexAsString

float getValueByIndex(

  /* index */ int index)

getValueByIndex

String getValueByKeyAsString(

  /* key */ String key)

getValueByKeyAsString

float getValueByKey(

  /* index */ String key)

getValueByKey

 

The Coolest Function

 

FunctionDescription

org.kalisz.karol.scn.pack.KeyLabelValueArray getAsKeyLabelValueArray (

  /**max members*/ optional int maxMembers)

returns the complete collection of keys, labels, values as JSON loopable object

 

maxMembers can restrict the length of the returned array

 

Example Application


20140915-234033_capture.gif


An Application with example can be downloaded at the BIAPP Repository:

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

Design Studio SDK: Opening Window with POST (allows many parameters)

$
0
0

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 NameDescription
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)

 

ScriptsShort 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:

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

Design Studio SDK: Text Area (input) Component

$
0
0

Purpose

There is input filed, but no "multil line input field..". Now it is, the component for today - TextArea.

 

How does it looks like? (click to animate GIF)

a simple area where you can input text..

 

20140923-222248_capture.gif

 

 

Styles
scn-pack-TextAreathe area style


Available Properties

 

Property NameDescription
value

text value

editable

editable flag

maxLengthmax length, by default 0 - means no restriction

 

Scripting Functions

 

ScriptsShort Description
String getSelectedKey ()returns the selected key
String getPressedKey ()returns the pressed key (by click on the link)


Events

 

EventShort Description
onValueChangedEvent triggered when value is changed (after focus lost)

 

Example Application

An Application with example can be downloaded at the BIAPP Repository:

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

 

Ps. only basic properties are attached, if some are missing - just make a comment.

LInk to SAPUI5: SAPUI5 SDK - Demo Kit

Viewing all 575 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>