Child pages
  • JSHeader
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

Refresh page May 03, 2024 19:12

Supported Clients
SmartClient WebClient

Property Summary
Boolean allowBreakAcrossPageBounds When set, the remainder of a selected part that does not fit on the page currently being printed, will not be transported to the next page - it will break where the page ends and continue on the next page.
String background The background color of the form part.
Boolean discardRemainderAfterBreak When set, the remainder of a selected part that is broken due to the page ending will not be printed on the next page - it will be discarded.
String groupbyDataProviderIDs For Leading Subsummary or Trailing Subsummary parts, one or more dataproviders can be added as Break (GroupBy) dataproviders.
Number height The height of a selected part; specified in pixels.
Number pageBreakAfterOccurrence A page break will be inserted after a specified number of occurences of a selected part.
Boolean pageBreakBefore When set, a page break will be inserted before each occurrence of a selected part.
Boolean restartPageNumber When set, page numbering will be restarted after each occurrence of a selected part.
Boolean sinkWhenLast When set, the last part on a page (such as a Trailing Grand Summary part) will "sink" to the lowest part of the page when there is free space.
Boolean sticky Flag to set a set the header sticky so it will not scroll out of view.
String styleClass The Cascading Style Sheet (CSS) class name applied to the part.

Methods Summary
JSTitle getHeaderText() Returns the header text label on the form header if present.
JSComponent getLeftButton() Returns the left-button on the form header if present.
Number getPartType() The type of this part.
Number getPartYOffset() The Y offset of the part on the form, this will include all the super forms parts if this form extends a form.
JSComponent getRightButton() Returns the right-button on the form header if present.
UUID getUUID() Returns the UUID of this component.
JSTitle newHeaderText(text) Creates a new header text label on the form header.
JSComponent newLeftButton(text, jsmethod) Creates a new left-button on the form header.
JSComponent newRightButton(text, jsmethod) Creates a new right-button on the form header.
Boolean removeHeaderText() Remove the header text label on the form header if present.
Boolean removeLeftButton() Remove the left-button on the form header if present.
Boolean removeRightButton() Remove the right-button on the form header if present.

Property Details

allowBreakAcrossPageBounds

When set, the remainder of a selected part that does not fit on the page currently
being printed, will not be transported to the next page - it will break where the page
ends and continue on the next page.

NOTE: Make sure to set this option when you are printing more than one page per record.

Returns

Supported Clients

SmartClient,WebClient

Sample

var body = form.newPart(JSPart.BODY, 320);
body.allowBreakAcrossPageBounds = true;
body.discardRemainderAfterBreak = true;

background

The background color of the form part.

NOTE: When no background color has been set, the default background
color will be determined by the Look and Feel (LAF) that has been selected
in Application Preferences.

Returns

Supported Clients

SmartClient,WebClient,NGClient

Sample

var body = form.newPart(JSPart.BODY, 320);
body.background = 'green';

discardRemainderAfterBreak

When set, the remainder of a selected part that is broken due to the page
ending will not be printed on the next page - it will be discarded.

Returns

Supported Clients

SmartClient,WebClient

Sample

var body = form.newPart(JSPart.BODY, 320);
body.allowBreakAcrossPageBounds = true;
body.discardRemainderAfterBreak = true;

groupbyDataProviderIDs

For Leading Subsummary or Trailing Subsummary parts, one or more
dataproviders can be added as Break (GroupBy) dataproviders. The
Leading/Trailing Subsummary parts will be displayed once for each
resulted group of data.

Returns

Supported Clients

SmartClient,WebClient,NGClient

Sample

var leadingSubsummary = form.newPart(JSPart.LEADING_SUBSUMMARY, 160);
leadingSubsummary.groupbyDataProviderIDs = 'my_table_text';

height

The height of a selected part; specified in pixels.

This height property is the lowerbound as its ending Y value (0 == top of the form).

Returns

Supported Clients

SmartClient,WebClient,NGClient

Sample

var part = form.newPart(JSPart.HEADER, 100);
part.height = 200;

pageBreakAfterOccurrence

A page break will be inserted after a specified number of occurences of a selected part.

Returns

Supported Clients

SmartClient,WebClient

Sample

var body = form.newPart(JSPart.BODY, 320);
body.pageBreakAfterOccurrence = 2;

pageBreakBefore

When set, a page break will be inserted before each occurrence of a selected part.

Returns

Supported Clients

SmartClient,WebClient

Sample

var leadingSubsummary = form.newPart(JSPart.LEADING_SUBSUMMARY, 160);
leadingSubsummary.groupbyDataProviderIDs = 'my_table_text';
leadingSubsummary.pageBreakBefore = true;

restartPageNumber

When set, page numbering will be restarted after each occurrence of a selected part.

Returns

Supported Clients

SmartClient,WebClient

Sample

