<JSET CLASS="jset.client.data.view.JsDataCombo" ID="-1" STYLE="0x86200034">
	<RECT X="10" Y="10" W="160" H="20"/>
	<CONTENT DEF_STYLE="0x118"/>
	<EXPAND STEPS="10" W="200" H="200"/>
</JSET>


Hex Common styles Style description
Border Shows a border (COLOR CODE 3)
Border 3d Shows a 3D border (COLOR CODE 3 & COLOR CODE 4)
Visible Shows / hides the component and its content
Enabled Enables / disables the component
Strech parent Will use all parent WIDTH and HEIGHT regardless of X, Y, W, H, CONSTRAINT W, and CONSTRAINT H.
Strech right Will use all parent WIDTH from X until (parent right border - (CONSTRAINT W)), regardless of W.
Strech bottom Will use all parent HEIGHT from Y until (parent bottom border - (CONSTRAINT H)), regardless of H.
Follow right Will stick to (parent component right border - CONSTRAINT W), regardless of X.
Follow bottom Will stick to (parent component bottom border - CONSTRAINT H), regardless of Y.
0x30
"/>

Style names in red means displayed state (true/false) differs from the default component state.

Code Name XML
0 Background
<COLOR CODE="0" RGB="0xD0D0D0"/>
1 Foreground
<COLOR CODE="1" RGB="0x000000"/>
2 Disabled foreground
<COLOR CODE="2" RGB="0xBEBEBE"/>
3 Dark border
<COLOR CODE="3" RGB="0x666666"/>
4 Bright border (with 3D style)
<COLOR CODE="4" RGB="0xFFFFFF"/>


All components receive EVENTS, which are declared after each others, within the component XML node, as follows:

<JSET CLASS="..." STYLE="..." NAME="..."/>
	<RECT .../>
	<COLOR .../>
	<EVENT built{...}>
	<EVENT create{...}>
	<EVENT ...{...}>
</JSET>


built event, for the top level component only (main)

<EVENT built{
	// test if event[0] equals 0 or 1
	if(event[0] == 1) trace('This is a new file instance, its state is the initial state');
	else trace('This is an existing file instance, its state is the last state in which it was');
	// test if event[1] param exists, see getFileInstance(path, param, reload);
	if(event[1] != null) param = event[1];
}>


create event, to know when a component is created.

<EVENT create{
	trace('component has been created');
}>


loaded event, to know when a dataCpn download has completed.

<EVENT action{
	record=getSlected();
	if(record != null)
	{
		uid=record.getAttribute('uid');
		lookupValue=record.getAttribute('LOOKUP_TABLE.lookupField');
	}
}>


action event, to retrieve dataCpn selected record values.

// action is one of the most important events
<EVENT action{
	type = getType(this);
	trace(type);
	type = type.lower();
	trace(type);
	if(type.index('data') != -1)
	{
		// component having this event is a data component.
		record = getSelected();
		if(record != null)
		{
			value=record['field'];
			lookupValue=record['LOOKUP_TABLE.lookupField'];
		}
	}
	else
	{
		if(type.index('tab') == -1)
		// component is a JsTab
		tabItem = getSelected();
		// get position of tab
		for(t=0; t < tabCpn.getTabs().length();t++)
		{
			tab = tabCpn.getTabs()[t];
			if(tab == tabItem) {tabItemPos = t; break;}
		}
	}
}>


dbl_click event, to receive dataCpn double clicks (style must be set).

// action is one of the most important events
<EVENT action{
	type = getType(this);
	trace(type);
	type = type.lower();
	trace(type);
	if(type.index('data') != -1)
	{
		// component having this event is a data component.
		record = getSelected();
		if(record != null)
		{
			value=record['field'];
			lookupValue=record['LOOKUP_TABLE.lookupField'];
		}
	}
	else
	{
		if(type.index('tab') == -1)
		// component is a JsTab
		tabItem = getSelected();
		// get position of tab
		for(t=0; t < tabCpn.getTabs().length();t++)
		{
			tab = tabCpn.getTabs()[t];
			if(tab == tabItem) {tabItemPos = t; break;}
		}
	}
}>




Method name Method description   Method name Method description
cpn.getColor(code); Returns a component color.   cpn.setColor(code, value); Changes a component color.
cpn.getRect(); Returns an array of 4 elements, X, Y , W, and H.   cpn.setRect(X,Y,W,H); Sets position and size of a component.
Use null to not modify one of the params.
cpn.hasStyle(style); Returns true if component has the style.   cpn.setStyle(style, true/false); Changes a component style.
Use true or 1 to add, false of 0 to remove.
dataCpn.getSelected(); Returns the selected record.   dataCpn.setSelected(viewObj.getByCol(field,value)); Selects a dataCpn depdending on view record.
Use dataCpn.setSelected(int) to select a record by its position.


All client side data components must have a view to display result sets. There are two ways to populate content of a data component.
You can declare the VIEW settings in the component XML node, in which case the data is automatically downloaded when an XML file is instance is loaded with getFileInstance() and added to a container with .add();

<JSET CLASS="...Data...." .../>
	<VIEW NAME="CONTACTS_VIEW" TABLE="CONTACTS" SOURCE="DatabaseDynamicServiceName" ASYNC="1" STYLE="0x1">
		<JOIN FROM="countryUid" TO="uid" TABLE="COUNTRIES">
			<JOIN FROM="continentUid" TO="uid" TABLE="CONTINENTS"/>
		</JOIN>
		<JOIN FROM="companyUid" TO="uid" TABLE="COMPANIES">
			<JOIN FROM="sectorUid" TO="uid" TABLE="SECTORS"/>
		</JOIN>
	</VIEW>
	<DATA CODE="..."/>
</JSET>

JOINS declared in XML format (on Dynamic services, see host config file) are LEFT JOINS. These JOINS are performed by the Jset server, and result sets updates are automatically reflected in real-time in the Jset client data components.

SQL views consists of defining the view information, vs. XML views which do represent the result sets themselves.

Views declared in XML format are the easiest to use, and download data

Hex View style Description
0x10 Allow empty new
0x1 Auto delete The view is deleted when it component is unloaded (such as with fileInstance.close(); or when closing a tab or a window)
0x4 Delay schema
0x2 Share select
0x8 Wait in load

View method Method description
getView(viewName); Returns a view object.
viewObj.getByCol(field,value[,field2,value2,...]); Returns a view record.
Ex:


Data components, text and number edits, and buttons can be binded to a form.
You do not need to place the binded component within the XML forms tags or at any special place, as forms are declared on the top of your XML file.

All you need to do is add the FORM_FIELD node to your component XML, with the FORM_NAME.fieldName.
The fieldName must be a field of the FORM VIEW main table, not a field of a lookup table.

...



Containers


 JsContainer

 JsExpand

 JsScrollContainer

 JsSplitContainer

 JsTab


 JsDialog

 JsWindow


Data (SQL & XML result sets)


 JsDataCombo

 JsDataGrid

 JsDataGridForm

 JsListBox

 JsDataPanel

 JsDataTreeBox


 JsDataForm


Text, number, &date


 JsWordPadEdit

 JsTextArea

 JsEdit

 JsXmlTextArea


 JsNumberEdit

 JsSpinEdit


 JsExpandCalendar

 JsDatePicker


Other components


 JsButton

 JsCheckbox

 JsGroupBox

 JsMenu

 JsProgressBar

 JsRadio

 JsStatic