Child pages
  • JSRelationItem

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Wiki Markup
{hidden}
DO NOT EDIT THE CONTENT OF THIS PAGE DIRECTLY, UNLESS YOU KNOW WHAT YOU'RE DOING.
		THE STRUCTURE OF THE CONTENT IS VITAL IN BEING ABLE TO EXTRACT CHANGES FROM THE PAGE AND MERGE THEM BACK INTO SERVOY SOURCE{hidden}
{sub-section:description|text=}{sub-section}\\ 

{table:id=|class=servoy sSummary}{colgroup}{column:width=80px|padding=0px}{column}{column}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=2}Constants Summary{th}{tr}{tbody}{tr}{td}[String]{td}{td}[#LITERAL_PREFIX]
Constant for using literals in solution model in relations.{td}{tr}{tbody}{table}\\ 

{table:id=|class=servoy sSummary}{colgroup}{column:width=80px|padding=0px}{column}{column}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=2}Property Summary{th}{tr}{tbody}{tr}{td}[String]{td}{td}[#foreignColumnName]
The name of the column from the destination table
that this relation item is based on.{td}{tr}{tbody}{tbody}{tr}{td}[String]{td}{td}[#operator]
The operator that defines the relationship between the primary dataprovider
and the foreign column.{td}{tr}{tbody}{tbody}{tr}{td}[String]{td}{td}[#primaryDataProviderID]
The name of the column from the source table 
that this relation item is based on.{td}{tr}{tbody}{table}\\ 

{table:id=|class=servoy sSummary}{colgroup}{column:width=80px|padding=0px}{column}{column}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=2}Method Summary{th}{tr}{tbody}{tr}{td}[UUID]{td}{td}[#getUUID]\()
Returns the UUID of this component.{td}{tr}{tbody}{table}\\ 

{table:id=constant|class=servoy sDetail}{colgroup}{column:width=100%|padding=0px}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=1}Constants Details{th}{tr}{tbody:id=LITERAL_PREFIX|class=node}{tr:id=name}{td}h6.LITERAL_PREFIX{td}{tr}{builder-show:permission=edit}{tr:id=des}{td}{sub-section:LITERAL_PREFIX_des|trigger=button|text=}{sub-section}{sub-section:LITERAL_PREFIX_des|trigger=none|class=sIndent}ConstantReplace for using literals in solution model in relations.
Strings must be passed as quoted value to make a distinction between string '5' and number 5.with description{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:LITERAL_PREFIX_snc|trigger=button|text=}{sub-section}{sub-section:LITERAL_PREFIX_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:LITERAL_PREFIX_prs|trigger=button|text=}{sub-section}{sub-section:LITERAL_PREFIX_prs|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:LITERAL_PREFIX_ret|trigger=button|text=}{sub-section}{sub-section:LITERAL_PREFIX_ret|trigger=none|class=sIndent}[String]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:LITERAL_PREFIX_see|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:LITERAL_PREFIX_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:LITERAL_PREFIX_link|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:LITERAL_PREFIX_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:LITERAL_PREFIX_sam|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:LITERAL_PREFIX_sam|trigger=none}{code:language=javascript}
relation.newRelationItem(JSRelationItem.LITERAL_PREFIX + "'hello'",'=', 'mytextfield');
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{table}\\ 

{table:id=property|class=servoy sDetail}{colgroup}{column:width=100%|padding=0px}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=1}Property Details{th}{tr}{tbody:id=foreignColumnName|class=node}{tr:id=name}{td}h6.foreignColumnName{td}{tr}{builder-show:permission=edit}{tr:id=des}{td}{sub-section:foreignColumnName_des|trigger=button|text=}{sub-section}{sub-section:foreignColumnName_des|trigger=none|class=sIndent}The name of the column from the destination table
that this relation item is based on.}Replace with description{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:foreignColumnName_snc|trigger=button|text=}{sub-section}{sub-section:foreignColumnName_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:foreignColumnName_prs|trigger=button|text=}{sub-section}{sub-section:foreignColumnName_prs|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:foreignColumnName_ret|trigger=button|text=}{sub-section}{sub-section:foreignColumnName_ret|trigger=none|class=sIndent}[String]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:foreignColumnName_see|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:foreignColumnName_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:foreignColumnName_link|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:foreignColumnName_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:foreignColumnName_sam|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:foreignColumnName_sam|trigger=none}{code:language=javascript}
var relation = solutionModel.newRelation('parentToChild', 'db:/example_data/parent_table', 'db:/example_data/child_table', JSRelation.INNER_JOIN);
var criteria = relation.newRelationItem('parent_table_id', '=', 'child_table_parent_id');
criteria.primaryDataProviderID = 'parent_table_text';
criteria.foreignColumnName = 'child_table_text';
criteria.operator = '<';
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=operator|class=node}{tr:id=name}{td}h6.operator{td}{tr}{builder-show:permission=edit}{tr:id=des}{td}{sub-section:operator_des|trigger=button|text=}{sub-section}{sub-section:operator_des|trigger=none|class=sIndent}TheReplace operator that defines the relationship between the primary dataprovider
and the foreign column.with description{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:operator_snc|trigger=button|text=}{sub-section}{sub-section:operator_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:operator_prs|trigger=button|text=}{sub-section}{sub-section:operator_prs|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:operator_ret|trigger=button|text=}{sub-section}{sub-section:operator_ret|trigger=none|class=sIndent}[String]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:operator_see|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:operator_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:operator_link|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:operator_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:operator_sam|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:operator_sam|trigger=none}{code:language=javascript}
var relation = solutionModel.newRelation('parentToChild', 'db:/example_data/parent_table', 'db:/example_data/child_table', JSRelation.INNER_JOIN);
var criteria = relation.newRelationItem('parent_table_id', '=', 'child_table_parent_id');
criteria.primaryDataProviderID = 'parent_table_text';
criteria.foreignColumnName = 'child_table_text';
criteria.operator = '<';
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=primaryDataProviderID|class=node}{tr:id=name}{td}h6.primaryDataProviderID{td}{tr}{builder-show:permission=edit}{tr:id=des}{td}{sub-section:primaryDataProviderID_des|trigger=button|text=}{sub-section}{sub-section:primaryDataProviderID_des|trigger=none|class=sIndent}TheReplace name of the column from the source table 
that this relation item is based on.with description{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:primaryDataProviderID_snc|trigger=button|text=}{sub-section}{sub-section:primaryDataProviderID_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:primaryDataProviderID_prs|trigger=button|text=}{sub-section}{sub-section:primaryDataProviderID_prs|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:primaryDataProviderID_ret|trigger=button|text=}{sub-section}{sub-section:primaryDataProviderID_ret|trigger=none|class=sIndent}[String]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:primaryDataProviderID_see|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:primaryDataProviderID_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:primaryDataProviderID_link|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:primaryDataProviderID_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:primaryDataProviderID_sam|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:primaryDataProviderID_sam|trigger=none}{code:language=javascript}
var relation = solutionModel.newRelation('parentToChild', 'db:/example_data/parent_table', 'db:/example_data/child_table', JSRelation.INNER_JOIN);
var criteria = relation.newRelationItem('parent_table_id', '=', 'child_table_parent_id');
criteria.primaryDataProviderID = 'parent_table_text';
criteria.foreignColumnName = 'child_table_text';
criteria.operator = '<';
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{table}\\ 

{table:id=function|class=servoy sDetail}{colgroup}{column:width=100%|padding=0px}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=1}Method Details{th}{tr}{tbody:id=getUUID|class=node}{tr:id=name}{td}h6.getUUID{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[UUID]{span}{span:id=iets|style=float: left; font-weight: bold;}getUUID{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{builder-show:permission=edit}{tr:id=des}{td}{sub-section:getUUID_des|trigger=button|text=}{sub-section}{sub-section:getUUID_des|trigger=none|class=sIndent}ReturnsReplace the UUID of this component.with description{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:getUUID_snc|trigger=button|text=}{sub-section}{sub-section:getUUID_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:getUUID_prs|trigger=button|text=}{sub-section}{sub-section:getUUID_prs|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:getUUID_ret|trigger=button|text=}{sub-section}{sub-section:getUUID_ret|trigger=none|class=sIndent}[UUID]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:getUUID_see|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:getUUID_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:getUUID_link|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:getUUID_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:getUUID_sam|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:getUUID_sam|trigger=none}{code:language=javascript}
var button_uuid = solutionModel.getForm("my_form").getButton("my_button").getUUID();
application.output(button_uuid.toString());
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{table}