Docs
ServoyCloudSupportSamplesOpen SourceCommunity
  • Home
  • GUIDES
    • Platform Overview
    • Get Servoy
    • Get Started
      • Chapter 0
      • Chapter 1
      • Chapter 2
      • Chapter 3
      • Chapter 4
      • Chapter 5
    • Get Help
      • SuLA Instructions
      • SuLA Terms
    • Develop
      • Application Design
        • Forms
          • Layout Management
            • Simple Layout
            • Fully Responsive
              • Bootstrap 12-Grid
              • Flexbox
              • Custom Div
              • Collapsible Container
              • Simple Collapsible
              • Center Container
              • Inline Group Container
            • Abstract Form
          • Form Containers
            • Form Container
            • Tab Panel
            • Split Pane
            • Collapse
            • Accordion Panel
            • Form Component
            • List Form Component
          • Form Inheritance
          • Form Components
        • UI Components
          • Buttons and Text
            • Badge
            • Button
            • Data Label
            • Dropdown
            • Image
            • Label
          • Grids
            • Data Grid
            • Power Grid
            • Table
          • Input Controls
            • Calendar
            • Calendar Inline
            • Checkbox
            • Choice Group
            • Combobox
            • Group Buttons
            • Html Area
            • Input Group
            • Rating
            • Slider
            • Switch
            • Spinner
            • TextArea
            • Textbox
            • TextBoxGroup
            • Type Ahead
            • select2tokenizer
          • Media
            • Carousel
            • Embedded YouTube
            • File upload
            • Image label
            • Lightbox Gallery
            • MultiFile Upload
            • PDF JS Viewer
            • PDF Viewer
          • Mobile
            • Native Data List
            • Native Select
          • Navigation
            • Breadcrumbs
            • Navbar
            • sidenav
          • Visualization
            • DBTreeview
            • Progress Bar
            • Treeview
            • ChartJS
              • Data Labels Plugin
              • Funnel Chart
              • OutLabels Plugin
              • TreeMap
          • Specialized Components
            • Smart Document Editor
            • Servoy PDF Viewer
            • Fullcalendar Component
              • Fullcalendar
              • Fullcalendar Events
              • Migrating calendar from Smart and Web client to NG client
            • Fullcalendar Component 2
            • Canvas
            • Google Charts
            • Google Maps
            • svySignature
            • svywebcam
        • Styling and Themes
          • Default Theme Properties
          • CSS / LESS
          • Component Variants
          • Font Icons
        • Data Modeling
          • Databases
            • Tables
              • Columns
              • Calculations
              • Aggregations
              • Methods
              • Events / Triggers
              • Table security
            • Views
            • Procedures
          • Relations
          • Value Lists
          • Menus
          • In-Memory Databases
          • View Datasource
        • Modular Design
      • Programming Guide
        • Scripting the UI
          • Scripting Forms
          • Interacting with Components
          • Navigation
          • Windows, Dialogs and Popups
          • Events Manager
        • Working with Data
          • Concepts
          • Loading
          • Sorting
          • Iterating
          • Searching
            • Find mode
            • Query Builder
            • SQL String
          • Filtering
          • Editing
          • Validation
        • Automation and Scheduling
          • Batch Processor
          • Headless API
          • Scheduler API
        • Creating REST APIs
        • Consuming Webservices
        • Working with Files
          • File Plugin Basics
          • Images
          • Excel
          • PDF
          • JSON
        • Browser Utilities
          • Notifications
            • Web Notifications (Toastr)
            • Web Notifications (Native)
            • Block UI
          • Session Management
          • Keyboard Utilities
          • NG Utils
        • Sending and Receiving Email
        • Servoy Jasper Reports
          • Input Type
          • Display Mode
          • Output format
          • Jaspe Reports Viewer
        • Extensions
          • Modules
            • svyPhonegap
              • First Use Guide
              • Barcode Scanner
              • Browser
              • Camera
              • File
              • Fingerprint
              • Location
              • Network Interface
              • Phonegap
              • Printer
              • Push Notifications
            • svyAPI
              • Getting Started
            • svyLookup
              • Custom Templates
              • API Documentation
              • svyLookup v1
                • API Documentation v1.0.0
                • Base Form svyLookupTable v1.0.0
                • Base Form AbstractLookup v1.0.0
            • svyNavigation
              • API Documentation
                • API svyNavigation
                • API svyNavigationHistory
                • API svyNavigationUX
            • svyPopupFilter
              • Simple Filter Pickers
              • Custom Templates
              • API Documentation
                • API svyToolbarFilter
                • API svyPopupFilter
              • API Documentation v1
                • API svyToolbarFilter v1
                • API svyPopupFilter v1
            • svySearch
            • svySecurity
              • Overview
              • Token-based Auth and SSO (NEW!)
              • API Documentation
              • Getting Started
              • Tenant replication
              • Security Management Console
                • Classic Security Management Console
              • svySecurityUX
              • svyProperties
              • API Doc svyProperties
            • svyUtils
              • Log Manager
              • Log Manager Appenders
              • Smart Doc Editor Utils
              • Custom Dialogs
              • Excel Utils
                • Full API Reference
              • Crypto Utils
      • Security
        • Authentication
        • Permissions
          • UI Permissions
          • Data Permissions
          • Runtime Permissions
        • Audit Logging
        • OAuth
        • JWT
      • Multi-Language Support
      • Mobile Development
        • Getting Started
        • Mobile Design
        • Native Mobile Integrations
        • Building a Native Binary for the App Store
      • Native Desktop Development
        • NGDesktop UI plugin
        • NGDesktop Utils
        • NGDesktop File Plugin
    • Deploy
      • WAR Deployment
      • Docker Deployment
      • Server Configuration
        • Server Settings
        • Server Plugins
        • Database Servers
          • Locks
          • Transactions
          • Oracle
          • SQLServer
        • Client Sessions
        • Batch Processors
        • License Management
        • Monitoring
          • Server Log
          • Browser Console Log
          • Websocket Log
          • Query Performance
          • Client Performance
          • Client Event Tracing
          • Monitoring Servoy with JMX
      • NGClient deployment
      • Troubleshooting
      • Other Topics
        • Security: Cross-site Scripting
        • Running in an iFrame
    • Extend
    • Contribute
  • Reference
    • Servoy Core
      • Object Model
        • Database Server
          • Table
            • Column
            • Calculation
            • Method
            • Aggregation
          • View
          • Procedure
        • Solution
          • Form
          • Form Component
          • Relation
          • Relation Item
          • Table Node
          • Value List
          • Menu
          • Menu item
          • In-Memory Data Source
          • View Foundset Data Source
          • Variable
          • Column Info
          • Media
          • Layout Container
          • Method
        • i18n Message Key
      • Developer API
        • Globals
        • Forms
          • RuntimeForm
            • controller
            • containers
              • RuntimeContainer
            • elements
              • Component
              • RuntimeAccordionPanel
              • RuntimeBean
              • RuntimeButton
              • RuntimeCalendar
              • RuntimeCheck
              • RuntimeCombobox
              • RuntimeComponent
              • RuntimeDataButton
              • RuntimeDataLabel
              • RuntimeGroup
              • RuntimeHtmlArea
              • RuntimeImageMedia
              • RuntimeInsetList
              • RuntimeLabel
              • RuntimeListBox
              • RuntimePassword
              • RuntimePortal
              • RuntimeRadio
              • RuntimeChecks
              • RuntimeRadios
              • RuntimeRectangle
              • RuntimeRtfArea
              • RuntimeSpinner
              • RuntimeSplitPane
              • RuntimeTabPanel
              • RuntimeTextArea
              • RuntimeTextField
              • RuntimeWebComponent
        • JS Lib
          • Array
          • BigInt
          • Boolean
          • Date
          • Function
          • IterableValue
          • Iterator
          • JSON
          • Map
          • Set
          • Math
          • Namespace
          • Number
          • Object
          • Promise
          • QName
          • RegExp
          • Special Operators
          • Statements
          • String
          • XML
          • XMLList
        • Application
          • APPLICATION_TYPES
          • CLIENTDESIGN
          • DRAGNDROP
          • ELEMENT_TYPES
          • LOGGINGLEVEL
          • NGCONSTANTS
          • UICONSTANTS
          • CSSPosition
          • JSDimension
          • JSDNDEvent
          • JSEvent
          • JSLogger
          • JSLogBuilder
          • JSPoint
          • JSUpload
          • JSWindow
          • JSBounds
          • Renderable
          • UUID
        • SolutionModel
          • ALIGNMENT
          • ANCHOR
          • BEVELTYPE
          • CURSOR
          • DEFAULTS
          • FONTSTYLE
          • MEDIAOPTION
          • PAGEORIENTATION
          • PRINTSLIDING
          • SCROLLBAR
          • TITLEJUSTIFICATION
          • TITLEPOSITION
          • UNITS
          • JSBean
          • JSButton
          • JSCalculation
          • JSComponent
          • JSDataSourceNode
          • JSField
          • JSForm
          • JSLabel
          • JSMedia
          • JSMethod
          • JSPart
          • JSPortal
          • JSRelation
          • JSRelationItem
          • JSStyle
          • JSTab
          • JSTabPanel
          • JSValueList
          • JSVariable
          • JSTitle
          • JSChecks
          • JSCombobox
          • JSHeader
          • JSInsetList
          • JSList
          • JSPassword
          • JSRadios
          • JSText
          • JSTextArea
          • JSWebComponent
          • JSLayoutContainer
        • Database Manager
          • QUERY_COLUMN_TYPES
          • SQL_ACTION_TYPES
          • JSColumn
          • JSDataSet
          • JSBaseRecord
          • JSBaseSqlRecord
          • JSBaseFoundset
          • JSBaseSQLFoundset
          • JSFoundSet
          • JSFoundSetUpdater
          • JSRecord
          • JSRecordMarker
          • JSRecordMarkers
          • JSTable
          • JSTableFilter
          • MenuFoundSet
          • MenuItemRecord
          • QBAggregate
          • QBAggregates
          • QBCase
          • QBCaseWhen
          • QBColumn
          • QBColumns
          • QBCondition
          • QBFunction
          • QBFunctions
          • QBGroupBy
          • QBJoin
          • QBJoins
          • QBLogicalCondition
          • QBParameter
          • QBParameters
          • QBPart
          • QBResult
          • QBSearchedCaseExpression
          • QBSelect
          • QBSort
          • QBSorts
          • QBTableClause
          • QBWhereCondition
          • ViewFoundSet
          • ViewRecord
        • Events Manager
          • EVENTS_AGGREGATION_TYPES
          • EventType
        • Menus
          • JSMenu
          • JSMenuItem
        • JSMenuDatasource
        • Utils
        • Client Utils
          • JSBlobLoaderBuilder
        • History
        • Security
        • i18n
        • ServoyException
          • DataException
        • JSUnit
        • Datasources
          • DBDataSource
          • DBDataSourceServer
          • JSConnectionDefinition
          • JSDataSource
          • MemDataSource
          • MenuDataSource
          • SPDataSource
          • SPDataSourceServer
          • ViewDataSource
        • JSViewDatasource
        • servoyDeveloper
        • enum
    • Extensions
      • UI Components
        • Buttons and Text
          • Badge
          • Button
          • Data Label
          • Drop Down
          • Image
          • Label
        • Form Containers
          • Accordion Panel
          • Collapse
          • Form Container
          • Form Component Container
          • List Form Component
          • Default Loading Indicator
          • Error Bean
          • Portal
          • Responsive Container
          • Servoy Default Navigator
          • Slider
          • Split Pane
          • TabPanel
        • Grids
          • Data Grid
          • Power Grid
          • Table
        • Input Controls
          • Calendar
          • Calendar Inline
          • Checkbox
          • Choice Group
          • Combobox
          • Floatinglabel Calendar
          • Floatinglabel Combobox
          • Floatinglabel Textarea
          • Floatinglabel Textbox
          • Floatinglabel Type Ahead
          • Group Buttons
          • Html Area
          • Input Group
          • Rating
          • Select2tokenizer
          • Slider
          • Spinner
          • Switch
          • TextArea
          • TextBox
          • TextBox Group
          • Type Ahead
        • Media
          • Carousel
          • Embedded YouTube
          • File upload
          • Image label
          • Lightbox Gallery
          • MultiFile Upload
          • PDF JS Viewer
          • PDF Viewer
        • Mobile
          • Native Data List
          • Native Select
        • Navigation
          • Breadcrumbs
          • Navbar
          • sidenav
        • SmartDocEditor
          • Smart Document Editor
        • Visualization
          • Canvas
          • Chart
          • Custom List
          • DBTreeview
          • Foundset List
          • Fullcalendar
          • Gauge
          • Google Maps
          • Kanban
          • Progress Bar
          • Treeview
      • Server Plugins
        • amortization
          • AmortizationCalculation
          • Polynomial
        • clientmanager
          • Broadcaster
          • JSClientInformation (cm)
        • excelxport
        • file
          • JSFile
          • JSProgressMonitor
        • headlessclient
          • JSClient
        • http
          • HTTP_STATUS
          • Cookie
          • DeleteRequest
          • GetRequest
          • HeadRequest
          • HttpClient
          • HttpClientConfig
          • OptionsRequest
          • PostRequest
          • PutRequest
          • Response
          • TraceRequest
          • PatchRequest
          • JSFileUpload
        • images
          • JSImage
        • jwt
          • Algorithm
          • Builder
          • JWTClaims
        • mail
          • Attachment
          • MailMessage
        • maintenance
          • JSClientInformation
          • JSColumnObject
          • JSServer
          • JSTableObject
        • mobileservice
          • OfflineDataDescription
        • oauth
          • ClientAuthentication
          • CustomApiBuilder
          • OAuthProviders
          • OAuthRequest
          • OAuthResponse
          • OAuthResponseBinary
          • OAuthResponseJSON
          • OAuthResponseText
          • OAuthService
          • OAuthServiceBuilder
          • OAuthTokenExtractors
          • RequestType
        • pdf_output
        • rawSQL
        • RestWs plugin
        • rest_ws
          • WsContents
          • WsCookie
          • WsRequest
          • WsResponse
        • scheduler
        • serialize
        • textxport
          • DataProviderExport
          • TabExporter
        • udp
          • JSPacket
        • XmlReader
          • XmlNode
      • Browser Plugins
        • Block UI
        • Block UI (ref)
        • Dialogs Plugin
        • Idle
        • Idle (ref)
        • Key Listener
        • Key Listener (ref)
        • NGDesktop File
        • NGDesktop File (ref)
        • NGDesktop UI (ref)
        • NGDesktop Utils (ref)
        • NG Utils (ref)
        • Office Javascript API for Servoy
        • Phonegap
        • Web Notifications (Native)
        • Web Notifications (Toastr)
        • Window Plugin
        • Font Awesome
      • Modules
        • Smart Doc Editor Utils
        • svyAPI
          • Getting Started
        • svyLookup
          • Custom Templates
          • API Documentation
          • svyLookup v1
            • API Documentation v1.0.0
            • Base Form svyLookupTable v1.0.0
            • Base Form AbstractLookup v1.0.0
        • svyLookupExample
        • svyNavigation
          • API Documentation
            • API svyNavigation
            • API svyNavigationHistory
            • API svyNavigationUX
        • svyNavigationUX
        • svyNavigationUXSample
        • svyPopupFilter
          • Simple Filter Pickers
          • Custom Templates
          • API Documentation
            • API svyToolbarFilter
            • API svyPopupFilter
          • API Documentation v1
            • API svyToolbarFilter v1
            • API svyPopupFilter v1
        • svyProperties
        • svySearch
        • svySecurity
          • Overview
          • Token-based Auth and SSO (NEW!)
          • API Documentation
          • Getting Started
          • Tenant replication
          • Security Management Console
            • Classic Security Management Console
          • svySecurityUX
          • svyProperties
          • API Doc svyProperties
        • svySecurityConsole
        • svySecurityUX
        • svyUtils
          • Log Manager
          • Log Manager Appenders
          • Smart Doc Editor Utils
          • Custom Dialogs
          • Excel Utils
          • Full API Reference
          • Crypto Utils
        • svyUtils$Excel
        • svyUtils$NGClient
        • svyUtils$customDialogs
        • svyUtils$logManagerAppenders
        • svyUtils$tableGrid
      • Layout
        • Boostrap 12grid layout
          • Collapsible Container
          • Simple Collapsible
          • Center Container
          • Inline Group Container
          • Flexbox Layout
      • Solutions
        • Sample Application
          • Tutorial Part 1
          • Tutorial Part 2
      • Packages
        • UI Component Packages
          • Advanced Renderers
          • Bootstrap Components
          • Bootstrap Extra Components
          • Canvas
          • Chart JS
          • Fullcalendar Component
          • googlemaps
          • kanban
          • Servoy Core
          • Servoy Extra Components
          • Servoy NG-Grids
          • Servoy PDF Viewer
          • smartDocumentEditor
        • Browser Plugin Packages
          • Block UI
          • Core NG only Services
          • Key Listener
          • NGDesktop File
          • NGDesktop UI
          • NGDesktop Utils
          • Web Notifications
          • Idle Web Service
    • Servoy Developer
      • Menu
        • File
        • Edit
        • Source
        • Refactor
        • Navigate
        • Search
        • Project
        • Actions
        • Run
        • Window
        • Help
      • Toolbar
      • Solution Explorer
        • Resources
          • Database Servers
            • Database Server
              • Procedures
              • Tables
              • Views
          • Security
          • i18n
        • All Solutions
          • Solution
          • Active Solution
            • Scopes
              • Scope
                • Variables
            • Forms
              • Working Set
              • Form
                • Controller
                • Variables
                • Elements
                • Relations
            • Form Components
              • Form Component
            • Relations
              • Relation
            • ValueLists
              • ValueList
            • Menus
              • Menu
                • MenuItem
            • Media
              • Folder
              • File
            • DataSources
              • In Memory DataSources
                • In Memory DataSource
              • View Foundsets DataSources
                • View Foundset DataSources
            • Servoy Packages
              • Package
            • Modules
              • Module
        • Solution Explorer Contextual List
      • Views
        • Command Console
        • Console
        • Problems
        • Tasks
        • Bookmarks
        • Search
        • Form Hierarchy
        • Help
        • JUnit
        • Outline
        • Profiler
        • Properties
        • Project Explorer
        • Call Hierarchy
      • Editors and Wizards
        • Property configurator for columns
        • Relation Editor
        • Text Format Editor
        • Date Format Editor
        • Number Format Editor
        • Database Synchronization Wizard
        • Security Editor
        • SQL Editor
        • i18n Editor
        • File Import Wizard
        • File Export Wizard
        • WAR Export Wizard
        • NGDesktop Export Wizard
        • Table Editor
        • Metadata Synchronization Wizard
        • Database Server Connection Editor
        • Text Property Editor
        • Valuelist Editor
        • Form Editor
          • Parts of the Form Editor
          • Designing a Form
          • Layout Tools
          • Using Containers
          • Creating and Using Forms
          • Using Servoy Beans
          • Using Shapes
          • Form Editor Subtabs
          • [Tips and Shortcuts][reference/servoy-developer/object-editors/form-editor-tips_and_shortcuts.md]
          • Editong a Responsive LayoutForm
          • CSS Positioning
        • Form Hierarchy
        • Component Properties Editor
        • Variable Editor
        • Method Selection Wizard
        • New Solution Wizard
        • Application Event Types Editor
        • New Form Wizard
        • Form Dataproviders Configurator
        • Servoy Resource Locator
        • Datasource Selection Wizard
        • Sorting Fields Wizard
        • Scripting Editor
          • Getting Started-Overview of Script Editor
          • Code Writing Features
          • Code Navigation
          • Code Rewriting Tools
          • Refactoring
          • Code Formatting
          • Script Editor Tips and Shortcuts
          • Unit Tests
        • Theme Editor
          • General Properties
          • Sidenav Properties
          • Navbar Properties
          • Tabs Properties
          • Windows Properties
          • Dialogs Properties
          • Tables Properties
          • Breadcrumb specific style Properties
          • Brand colors Properties
          • Validations Properties
          • Margins and Padding Properties
        • Editor Selection
        • Run Configurations
        • Debug Configurations
        • Externalize Strings Wizard
        • Font Chooser Wizard
        • Color Chooser Wizard
        • Project Properties Configurator
        • Move Wizard
        • External Tools Configurations
        • About Servoy Developer
        • Servoy Developer Installation Details
        • Eclipse Marketplace Wizard
        • Install Available Software Wizard
        • Cheat Sheet Selection Wizard
        • Servoy Developer Help Wizard
        • Switch to Editor Wizard
        • Find Actions Wizard
        • Customize Perspective Configurator
        • Quick Search Wizard
        • Search Wizard
        • Encoding Wizard
        • Task Wizard
        • Find - Replace Wizard
        • Properties Editor
        • New Project Wizard
        • New Method Wizard
        • New Menu Wizard
          • New MenuItem Wizard
        • Menu Editor
        • ServoyMenu Selection Wizard
        • JSMenu compatible component selector
        • Permissions Configuration Dialog
      • Project File Structure
        • Servoy Installation Directory
          • servoy.properties
        • Workspace Folder
          • Resources Directory
            • Database Information (.dbi) Files
          • Solution Folder
      • Package Manager
      • Preferences
      • Property Types for components / services
      • Debugger
        • Debug Explorer
        • Breakpoints
          • Breakpoint Properties
        • Variables
        • Expressions
        • Interactive Console
    • Application Server
    • Servoy Cloud
      • Cloud Control Center
        • Home
          • Setup Namespace
          • User profile
            • My Profile
            • Support
        • Download IDE
        • Application Overview
          • Applications
            • Pipelines
              • Jobs
                • Packages
                  • Commits
                  • Artifacts
                  • Configuration
                  • Quality reports
                  • Build markers
                • Job Configuration
                  • Build and Deploy or Build
                  • Mobile
                  • Desktop
            • Environments
              • Metrics
                • Users
                • Databases
                  • Metrics
                • System Health
                • Log Activity
                • App performance
                • Query performance
              • Cloud reporting
            • Security
              • Permissions
              • Tenants
            • Reports
            • Security Login Designer
              • Single Sign-On
                • Sign in with Google
                • Sign in with Microsoft
          • Code Repositories
        • Project Management
          • Tickets
          • Backlog
          • Active Sprints
        • User Management
          • Users
          • Roles
        • Administration
          • Security
            • ServoyCloud Roles
          • Credentials
          • Settings
        • Add-Ons
      • Database Backup
      • E2E Cypress Testing
        • Using Cypress
      • On-Premise Deployment
      • Privacy policy (ServoyAI)
      • FAQ
      • Migrate to Servoy Cloud
    • Extensions Developement
      • Component and Services
        • Component Development
        • Service Development
        • Tools and Dev Tips to use for Component/Service developement
        • Manifest (.mf file)
        • Specification (.spec file)
          • Property Types
            • Array property types
            • Custom object property types
            • Findmode property type
            • Foundset property type
            • Tags
        • Directives And Filters
          • Sablotabsequence
        • Console (serverside)
        • ServoyApi (serverside)
      • Serverside Plugins
        • Data Convertors and Validators
        • UI Convertors
  • Release notes
    • Release notes
      • 2025.03
      • 2024.03 (LTS)
      • 2023.03 (LTS)
      • 2025.03 (Servoy Cloud)
      • 2024.12
      • 2024.12 (Servoy Cloud)
      • 2024.09
      • 2024.09 (Servoy Cloud)
      • 2024.06
      • 2024.06 (Servoy Cloud)
      • 2024.03 (Servoy Cloud)
      • 2023.12
      • 2023.12 (Servoy Cloud)
      • 2023.09
      • 2023.09 (Servoy Cloud)
      • 2023.06
      • 2022.03 (LTS)
      • 2022.12 What's new
      • 2022.12
      • 2022.09 What's new
      • 2022.09
      • 2022.06 What's new
      • 2022.06
      • 2021.03.3 (LTS)
