ddsSyncWithForm
ddsSyncWithForm(g_form s_action s_libField[s_cellField[s_viewField[l_viewTypes] ] ] ) => t / nil
Description
Registers the given form and fields of that form for synchronization with the Library Browser. The Library Browser is seeded with the current values of the library, cell, and view names from the fields in the form if they are not blank. The field value is not updated by ddsSyncWithForm when its enabled or editable attribute is set to nil. From this point until ddsEndSyncWithForm, selections in the Library Browser seed the given form fields.
Applications must call ddsEndSyncWithForm (or dmbLibBrowserFormDone, which is retained for compatibility) when they are done with the browser, using Cancel or OK. Not doing so could result in unusual browser interactions for the user.
Arguments
Value Returned
|
No library is selected or if the Library Browser is not synchronized with any particular form. |
Examples
This example creates the synchronization between form and Library Browser, where form is created by exampleOpenForm() and the Library Browser is created by exampleBrowser().
exampleLibName = hiCreateStringField(
?name 'exampleLibName
?prompt "Library Name"
?value ""
?callback "ddsUpdateSyncWithForm( )"
)
exampleCellName = hiCreateStringField(
?name 'exampleCellName
?prompt "Cell Name"
?callback "ddsUpdateSyncWithForm( )"
)
exampleViewName = hiCreateStringField(
?name 'exampleViewName
?prompt "View Name"
?callback "ddsUpdateSyncWithForm( )"
)
exampleBrowser = hiCreateButtonBoxField(
?name 'exampleBrowser
?prompt " "
?choices '(" Browse ")
?callback list("exampleBrowser( )")
)
hiCreateForm(
'exampleOpenForm "Synched Form Example"
"exampleOpenForm( )"
list( exampleLibName
exampleCellName
exampleViewName
exampleBrowser )
""
)
procedure( exampleBrowser( )
ddsSyncWithForm( exampleOpenForm 'browse 'exampleLibName
'exampleCellName 'exampleViewName )
)
procedure( exampleOpenForm( )
ddsSyncWithForm( exampleOpenForm 'other 'exampleLibName
'exampleCellName 'exampleViewName )
hiDisplayForm( 'exampleOpenForm )
)
ddsEndSyncWithForm()
This example creates a browse button for selecting a library. The browse button is placed in a HI Tab field. The eval function has been used to seed the proper argument for ddsSyncWithForm.
libBrowseBtn = hiCreateFormButton(
?name 'libBrowseBtn
?buttonText "Browse..."
?callback "ddsSyncWithForm(eval(browseForm->tabs->page1) 'libname 'libname)"
)
; Create a browse button for selecting a file. This browse button is placed in a HI Tab field.
field1 = hiCreateStringField( ?name 'libname ?prompt "Library Name")
field2 = hiCreateStringField( ?name 'filename ?prompt "File Name")
fileBrowseBtn = hiCreateFormButton(
?name 'fileBrowseBtn
?buttonText "Browse..."
?callback "ddsFileBrowseCB(browseForm->tabs->page1 'filename)"
)
; Create a HI Tab field where the previous browse fields are placed within it.
tabs = hiCreateTabField(
?name 'tabs
?notebookStyle 'nil
?tabPlacement 'top
?tabs list("TEST")
?value 1
?fields list( list(
list(field1 0:0 200:0 100)
list(libBrowseBtn 210:0 80:30)
list(field2 0:40 200:0 100)
list(fileBrowseBtn 210:40 80:30))
)
)
form=hiCreateAppForm(
?name 'browseForm
?formTitle "Example Form"
?callback ""
?dontBlock t
?fields list(list(tabs 0:0 300:100))
)
hiInstantiateForm(form)
hiDisplayForm(form)
Return to top