var trailingSubsummary = form.newPart(JSPart.TRAILING_SUBSUMMARY, 360);
trailingSubsummary.groupbyDataProviderIDs = 'my_table_text';
trailingSubsummary.restartPageNumber = true;

sinkWhenLast

When set, the last part on a page (such as a Trailing Grand Summary part) will
"sink" to the lowest part of the page when there is free space.

Returns

Supported Clients

SmartClient,WebClient,NGClient

Sample

var trailingGrandSummary = form.newPart(JSPart.TRAILING_GRAND_SUMMARY, 400);
trailingGrandSummary.sinkWhenLast = true;

sticky

Flag to set a set the header sticky so it will not scroll out of view.

Returns

Supported Clients

SmartClient,WebClient,NGClient

Sample

var form = solutionModel.newForm('newForm1', myDatasource);
var header = form.newHeader()
header.sticky = false // default: true

styleClass

The Cascading Style Sheet (CSS) class name applied to the part.

Returns

Supported Clients

SmartClient,WebClient,NGClient

Sample

var body = form.newPart(JSPart.BODY, 320);
body.styleClass = 'myBody';

Methods Details

getHeaderText()

Returns the header text label on the form header if present.

Returns

Supported Clients

SmartClient,WebClient,NGClient

Sample

var form = solutionModel.getForm('myform');
var header = form.getHeader()
var title = header.getHeaderText()
title.text = 'Customers'

getLeftButton()

Returns the left-button on the form header if present.

Returns

Supported Clients

SmartClient,WebClient,NGClient

Sample

var form = solutionModel.getForm('myform');
var header = form.getHeader()
var button = header.getLeftButton()
button.iconType = JSButton.ICON_HOME

getPartType()

The type of this part.

Returns

Supported Clients

SmartClient,WebClient,NGClient

Sample

var allParts = form.getParts()
for (var i=0; i<allParts.length; i++) {
	if (allParts[i].getPartType() == JSPart.BODY)
		application.output('body Y offset: ' + allParts[i].getPartYOffset());
}

getPartYOffset()

The Y offset of the part on the form, this will include all the super forms parts if this form extends a form.

Returns

Supported Clients

SmartClient,WebClient,NGClient

Sample

var allParts = form.getParts()
for (var i=0; i<allParts.length; i++) {
	if (allParts[i].getPartType() == JSPart.BODY)
		application.output('body Y offset: ' + allParts[i].getPartYOffset());
}

getRightButton()

Returns the right-button on the form header if present.

Returns

Supported Clients

SmartClient,WebClient,NGClient

Sample

var form = solutionModel.getForm('myform');
var header = form.getHeader()
var button = header.getRightButton()
button.iconType = JSButton.ICON_GEARS

getUUID()

Returns the UUID of this component.

Returns

Supported Clients

SmartClient,WebClient,NGClient

Sample

var button_uuid = solutionModel.getForm("my_form").getButton("my_button").getUUID();
application.output(button_uuid.toString());

newHeaderText(text)

Creates a new header text label on the form header.

Parameters

Object text the text on the header

Returns

Supported Clients

SmartClient,WebClient,NGClient

Sample

var form = solutionModel.newForm('newForm1', myDatasource);
var header = form.newHeader()
var title = header.newHeaderText('Contacts')

newLeftButton(text, jsmethod)

Creates a new left-button on the form header.

Parameters

String text the text on the button
Object jsmethod the method assigned to handle an onAction event

Returns

Supported Clients

SmartClient,WebClient,NGClient

Sample

var form = solutionModel.newForm('newForm1', myDatasource);
var header = form.newHeader()
var button = header.newLeftButton('back', form.getMethod('goBack'))

newRightButton(text, jsmethod)

Creates a new right-button on the form header.

Parameters

String text the text on the button
Object jsmethod the method assigned to handle an onAction event

Returns

Supported Clients

SmartClient,WebClient,NGClient

Sample

var form = solutionModel.newForm('newForm1', myDatasource);
var header = form.newHeader()
var button = header.newRightButton('save', form.getMethod('doSave'))

removeHeaderText()

Remove the header text label on the form header if present.

Returns

Supported Clients

SmartClient,WebClient,NGClient

Sample

var form = solutionModel.getForm('myform');
var header = form.getHeader()
var removed = header.removeHeaderText()

removeLeftButton()

Remove the left-button on the form header if present.

Returns

Supported Clients

SmartClient,WebClient,NGClient

Sample

var form = solutionModel.getForm('myform');
var header = form.getHeader()
var removed = header.removeLeftButton()

removeRightButton()

Remove the right-button on the form header if present.

Returns

Supported Clients

SmartClient,WebClient,NGClient

Sample

var form = solutionModel.getForm('myform');
var header = form.getHeader()
var removed = header.removeRightButton()

  • No labels