global_autohandler

GenericSelect_FIELD Method

The drop-down lists in the MasonSQL framework are implemented with select, htmlselect or divselect widgets, their implementation files are in the /opt/masonsql/htdocs/input/ directory.
All three widgets are wrapped around with GenericSelect_FIELD method from /opt/masonsql/htdocs/data/global_autohandler file. Its best to use the method with the _FIELD and _FIND_FIELD methods.

Here are parameters for the GenericSelect_FIELD method:

Parameter Name DescriptionSorted descending Default Value
widget The type of widget is chosen with the widget parameter. Types of widgets are: 'select', 'htmlselect' or 'divselect'. 'select'
width The parameter determines the width of the select field. 80
empty_descr The empty option displays empty_descr value. Empty string.
readonly If readonly is enabled and user clicks on the select element the alert pops ups saying 'Il campo non è modificabile'. 1
empty First option is left empty and has value of empty. Empty string.
buffer A buffer name. The buffer parameter is specific to the default select method.
It tells the method it should save the content of the table in a buffer so it doesn't need to be reloaded every time it is requested.
The parameter is particularly useful with the TABLE form.
from
from A .mql file name (without extension). The parameter determines from which table is the contents of the drop-down list.  
remote   Undefined.

See also Adding Select Field, Adding HtmlSelect and Adding DivSelect Field examples.

Other _FIELD Methods

Method Name Description Example
id_persona_FIELD Calls GenericSelect_FIELD with:
from => 'sel_anagrafiche',
with other passed arguments and
find_select_list => ['=' => '=' attribute.
 
id_gruppi_FIELD Calls GenericSelect_FIELD with:
width => 220,
widget => 'htmlselect',
from => 'sel_gruppi',
with other passed arguments and
find_select_list => ['=' => '=']
select_from => 'sel_gruppi' attributes.
 
commento_FIELD Calls string widget with:
rows=>6,
cols=>60
and with other passed arguments.
<%method commento_FIELD><& /input/string.comp, %ARGS, rows=>2, cols=>80 &></%method>
Topic revision: r12 - 08 Sep 2023, GuidoBrugnara
This site is powered by FoswikiCopyright (©) Leader.IT - Italy P.I. IT01434390223 Privacy policy & use of cookies