Skip to main content
Version: 21 BETA

WebFormItem

The 4D.WebFormItem class allows you to handle the behavior of your Qodly webform components.

4D.WebFormItem objects are properties of the 4D.WebForm object returned by the Web Form command.

When you call the Web Form command, the returned 4D.WebForm proxy object holds as many 4D.WebFormItems as there are components with server-side references in your webform.

For example, WebFormObject.myImage refers to the image component with myImage as server reference.

History
ReleaseChanges
20 R2Added

WebFormItem object

.addCSSClass(className : string)
adds the class specified in className to the component
.hide()
hides the component
.removeCSSClass(className: string)
removes the class specified in className from the component
.show()
makes the component visible

.addCSSClass()

.addCSSClass(className : string)

ParameterTypeDescription
classNamestring->Name of the CSS class to add to the component

Description

The .addCSSClass function adds the class specified in className to the component.

.hide()

.hide()

ParameterTypeDescription
Does not require any parameters

Description

The .hide() function hides the component.

Example

To call a function that hides an image when the user clicks a button:

  1. Create an exposed function inside a shared singleton class named isHidden that contains the following code:

shared singleton Class constructor()
exposed Function isHidden()
var myComponent : 4D.WebFormItem

myComponent:=Web Form.myImage
myComponent.hide() // Hide the component that has "myImage" as server reference
  1. In Qodly Studio: Select the image component on the canvas, and enter a server-side reference in the Properties Panel > Server Side, for example "myImage".
  2. Select the Button component and add an onclick event to it.
  3. Attach the isHidden function to the event.

.removeCSSClass()

.removeCSSClass(className: string)

ParameterTypeDescription
classNamestring->Name of the CSS class to remove from the component

Description

The .removeCSSClass() function removes the class specified in className from the component.

.show()

.show()

ParameterTypeDescription
Does not require any parameters

Description

The .show() function makes the component visible.If the component was already visible, the function does nothing.

See also

Web Form
Web Event
WebForm class