Powered by GitBook
On this page
  • Classes
  • Functions
  • Lookup
  • createLookup(dataSource) ⇒ Lookup
  • createQueryLookup(qbSelect, [dsName], [overrideData]) ⇒ Lookup
  • createValueListLookup(valuelistName, [titleText]) ⇒ Lookup

Was this helpful?

  1. GUIDES
  2. Develop
  3. Programming Guide
  4. Extensions
  5. Modules
  6. svyLookup

API Documentation

PreviousCustom TemplatesNextsvyLookup v1

Last updated 1 year ago

Was this helpful?

Classes

Functions

⇒

Creates a lookup object which can be used to show a pop-up form

⇒

Creates a read only, in-memory datasource from the given query and creates a Lookup for that

⇒

Creates a lookup object from a valuelist which can be used to show a pop-up form or a modal window

NOTE: Valuelist cannot be based on a database relation or a global method. Custom Valuelists can show up to 500 items in lookup.

Lookup

    • ⇒

    • ⇒ plugins.window.FormPopup

    • ⇒ JSWindow

    • ⇒ String

    • ⇒

    • ⇒ Number

    • ⇒ JSFoundSet

    • ⇒ String

    • ⇒ [ 'RuntimeForm' ].<AbstractLookup>

    • ⇒ Array

    • ⇒ [ 'Array' ].<JSRecord>

    • ⇒ [ 'Array' ].<JSRecord>

    • ⇒

    • ⇒ Array.<JSRecord> | Array.<(String|Date|Number)>

    • ⇒ Array.<JSRecord> | Array.<(String|Date|Number)>


