AddCategoryBrowser Method (InputDlg)

Build 1501 on 14/Nov/2017  This topic last edited on: 22/Mar/2016, at 17:09

Description

Display the category field and returns the category if (if single selection), or a list of category ids (if multiselection).

Available since 2.2.

Syntax

dlg.AddCategoryBrowserdlg.AddCategoryBrowser(sLabel, idslist, categorySetName, sMultiSel, iListHeight)

dlg

Required. Object name, returned by Dim idlg As InputDlg = New InputDlg.

sLabel

Side label (to make sure the label will fit, set the appropriate dialog width (dlg.Width = value), and the label width.

idslist

list of ids to preselect. Pass only one if the list sMultiSel

categorySetName

name of the category set, e.g. contentPositions.

sMultiSel

True for the multiselection, False for the single selection

iListHeight

List height in pixels.

Example

  Public Overridable Sub EditAccess()

    Dim dlg As New TeraDP.GN4.WinUI.InputDlg()

    dlg.Title = "Select the Content Position"

    dlg.Width = 240

    dlg.SetLabelWidth(70)

    Dim idslist As New List(Of Integer)

    idslist.Add(cint(Page.SelElement.GetField("ContentPos")))

    Dim icpos As Integer = dlg.AddCategoryBrowser("Position:", idslist, "contentPositions", False, 80)

    If dlg.ShowDialog() Then

      Dim catId As Integer = CInt(dlg.GetItemValue(icpos))

      If catId > 0 Then

        Page.SelElement.SetField("ContentPos", CStr(catId))

      End If

    End If

  End Sub

See also

SetAccess