Server
API Reference Guide
Product Documentation:

Rogue Wave Server
Documentation Home
List of all members | Public Member Functions
javascript::IlsSwTable Class Reference

IlsSwTable JavaScript proxy. More...

#include <javascript/clientside.h>

Public Member Functions

String getDefaultCollector ()
 Returns the collector currently used to add a new row. More...
 
IlsSwRow getRow (Int rowno=current)
 Returns the row from the table. More...
 
Boolean onTableUpdate (Int colno, Int rowno, String value, Boolean isProperty)
 Changes the value of the corresponding attribute on the server via a call to the function IlsRpObject::onUpdate() on the representation object. More...
 
void propertySwOnDereference (Int colno, Boolean force=false, IlsSwServerDataSource sds=null,...)
 Dereferences a property in the table if the column colno in the property data source is a hyper-reference. More...
 
void setDefaultCollector (String collector)
 This method specifies which collector should be used by default when a new row is added to the table. More...
 
void setRowType (String SvType, String rpObjType)
 Sets the type of the row that will be created when a new row is inserted in a table. More...
 

Detailed Description

IlsSwTable JavaScript proxy.

Warning
This class is a JavaScript class, not a C++ one.
See also
IlsSwRow (JavaScript), IlsSwTable (C++).

Member Function Documentation

◆ getDefaultCollector()

String javascript::IlsSwTable::getDefaultCollector ( )

Returns the collector currently used to add a new row.

Returns
the collector currently used to add a new row.

◆ getRow()

IlsSwRow javascript::IlsSwTable::getRow ( Int  rowno = current)

Returns the row from the table.

Example
var table = ...
var currentRow = table.getRow();
var firstRow = table.getRow(0);
Parameters
rowno[optional] If the row number is not provided, the current row is returned. In the Rogue Wave Views Script mapping, row numbers start from zero.
Returns
the requested row.

◆ onTableUpdate()

Boolean javascript::IlsSwTable::onTableUpdate ( Int  colno,
Int  rowno,
String  value,
Boolean  isProperty 
)

Changes the value of the corresponding attribute on the server via a call to the function IlsRpObject::onUpdate() on the representation object.

The rowno and colno arguments indicate which attribute in the server (via the mapping) should be updated.

Example
var table = ...;
table.onTableUpdate(1, 2, “23”);
Parameters
colnocolumn number. In the Rogue Wave Views Script mapping, column numbers start from zero.
rownorow number. In the Rogue Wave Views Script mapping, row numbers start from zero.
valuethe value of the attribute to be set in the server. This parameter is entered as a string but will be converted to the correct type when used.
isProperty[optional] This optional argument can be provided to indicate whether the update should be done on the attribute in the main data source or in the property data source. If this parameter is not specified, the method chooses a value based on the data source that was used to get the table object.
Returns
false if the modification is not allowed.

◆ propertySwOnDereference()

void javascript::IlsSwTable::propertySwOnDereference ( Int  colno,
Boolean  force = false,
IlsSwServerDataSource  sds = null,
  ... 
)

Dereferences a property in the table if the column colno in the property data source is a hyper-reference.

Parameters
colnoIn the Rogue Wave Views Script mapping, column numbers start from zero.
force[optional] specifies whether a new view must be instantiated when the same view is already opened on the same object. Its default value is false.
sds[optional] If the sds parameter is supplied, it is used to open the new view. If not, the new view is opened with the preregistered panel and Server Data Source, if any.
...You can pass up to 10 arguments to open the view. These arguments are used as the values of the view parameters.

◆ setDefaultCollector()

void javascript::IlsSwTable::setDefaultCollector ( String  collector)

This method specifies which collector should be used by default when a new row is added to the table.

This method is useful only for multiple row tables. See the User's Manual for more information about multiple row tables.

Example
subscribe Node:
represent IlsSwTable NodeTable:
...
Collector rows=inputLines->inputLineRow;
Collector rows1=outputLines->outputLineRow;

If you want to add a row to the second relation, you must call:

IlsSwTable table = IlsSwGetTable(graphic);
table.setDefaultCollector("rows1");
Parameters
collectorthe name of the collector you want to use.

◆ setRowType()

void javascript::IlsSwTable::setRowType ( String  SvType,
String  rpObjType 
)

Sets the type of the row that will be created when a new row is inserted in a table.

This method is useful only for multiple row tables. See the User's Manual for more information about multiple row tables. The type of row must be compatible with the default collector used on this table.

Example

The view specification is:

subscribe Domain:
represent IlsSwTable DomainTable:
//...
subscribe Node:
represent IlsSwRow nodeRow:

The code can be:

t.setRowType("Node", "nodeRow");
Parameters
SvTypethe type of the Server object that is associated with the row.
rpObjTypethe name specified in the dynamic-view type specification file for the IlsSwRow object you want to create.
IlsSwTable::setDefaultCollector
virtual void setDefaultCollector(const IlsString &)
Lets you select the collector that will be used to add new rows to the table if the view specificatio...
IlsSwTable::setRowType
void setRowType(const IlsString &svType, const IlsString &rpType)
Sets the Server object type that must used to create a new row using a collector defined on the table...
IlsSwRow
Defines a Rogue Wave Server representation object that is a row.
Definition: row.h:124
IlsSwTable
This class defines a Rogue Wave Server representation object that is a table.
Definition: table.h:171
javascript::IlsSwGetTable
IlsSwTable IlsSwGetTable(IlvGraphic graphic)
Returns the table associated with the graphic if any.