Adds a field to the lookup object

Param
Type

dataProvider

String

Example

var lookupObj = scopes.svyLookup.createLookup(datasources.db.example_data.products.getDataSource());

lookupObj.addField('productname').setTitleText('Product');
lookupObj.addField('products_to_suppliers.companyname').setTitleText('Supplier');
lookupObj.addField('unitprice')
	.setSearchable(false)
	.setTitleText('Price')
	.setFormat('#,###.00')

lookup.addParam(param)

Add a params to be added into the onSelect callback arguments

Param
Type

param

Object

Example

// create lookup object
var lookupObj = scopes.svyLookup.createLookup(datasources.db.example_data.products.getDataSource());
lookupObj.setLookupDataProvider("productname");

// custom param, define to which dataprovider the lookup result should be assigned
lookupObj.addParam({resultDataProvider: "productfk"});
lookupObj.showPopUp(onSelect, elements.productfk);

function onSelect(records, values, lookup) {
	if (values && values.length) {
		var resultDataProvider = lookup.getParams()[0].resultDataProvider;
		foundset[resultDataProvider] = values[0];
	}
}

lookup.addSelectedRecord(record)

Adds the given record to the list of selected records

Param
Type

record

JSRecord


lookup.clearParams()

Clear the params


lookup.clearSelectedRecords()

Clears the selection of this Lookup


lookup.createPopUp(callback, [initialValue]) ⇒ plugins.window.FormPopup

Creates and returns a Popup Form to be used to show the lookup

Param
Type
Description

callback

function

The function that will be called when a selection is made; the callback returns the following arguments: {Array} record, {Array<String

[initialValue]

String

And initial value to show in the search


lookup.createWindow([x], [y], [width], [height], [jsWindowType]) ⇒ JSWindow

Returns: JSWindow - returns a JSWindow which can be used to show the lookup in it using lookup.showWindow(window)

Param
Type
Description

[x]

Number

[y]

Number

[width]

Number

The width of the pop-up. Optional. Default is component width

[height]

Number

The height of the pop-up. Optional. Default is form height.

[jsWindowType]

Number

Type of window; should be an option of JSWindow, Default JSWindow.MODAL_DIALOG


lookup.getDataSource() ⇒ String

Gets the data source for this Lookup object


Gets the field at the specified index

Param
Type

index

Number


lookup.getFieldCount() ⇒ Number

Gets the number of fields in the lookup object


lookup.getFoundSet() ⇒ JSFoundSet

Gets the foundset for this Lookup object.


lookup.getLookupDataProvider() ⇒ String

Gets the lookup dataprovider


lookup.getLookupForm() ⇒ [ 'RuntimeForm' ].<AbstractLookup>

Returns the Lookup form instance used


lookup.getParams() ⇒ Array

Example

// create lookup object
var lookupObj = scopes.svyLookup.createLookup(datasources.db.example_data.products.getDataSource());
lookupObj.setLookupDataProvider("productname");

// custom param, define to which dataprovider the lookup result should be assigned
lookupObj.addParam({resultDataProvider: "productfk"});
lookupObj.showPopUp(onSelect, elements.productfk);

function onSelect(records, values, lookup) {
	if (values && values.length) {
		var resultDataProvider = lookup.getParams()[0].resultDataProvider;
		foundset[resultDataProvider] = values[0];
	}
}

lookup.getSelectedRecords() ⇒ [ 'Array' ].<JSRecord>

Returns the selected records for the lookup object Can be used to know which records have been previously selected by the user for this lookup


lookup.getSelectedValues() ⇒ [ 'Array' ].<JSRecord>

Returns the selected values based on the lookupDataProvider based on the lookupFormProvider. Can be used to know which values have been previously selected by the user for this lookup.

throws an exception if the lookupDataProvider has not been set


lookup.removeField(index)

Removes a field at the specified index

Param
Type

index

Number


lookup.removeParam(index)

Removes a param at the specified index

Param
Type

index

Number


lookup.removeSelectedRecord(record)

Removes the given record from the list of selected records

Param
Type

record

JSRecord


lookup.setLookupDataProvider(dataProvider)

Sets the lookup dataprovider Has to be a dataprovider or a related dataprovider of the lookup dataSource Setting the lookup dataprovider will return the selected dataprovider values in the lookup callback

Param
Type

dataProvider

String

Example

var lookupObj = scopes.svyLookup.createLookup(datasources.db.example_data.products.getDataSource());
// set the lookup dataprovider to productid
lookupObj.setLookupDataProvider("productid");

// add fields
lookupObj.addField('productname').setTitleText('Product');
lookupObj.addField('products_to_suppliers.companyname').setTitleText('Supplier');
lookupObj.addField('unitprice')
	.setSearchable(false)
	.setTitleText('Price')
	.setFormat('#,###.00')
		
// show pop-up
lookupObj.showPopUp(onSelect, elements.setProduct, controller.getFormWidth()/2, 412);

//because i have set the lookupDataProvider as productid values contains the selected productid (if any selected)
function onSelect(record, values, lookup){
  if (values && values.length) {
	  foundset.productid = values[0];
  }
}

lookup.setLookupForm(lookupForm)

Sets the lookup form used as template for the lookup popup/dialog The lookup form must extend the abstract form AbstractLookup

Param
Type

lookupForm

[ 'RuntimeForm' ].<AbstractLookup>

Example

var lookupObj = scopes.svyLookup.createLookup(datasources.db.example_data.products.getDataSource());
// lookup template with NG Table
lookupObj.setLookupForm(forms.svyLookupNGTable);

var lookupObjMulti = scopes.svyLookup.createLookup(datasources.db.example_data.products.getDataSource());
lookupObjMulti.setMultiSelect(true);
// lookup template with NG Table
lookupObjMulti.setLookupForm(forms.svyLookupNGTableMulti);

Allows this Lookup to multi select records The lookup form used will be changed when the instance set does not match the multi select setting

Param
Type

multiSelect

Boolean


lookup.setSelectedPks(pks)

Sets the selected records of this Lookup from the given primary keys Can be used to restore the user's selection from a previous user's session

Param
Type

pks

[ 'Array' ].<*>


lookup.setSelectedRecords(records)

Sets the selected records of this Lookup Can be used to restore the user's selection from a previous user's session

Param
Type

records

[ 'Array' ].<JSRecord>


lookup.setSelectedValues(values)

Param
Type

values

[ 'Array' ].<*>


lookup.showModalWindow([callback], [x], [y], [width], [height], [initialValue]) ⇒ Array.<JSRecord> | Array.<(String|Date|Number)>

Shows the lookup in a modal Window

Returns: Array.<JSRecord> | Array.<(String|Date|Number)> - returns the selected records; if the lookupDataprovider has been set instead it returns the lookupDataprovider values on the selected records. Returns null if the window is closed without a selection or an empty selection

Param
Type
Description

[callback]

function

The function that will be called when a selection is made; the callback returns the following arguments: {Array} record, {Array<String

[x]

Number

[y]

Number

[width]

Number

The width of the lookup. Optional. Default is same as target component

[height]

Number

The height of the lookup. Optional. Default is implementation-specifc.

[initialValue]

String

And initial value to show in the search


lookup.showPopUp(callback, target, [width], [height], [initialValue])

Shows the lookup as a Popup Form

Param
Type
Description

callback

function

The function that will be called when a selection is made; the callback returns the following arguments: {Array} record, {Array<String

target

RuntimeComponent

The component to show relative to

[width]

Number

The width of the lookup. Optional. Default is same as target component

[height]

Number

The height of the lookup. Optional. Default is implementation-specifc.

[initialValue]

String

And initial value to show in the search


lookup.showWindow(win, [callback], [initialValue]) ⇒ Array.<JSRecord> | Array.<(String|Date|Number)>

Shows the lookup in a Window

Returns: Array.<JSRecord> | Array.<(String|Date|Number)> - returns the selected records; if the lookupDataprovider has been set instead it returns the lookupDataprovider values on the selected records. Returns null if the window is closed without a selection or an empty selection

Param
Type
Description

win

JSWindow

the JSWindow object to show

[callback]

function

The function that will be called when a selection is made; the callback returns the following arguments: {Array} record, {Array<String

[initialValue]

String

And initial value to show in the search


new Lookup(datasource)

Param
Type

datasource

String | JSFoundSet


Creates a lookup object which can be used to show a pop-up form

Param
Type
Description

dataSource

String | JSFoundSet | JSRecord

The data source to lookup

Example

function onActionAddProducts(event) {
	var lookupObj = scopes.svyLookup.createLookup(datasources.db.example_data.products.getDataSource());

 // allow multi-selection
	lookupObj.setMultiSelect(true);
	
	// add searchable fields 
	lookupObj.addField('productname').setTitleText('Product');
	lookupObj.addField('products_to_suppliers.companyname').setTitleText('Supplier');
	lookupObj.addField('unitprice')
		.setSearchable(false)
		.setTitleText('Price')
		.setFormat('#,###.00')
	
	// show pop-up
	lookupObj.showPopUp(onSelect, elements.btnNewProduct, controller.getFormWidth()/2, 412);
}

// lookup callback. Add products into current order 
function onSelect(records, values, lookup){
	if(records){
		records.forEach(function(rec){
			
			if(foundset.selectRecord(foundset.orderid,rec.productid)) {
				// increase quantity if product already in order
				foundset.quantity = foundset.quantity + 1;
			} else {
				// create a new order line for each product selected in lookup
				var newRec = foundset.getRecord(foundset.newRecord())
				newRec.discount = 0;
				newRec.quantity = 1;
				newRec.unitprice = rec.unitprice;
				newRec.productid = rec.productid;
			}
		})
	 }
}

Creates a read only, in-memory datasource from the given query and creates a Lookup for that

Param
Type
Description

qbSelect

QBSelect

the query

[dsName]

String

the name of the datasource in case it should be reused

[overrideData]

Boolean

when true, the datasource with the given name is filled again from the given query, when false, an existing datasource with the same datasource name would be reused; default is false

Example

  //distinct query for the value
  var qbSelect = datasources.db.example_data.order_details.createSelect();
  qbSelect.result.add(qbSelect.joins.order_details_to_products.columns.productname, "productname");
  qbSelect.result.add(qbSelect.columns.productid, "productid");
  qbSelect.result.distinct = true;
  qbSelect.sort.add(qbSelect.joins.order_details_to_products.columns.productname);

  //create lookup and set form provider
  var lookupObj = scopes.svyLookup.createQueryLookup(qbSelect, 'ordered_products');
  
  //set proper header title for field
  var lookupField = lookupObj .getField(0);
  lookupField.setTitleText("Product");
  
  // show the lookup
  lookupObj.showPopUp(onSelect, elements.productid);

  // handle selection
  function onSelect(records, values, lookup) {
	    var selectedLookupValues = records.length ? records[0].productid : null;
  }

Creates a lookup object from a valuelist which can be used to show a pop-up form or a modal window

NOTE: Valuelist cannot be based on a database relation or a global method. Custom Valuelists can show up to 500 items in lookup.

Param
Type
Description

valuelistName

String

[titleText]

String | Array.<String>

Sets the display text for the valuelist field(s). Default is 'Value' or the column names; TODO should i allow to override the valuelist displayvalue, realvalue dataproviders. Could be handy because the lookup returns the record and the user has no clue about displayvalue/realvalue ?

Example

// create the lookup using the valuelist productsTable
var lookupObj = scopes.svyLookup.createValueListLookup("productsTable", "Product");

// show the lookup
lookupObj .showPopUp(onSelect, elements.productid);

// handle selection
function onSelect(records, values, lookup) {
	 var selectedLookupValues = values.length ? values[0] : null;
}

lookup.addField(dataProvider) ⇒

lookup.getField(index) ⇒

lookup.setMultiSelect(multiSelect) ⇒

createLookup(dataSource) ⇒

createQueryLookup(qbSelect, [dsName], [overrideData]) ⇒

createValueListLookup(valuelistName, [titleText]) ⇒

Lookup
createLookup(dataSource)
Lookup
createQueryLookup(qbSelect, [dsName], [overrideData])
Lookup
createValueListLookup(valuelistName, [titleText])
Lookup
Lookup
.addField(dataProvider)
LookupField
.addParam(param)
.addSelectedRecord(record)
.clearParams()
.clearSelectedRecords()
.createPopUp(callback, [initialValue])
.createWindow([x], [y], [width], [height], [jsWindowType])
.getDataSource()
.getField(index)
LookupField
.getFieldCount()
.getFoundSet()
.getLookupDataProvider()
.getLookupForm()
.getParams()
.getSelectedRecords()
.getSelectedValues()
.removeField(index)
.removeParam(index)
.removeSelectedRecord(record)
.setLookupDataProvider(dataProvider)
.setLookupForm(lookupForm)
.setMultiSelect(multiSelect)
Lookup
.setSelectedPks(pks)
.setSelectedRecords(records)
.setSelectedValues(values)
.showModalWindow([callback], [x], [y], [width], [height], [initialValue])
.showPopUp(callback, target, [width], [height], [initialValue])
.showWindow(win, [callback], [initialValue])
new Lookup(datasource)
LookupField
LookupField
Lookup
Lookup
Lookup
Lookup