// Use WebForm.nui // cWebForm class Use WebAppXhtmlBuilder.nui // Global procedures for writing XHTML Use Files.nui // Utilities for handling file related stuff (No User Interface) Use FieldInf // Global field info objects and abstract field types Use Strings.nui // String manipulation for VDF and 3.2 (No User Interface) Use WebQueryString.nui // Functions for constructing valid links Use WebLayout.nui // Different layout objects Use DDCreate.nui // Create generic DDO structures (using global FDX object) Use WebLayout.nui // Different layout object classes Use ExtendedItemProp.nui // cExtendedItemPropertyArray class Use FdxField.nui // FDX Field things Use WebGlobalFunctions.nui // WafGetHtmlFormValue and WafGetQueryString functions Use WebSelectionList.nui // RecordList Use css.nui // CSS things Use RGB.nui // Some basic RGB color functions Use HtmlEncode.pkg // DAW functions HtmlEncodeNoCrLf and HtmlEncode Use ButtonsLD.nui // oButtonsLD language dictionary object Use DDOCallBack.nui // Procedure DDO_Callback (that calls back for DDO's in a DDO structure) object oWebFormSubmitErrors is a cArray // This array is used to store error messages occurring during a submit. property integer phSubmittingForm public 0 // Which form generated the errors? property string psServiceMessage public "" // Message to be displayed in message area if no errors occurred item_property_list item_property integer piError.i item_property string psText.i item_property integer piLine.i item_property integer piFile.i item_property integer piField.i item_property integer pbHandled.i end_item_property_list procedure add_error integer liError string lsText integer liLine integer liFile integer liField integer liRow get row_count to liRow set piError.i liRow to liError set psText.i liRow to lsText set piLine.i liRow to liLine set piFile.i liRow to liFile set piField.i liRow to liField end_procedure function full_error_message integer liRow returns string integer liFile liField liPos string lsValue lsFieldName lsTable lsText // move "#T# (#E#, ##L#)" to lsValue move "#T#" to lsValue get psText.i liRow to lsText move (pos("\n",lsText)) to liPos if liPos move (left(lsText,liPos-1)) to lsText move (replace("#T#",lsValue,lsText)) to lsValue move (replace("#E#",lsValue,piError.i(self,liRow))) to lsValue move (replace("#L#",lsValue,piLine.i(self,liRow))) to lsValue // get piFile.i liRow to liFile // get piField.i liRow to liField // if liFile begin // if liField begin // get FDX_FieldName 0 liFile liField true to lsFieldName // move (lsValue+" field: "+lsFieldName) to lsValue // end // else begin // get FDX_AttrValue_FILELIST 0 DF_FILE_LOGICAL_NAME liFile to lsTable // move (lsValue+" table: "+lsTable) to lsValue // end // end function_return lsValue end_function procedure DoClear send delete_data set phSubmittingForm to 0 set psServiceMessage to "" end_procedure procedure DoGetErrors integer lhForm // From global error handling object (VDFxx\pkg\WebAppError.pkg) #IFDEF Is$WebApp integer liMax liItem send delete_data set phSubmittingForm to lhForm get ErrorCount of ghInetSession to liMax decrement liMax for liItem from 0 to liMax send ErrorReportCallBack of ghInetSession liItem MSG_Add_Error self loop send ClearErrors of ghInetSession #ENDIF end_procedure function file_field_errortext integer lhForm integer liFile integer liField returns string integer liRow liMax string lsValue move "" to lsValue if (lhForm=phSubmittingForm(self)) begin // If it's the same form get row_count to liMax if liMax begin decrement liMax for liRow from 0 to liMax if (piFile.i(self,liRow)=liFile and piField.i(self,liRow)=liField and pbHandled.i(self,liRow)=0) begin if (lsValue<>"") move (lsValue+"
") to lsValue move (lsValue+full_error_message(self,liRow)) to lsValue set pbHandled.i liRow to TRUE end loop end end function_return lsValue end_function function message_area_value integer lhForm returns string integer liRow liMax string lsValue move "" to lsValue if (lhForm=phSubmittingForm(self)) begin // If it's the same form get row_count to liMax get psServiceMessage to lsValue set psServiceMessage to "" if liMax begin decrement liMax for liRow from 0 to liMax if (piField.i(self,liRow)=0 and pbHandled.i(self,liRow)=0) begin if (lsValue<>"") move (lsValue+"
") to lsValue move (lsValue+full_error_message(self,liRow)) to lsValue set pbHandled.i liRow to TRUE end loop end end function_return lsValue end_function end_object // oWebFormSubmitErrors class WebFormCss is a cCssInlineStyles end_class // WebFormCss enumeration_list // CSS in-line styles used on WebForm elements define CSS_FORM_FORM //> Applied to the form element itself define CSS_FORM_FORM_ENCAP //> Applied to encapsulating element (if piEncapElement is set) define CSS_FORM_FORMTABLE //> Applied to the table that lays out the (the main layout object of the form) define CSS_FORM_FORMTITLE //> Applied to the cell that encapsulates the title cell of main layout object define CSS_FORM_DIRECTIONS //> Applied to the cell that encapsulates the user directions cell of main layout object define CSS_FORM_FIELDSET //> Applied to the field set elements (unless pbSuppressFieldsetElement is set to TRUE) define CSS_FORM_MESSAGEAREA // {text-align:left;background-color:#f8f8f8;width:100%;visibility:visible;color:red;padding-left:20px;margin-top:5px} define CSS_FORM_FIELDSETLEGEND // define CSS_FORM_FIELDSETDATACOLUMN // {} define CSS_FORM_TEXTAREA // {} define CSS_FORM_BUTTON // {} //// define CSS_FORM_INPUTLABEL // {} define CSS_FORM_INPUTWIDGET // {} define CSS_FORM_INPUTERROR // {} define CSS_FORM_INPUTINFO // {} define CSS_FORM_LABELCELL // {width:100px;vertical-align:text-top;text-align:right;padding-right:5px;padding-top:5px} define CSS_FORM_INPUTCELL // {padding-top:3px} define CSS_FORM_EXTRAINFOCELL define CSS_FORM_ERRORTEXTCELL define CSS_FORM_BAR_CONTAINER define CSS_FORM_GRID // property string psTableStyle public "border: solid gray 1px; border-top: none" define CSS_FORM_GRID_HEADER // property string psTableHeaderStyle public "color:darkblue; background-color:silver; font-family:arial; font-size:13px; padding-left:3px; padding-right:3px" define CSS_FORM_GRID_DATA // property string psTableDataStyle public "font-family:arial; font-size:12px; padding-left:3px; padding-right:3px" define CSS_FORM_GRID_SUBMIT_LINK // property string psSubmitLinkStyle public "border: 0px inset;background-color: transparent;color: blue;text-decoration: underline;cursor: pointer;padding:0px;margin:0px;text-align:left;white-space:normal;" end_enumeration_list object oWebFormBaseCss is a WebFormCss set property_value CSS_FORM_FORM CSSPS_MARGIN to "5px 5px 5px 5px" set property_value CSS_FORM_FORM CSSPS_PADDING to "5px 5px 5px 5px" // set property_value CSS_FORM_FORM CSSPS_BACKGROUND_COLOR to "#e8e8ff" set property_value CSS_FORM_FORM CSSPS_BORDER_STYLE to "none" set property_value CSS_FORM_FORM CSSPS_BORDER_WIDTH to "0px" set property_value CSS_FORM_FORM CSSPS_BORDER_COLOR to "#00000" set property_value CSS_FORM_FORMTABLE CSSPS_DIMEN_WIDTH to "100%" set property_value CSS_FORM_FORMTABLE CSSPS_FONT_SIZE to "small" set property_value CSS_FORM_FORMTITLE CSSPS_PADDING to "2px 2px 2px 2px" set property_value CSS_FORM_FORMTITLE CSSPS_BACKGROUND_COLOR to "#ffffd8" set property_value CSS_FORM_DIRECTIONS CSSPS_TEXT_ALIGN to "center" set property_value CSS_FORM_FIELDSET CSSPS_MARGIN to "5px 5px 5px 5px" set property_value CSS_FORM_FIELDSET CSSPS_PADDING to "5px 5px 5px 5px" set property_value CSS_FORM_FIELDSET CSSPS_BACKGROUND_COLOR to "#f8f8ff" set property_value CSS_FORM_FIELDSET CSSPS_DIMEN_HEIGHT to "100%" set property_value CSS_FORM_FIELDSETLEGEND CSSPS_TEXT_COLOR to "black" set property_value CSS_FORM_MESSAGEAREA CSSPS_TEXT_ALIGN to "left" set property_value CSS_FORM_MESSAGEAREA CSSPS_BACKGROUND_COLOR to "#f8f8f8" set property_value CSS_FORM_MESSAGEAREA CSSPS_DIMEN_WIDTH to "100%" set property_value CSS_FORM_MESSAGEAREA CSSPS_CLASSI_VISIBILITY to "visible" set property_value CSS_FORM_MESSAGEAREA CSSPS_TEXT_COLOR to "red" set property_value CSS_FORM_MESSAGEAREA CSSPS_PADDING_LEFT to "5px" set property_value CSS_FORM_MESSAGEAREA CSSPS_MARGIN_TOP to "5px" set property_value CSS_FORM_LABELCELL CSSPS_DIMEN_WIDTH to "100px" set property_value CSS_FORM_LABELCELL CSSPS_POS_VERTICAL_ALIGN to "text-top" set property_value CSS_FORM_LABELCELL CSSPS_TEXT_ALIGN to "right" set property_value CSS_FORM_LABELCELL CSSPS_PADDING_RIGHT to "5px" set property_value CSS_FORM_LABELCELL CSSPS_PADDING_TOP to "5px" set property_value CSS_FORM_INPUTCELL CSSPS_PADDING_TOP to "3px" set property_value CSS_FORM_INPUTCELL CSSPS_TEXT_ALIGN to "left" set property_value CSS_FORM_ERRORTEXTCELL CSSPS_TEXT_COLOR to "red" set property_value CSS_FORM_BAR_CONTAINER CSSPS_DIMEN_WIDTH to "100%" set property_value CSS_FORM_BAR_CONTAINER CSSPS_BACKGROUND_COLOR to "#999999" set property_value CSS_FORM_BAR_CONTAINER CSSPS_PADDING to "0px 0px 0px 0px" set property_value CSS_FORM_BAR_CONTAINER CSSPS_MARGIN to "0px 0px 0px 0px" // set property_value CSS_FORM_BAR_CONTAINER end_object // oWebFormCss // // --- WebInput class --------------------------------------------------------------- // // enumeration_list // Web form component types // define WFCT_FIELDSET // define WFCT_BUTTONBAR // define WFCT_FREESTYLE_FIELDSET // end_enumeration_list //> This is an enumeration of the types of widgets that may be places in a form enumeration_list // Input types define WFIT_AUTO // Define based on DD info define WFIT_SIMPLE // One line text box define WFIT_TEXTAREA // Text area box define WFIT_RADIO // Radio buttons define WFIT_CHECKBOX // Check box define WFIT_DROPDOWN // Drop down select box define WFIT_TEXTONLY // Just some text, not an input define WFIT_BUTTON // A submit button define WFIT_BUTTON_ARRAY // An array of buttons define WFIT_GRID // A of some kind // Not implemented yet: define WFIT_HIDDEN // A hidden field define WFIT_MULTISELECT // Multi selection list define WFIT_PASSWORD // For entering a password define WFIT_FILESELECT // For entering a filename from the clients file system end_enumeration_list // //> The oWebForm_WFIT_Data object lists all the widget types with their // //> names and associated XML tag names. // object oWebForm_WFIT_Data is a cArray // WebForm Input Type // item_property_list // oWebForm_WFIT_Data (WebForm Input Type) // item_property string psDisplayName.i // item_property string psXmlTag.i // end_item_property_list // procedure add_wfit integer liRow string lsDisplayName string lsXmlTag // get row_count to liRow // set psDisplayName.i liRow to lsDisplayName // set psXmlTag.i liRow to lsXmlTag // end_procedure // send add_wfit WFIT_AUTO "Auto" "auto" // send add_wfit WFIT_SIMPLE "Simple" "simple" // send add_wfit WFIT_TEXTAREA "Text area" "textarea" // send add_wfit WFIT_TEXTONLY "Text only" "textonly" // send add_wfit WFIT_RADIO "Radio" "radio" // send add_wfit WFIT_CHECKBOX "Checkbox" "checkbox" // send add_wfit WFIT_DROPDOWN "Dropdown" "dropdown" // send add_wfit WFIT_HIDDEN "Hidden" "hidden" // send add_wfit WFIT_MULTISELECT "Multi Select" "multiselect" // send add_wfit WFIT_PASSWORD "Password" "password" // send add_wfit WFIT_FILESELECT "File Select" "fileselect" // send add_wfit WFIT_BUTTON "Submit button" "submitbutton" // procedure callback_inputtypes integer lhMsg integer lhObj // integer liMax liRow // get row_count to liMax // decrement liMax // for liRow from 0 to liMax // // procedure HandleInputType integer liType string lsDisplayName string lsXmlTag // send lhMsg of lhObj liRow (psDisplayName.i(self,liRow)) (psXmlTag.i(self,liRow)) // loop // end_procedure // // send add_wfit WFIT_NEVERENTER "No input" "noinput" // end_object class WebInputValueOptions is a cArray procedure construct_object forward send construct_object property integer pbStatic public TRUE // Do not reload on every request property integer piType public 0 // 0=ValidationTable, 1=From parent file //> This is used when piType is 0 property integer phValTbl public 0 //> These are used when piType is 1 property integer piParentFile public 0 property integer piParentIndex public 0 property integer piParentField public 0 end_procedure item_property_list // WebInputValueOptions item_property string psCode.i item_property string psLabel.i end_item_property_list WebInputValueOptions procedure WriteXml integer lhNode liRow liMax lhBuilder move oItemPropertyArrayXmlBuilder to lhBuilder send add_closed_element of lhBuilder "static" (pbStatic(self)) if (piType(self)=0) begin // ValidationTable send add_closed_element of lhBuilder "type" 0 send add_open_element of lhBuilder "valuelist" get row_count to liMax decrement liMax for liRow from 0 to liMax send add_open_element of lhBuilder "value" send add_closed_element of lhBuilder "code" (psCode.i(self,liRow)) send add_closed_element of lhBuilder "label" (psLabel.i(self,liRow)) send close_element of lhBuilder // value loop send close_element of lhBuilder // valuelist end if (piType(self)=1) begin // Fill from parent file send add_closed_element of lhBuilder "type" 1 send add_closed_element of lhBuilder "parentfile" (piParentFile(self)) send add_closed_element of lhBuilder "parentindex" (piParentIndex(self)) send add_closed_element of lhBuilder "parentfield" (piParentField(self)) end end_procedure procedure ReadXml integer lhNode integer lhChildNode lhList liMax liLen lhCollectionNode liXmlRecord liRow lhGrandChildNode integer liValue liType string lsValue get ChildNodeValue of lhNode "static" to liValue set pbStatic to liValue get ChildNodeValue of lhNode "type" to liType set piType to liType if (liType=0) begin // ValidationTable get FindNode of lhNode "valuelist" to lhChildNode get FindNodeList of lhChildNode "value" To lhList get NodeListLength of lhList to liMax decrement liMax get row_count to liRow // Next available row in the array for liXmlRecord from 0 to liMax get CollectionNode of lhList liXmlRecord to lhCollectionNode get ChildNodeValue of lhNode "code" to lsValue set psCode.i liRow to lsValue get ChildNodeValue of lhNode "label" to lsValue set psLabel.i liRow to lsValue send destroy of lhCollectionNode increment liRow loop send destroy of lhList send destroy of lhChildNode end if (liType=1) begin // Fill from parent file get ChildNodeValue of lhNode "parentfile" to liValue set piParentFile to liValue get ChildNodeValue of lhNode "parentindex" to liValue set piParentIndex to liValue get ChildNodeValue of lhNode "parentfield" to liValue set piParentField to liValue end end_procedure procedure DoWriteHtmlOptions integer liType string lsName string lsCodeSelected integer lbRadioVertical string lsRadioCssClass integer lbReadOnly string lsToolTip integer liRow liMax string lsLabel send fill_list get row_count to liMax decrement liMax if (liType=WFIT_RADIO) begin for liRow from 0 to liMax if lbRadioVertical send XHTML_Add_Open_Element "div" else send XHTML_Add_Open_Element "span" send XHTML_Add_Attribute "class" lsRadioCssClass send XHTML_Add_Closed_Element "input" "" send XHTML_Add_Attribute "type" "radio" send XHTML_Add_Attribute "name" lsName send XHTML_Add_Attribute "value" (psCode.i(self,liRow)) if (psCode.i(self,liRow)=lsCodeSelected) send XHTML_Add_Attribute "checked" "checked" if lbReadOnly send XHTML_Add_Attribute "readonly" "readonly" if (lsToolTip<>"") send XHTML_Add_Attribute "title" lsToolTip get psLabel.i liRow to lsLabel get translate_value lsLabel to lsLabel if gbLngUpdate set psLabel.i liRow to gsLngValue // Update language symbol to optimized value send XHTML_Add_Closed_Element "span" lsLabel (psLabel.i(self,liRow)) send XHTML_Close_Element // div or span loop end if (liType=WFIT_DROPDOWN) begin for liRow from 0 to liMax get psLabel.i liRow to lsLabel get translate_value lsLabel to lsLabel if gbLngUpdate set psLabel.i liRow to gsLngValue // Update language symbol to optimized value send XHTML_Add_Closed_Element "option" lsLabel send XHTML_Add_Attribute "value" (psCode.i(self,liRow)) if (psCode.i(self,liRow)=lsCodeSelected) send XHTML_Add_Attribute "selected" "selected" loop end end_procedure procedure add_option string lsCode string lsLabel integer liRow get row_count to liRow set psCode.i liRow to lsCode set psLabel.i liRow to lsLabel end_procedure procedure fill_from_table_setup integer liFile integer liIndex integer liLabelField integer lbStatic set piParentFile to liFile set piParentIndex to liIndex set piParentField to liLabelField set pbStatic to lbStatic set phValTbl to 0 end_procedure procedure fill_from_table integer liFile liIndex liLabelField lbStatic liRecnum string lsLabel get pbStatic to lbStatic if (row_count(self)=0 or lbStatic=0) begin send delete_data get piParentFile to liFile if liFile begin get piParentIndex to liIndex get piParentField to liLabelField clear liFile vfind liFile liIndex ge repeat [found] begin get_field_value liFile 0 to liRecnum get_field_value liFile liLabelField to lsLabel send add_option liRecnum (trim(lsLabel)) vfind liFile liIndex gt end until (not(found)) end end end_procedure procedure fill_from_validationtable_setup integer lhValTbl set phValTbl to lhValTbl set pbStatic to (static_state(lhValTbl)) // Inherit the static state from the Validation list end_procedure procedure fill_from_validationtable integer lhValTbl lbStatic integer liMax liRow string lsData lsDescr get pbStatic to lbStatic if (row_count(self)=0 or lbStatic=0) begin send delete_data get phValTbl to lhValTbl send fill_list of lhValTbl get Data_Item_Count of lhValTbl to liMax decrement liMax for liRow from 0 to liMax get Data_Value of lhValTbl liRow to lsData get Data_Description of lhValTbl liRow to lsDescr if (lsDescr="") move lsData to lsDescr send add_option lsData lsDescr loop end end_procedure procedure fill_list integer lhValTbl get phValTbl to lhValTbl if lhValTbl send fill_from_validationtable else send fill_from_table end_procedure end_class // WebInputValueOptions enumeration_list // Input properties define WFIP_INPUT_TYPE // Input type // These values are obtained automatically from a DD object define WFIP_LABEL // Label define WFIP_SIZE // Size (width in characters) define WFIP_COLS // Column (for textarea) define WFIP_ROWS // Rows (for textarea) define WFIP_MAXLENGTH // If a simple input, how many characters do we allow define WFIP_READONLY define WFIP_TRANSPARENT // Draw widget transparantly without border (only effective if readonly) define WFIP_CAPSLOCK define WFIP_DB_TRUE_VALUE define WFIP_GRID_HEIGHT // Height of wfGrid control (fx. "200px" or "100%") define WFIP_GRID_WIDTH // Width of wfGrid control (fx. "200px" or "100%") define WFIP_AUTOTAB // When maxlength is reached, focus is passed on to the next focus (http://developer.irt.org/script/354.htm) define WFIP_TABORDER // HTML Taborder define WFIP_NAME // HTML Name define WFIP_VALUE // Value define WFIP_CHANGED_STATE // Changed state define WFIP_DB_FILE // If DB connected, which table? define WFIP_DB_FIELD // If DB connected, which column? define WFIP_DB_FIELDNAME // If DB connected, name of field define WFIP_TOOLTIP // define WFIP_EXTRA_INFO // Some extra information about the field that will display according to piExtraInfoMode define WFIP_ERROR_TEXT // Some extra information about the field that will display according to piErrorTextMode define WFIP_SUBMIT_DETECT // This is the posted value that determines if we consider the button to be pressed (when WFIP_INPUT_TYPE is WFIT_BUTTON) define WFIP_LABEL_AUTO_LINK // Puts a link to the parent table RecordEdit page on parent tables // -------- Used in new webform only --------- define WFIP_LOCATION define WFIP_SPAN define WFIP_AUTO_SUBMIT // Used with WFIT_DROPDOWN this will automatically submit the form when the selection is changed. end_enumeration_list // desktop_section // object WFIP_Data is a cArray // WebForm Input Properties // item_property_list // WFIP_Data (WebForm Input Properties) // item_property string psDisplayName.i // item_property string pbXml.i // item_property string psXmlTag.i // end_item_property_list // procedure add_wfip integer liRow string lsDisplayName integer lbXml string lsXmlTag // get row_count to liRow // set psDisplayName.i liRow to lsDisplayName // set pbXml.i liRow to lbXml // Do we write this to the XML file? // set psXmlTag.i liRow to lsXmlTag // end_procedure // send add_wfip WFIP_INPUT_TYPE "Input type" 1 "inputtype" // send add_wfip WFIP_LABEL "Label" 1 "label" // send add_wfip WFIP_NAME "name" 1 "name" // send add_wfip WFIP_VALUE "Value" 0 "value" // send add_wfip WFIP_TABORDER "Tab order" 1 "taborder" // send add_wfip WFIP_SIZE "Size" 1 "size" // send add_wfip WFIP_COLS "Columns" 1 "cols" // send add_wfip WFIP_ROWS "Rows" 1 "rows" // send add_wfip WFIP_DB_FILE "DB Table" 1 "dbtable" // send add_wfip WFIP_DB_FIELD "DB Field" 1 "dbfield" // send add_wfip WFIP_DB_FIELDNAME "DB Field name" 1 "dbfieldname" // send add_wfip WFIP_MAXLENGTH "Max length" 1 "maxlength" // // send add_wfip WFIP_TOOLTIP "Tooltip" 1 "tooltip" // Status help taken from the DD. Shown as balloon // send add_wfip WFIP_EXTRA_INFO "Extra info" 1 "extrainfo" // send add_wfip WFIP_ERROR_TEXT "Error text" 0 "errortext" // send add_wfip WFIP_AUTOTAB "Auto-tab" 1 "autotab" // send add_wfip WFIP_READONLY "Read only" 1 "readonly" // send add_wfip WFIP_TRANSPARENT "Transparent" 1 "transparent" // send add_wfip WFIP_CAPSLOCK "Caps lock" 1 "capslock" // Only for ASCII fields // send add_wfip WFIP_DB_TRUE_VALUE "Value for true" 1 "truevalue" // Only for checkboxes // // send add_wfip WFIP_LABEL_AUTO_LINK "Label auto link" 1 "labelautolink" // // procedure WriteXml integer lhInput // WFIP_Data object (WebInput) // integer liMax liItm lhBuilder // string lsValue // move oItemPropertyArrayXmlBuilder to lhBuilder // get item_count of lhInput to liMax // decrement liMax // for liItm from 0 to liMax // if (pbXml.i(self,liItm)) begin // get value of lhInput item liItm to lsValue // if (lsValue<>"") send add_closed_element of lhBuilder (psXmlTag.i(self,liItm)) lsValue // end // loop // end_procedure // procedure ReadXml integer lhInput integer lhNode // WFIP_Data object (WebInput) // integer liRow liMax // string lsValue // get row_count to liMax // decrement liMax // for liRow from 0 to liMax // if (pbXml.i(self,liRow)) begin // get ChildNodeValue of lhNode (psXmlTag.i(self,liRow)) to lsValue // if (lsValue<>"") set value of lhInput item liRow to lsValue // end // loop // end_procedure // end_object // WFIP_Data // end_desktop_section // enumeration_list // Web Input Object Types // define WIOT_INPUT // define WIOT_BUTTON // define WIOT_SELLIST // define WIOT_FREESTYLE // end_enumeration_list // //class BasicWebInput is a cArray // procedure construct_object // forward send construct_object // property integer piAutoLocation public 0 // 0:Normal, 1:Right, 2:RightSpace // property integer piInputObjectType public -1 // -1:Undefined // end_procedure // procedure DoEntryUpdate // BasicWebInput // end_procedure // procedure DoEntryDisplay // BasicWebInput // end_procedure // procedure end_construct_object // BasicWebInput // forward send end_construct_object // send register_input_object (piInputObjectType(self)) self // end_procedure //end_class // // //// An object of the WebInput class is instantiated for each widget on the screen. //class WebInput is a BasicWebInput // procedure construct_object // forward send construct_object // property integer phOptions public 0 // set piInputObjectType to WIOT_INPUT // end_procedure // // procedure DoCreateOptionsObject // OK // integer lhValueSet liType // get value item WFIP_INPUT_TYPE to liType // if (liType=WFIT_DROPDOWN or liType=WFIT_RADIO) begin // get phOptions to lhValueSet // ifnot lhValueSet begin // object oValueSet is a WebInputValueOptions // Inside procedure DoAddInput // move self to lhValueSet // end_object // set phOptions to lhValueSet // end // end // end_procedure // // procedure end_construct_object // WebInput // send DoCreateOptionsObject // forward send end_construct_object // end_procedure // // procedure DoAddOption string lsCode string lsLabel // OK // send add_option of (phOptions(self)) lsCode lsLabel // end_procedure // // //> If this input represents a db field and its value has been changed by the user, this procedure // //> moves the value of the input to the local record buffer of the DD object or, if not DD // //> connected, to the global record buffer. // procedure DoEntryUpdate // OK class WebInput // integer lbChanged liFile liField lhServer // string lsValue // // get server to lhServer // // get value item WFIP_DB_FILE to liFile // get value item WFIP_CHANGED_STATE to lbChanged // if (liFile and lbChanged) begin // Only if DB connected // get value item WFIP_DB_FIELD to liField // get value item WFIP_VALUE to lsValue // // if lhServer begin // if liField set file_field_changed_value of lhServer liFile liField to lsValue // else begin // send find_by_recnum of lhServer liFile (integer(lsValue)) // end // end // else begin // if liField set_field_value liFile liField to lsValue // else begin // clear liFile // set_field_value liFile 0 to lsValue // vfind liFile 0 eq // end // end // end // end_procedure // procedure DoEntryDisplay // OK class WebInput // integer liFile liField lhServer lbChanged // string lsValue // // get server to lhServer // get value WFIP_DB_FILE to liFile // if liFile begin // get value WFIP_DB_FIELD to liField // if lhServer begin // get file_field_current_value of lhServer liFile liField to lsValue // get file_field_changed_state of lhServer liFile liField to lbChanged // end // else begin // get_field_value liFile liField to lsValue // move 0 to lbChanged // end // set value WFIP_VALUE to lsValue // set value WFIP_CHANGED_STATE to lbChanged // end // end_procedure // // procedure WriteXml // WebInput // integer lhValueSet lhBuilder // move oItemPropertyArrayXmlBuilder to lhBuilder // send WriteXml of WFIP_Data self // get phOptions to lhValueSet // if lhValueSet begin // send add_open_element of lhBuilder "valueset" // send WriteXml of lhValueSet // send close_element of lhBuilder // valueset // end // end_procedure // // procedure ReadXml integer lhNode // WebInput // integer lhChildNode lhValueSet // send ReadXml of WFIP_Data self lhNode // get FindNode of lhNode "valueset" to lhChildNode // if lhChildNode begin // object oValueSet is a WebInputValueOptions // Inside ReadXml of WebInput class // move self to lhValueSet // end_object // set phOptions to lhValueSet // send ReadXml of lhValueSet lhNode // end // end_procedure // // procedure DoSetFileField integer liFile integer liField // OK // set value item WFIP_DB_FILE to liFile // set value item WFIP_DB_FIELD to liField // end_procedure // // procedure DoSetFileFieldDD integer liFile integer liField integer liInputType // OK // integer lhServer // The main data dictionary of the form // integer lhDD // The data dictionary handling liFile // integer liLen // integer liDec // integer liType // integer lhValTbl // integer lhValueSet // integer lbReadonly // integer liOptions // integer lbCapslock // integer lhTheRealDD // integer liMaxSizeVertical // integer lhValTable // string lsLabel lsLength lsName lsControl lsFieldName lsTrueValue lsToolTip // // send DoSetFileField liFile liField // Set file and field properties // // get server to lhServer // get hDDfile.i liFile to lhDD // Get the DDO responsible for liFile // // get FieldInf_FieldType liFile liField to liType // get FieldInf_Field_Length_String liFile liField to lsLength // get FieldInf_FieldLabel_Long liFile liField to lsLabel // get FDX_FieldName 0 liFile liField true to lsFieldName // get ExtractInteger lsLength 1 to liLen // get ExtractInteger lsLength 2 to liDec // if liDec move (liLen+1+liDec) to liLen // get sFileFieldInputName.ii liFile liField to lsName // get piMaxSizeVertical to liMaxSizeVertical // // set value item WFIP_NAME to lsName // set value item WFIP_LABEL to lsLabel // // move "" to lsToolTip // move "" to lsTrueValue // if lhDD begin // if (liInputType=WFIT_AUTO) begin // // // field_class_name doesn't have a file_field_ equivalent. Therefore: // get Data_set of lhDD liFile to lhTheRealDD // if lhTheRealDD get field_class_name of lhTheRealDD liField to lsControl // else move "" to lsControl // // //if (lowercase(lsControl)="dbbitmap") move to liType // if (lowercase(lsControl)="dbcheckbox") move WFIT_CHECKBOX to liInputType // if (lowercase(lsControl)="dbcomboform") move WFIT_DROPDOWN to liInputType // if (lowercase(lsControl)="dbedit") move WFIT_TEXTAREA to liInputType // if (lowercase(lsControl)="dbform") move WFIT_SIMPLE to liInputType // // if (liInputType=WFIT_AUTO) begin // get Field_Table_Object of lhTheRealDD liField to lhValTable // if lhValTable move WFIT_DROPDOWN to liInputType // end // //if (lowercase(lsControl)="dbgrid") move to liType // //if (lowercase(lsControl)="dbspinform") move to liType // end // // // get File_Field_Options of lhServer liFile liField to liOptions // move (liOptions iAnd DD_NOENTER) to lbReadonly // move (liOptions iAnd DD_CAPSLOCK) to lbCapslock // if (liInputType=WFIT_CHECKBOX) get Field_CheckBox_Value of lhDD liField TRUE to lsTrueValue // // get File_Field_Status_Help of lhDD liFile liField to lsToolTip // end // else begin // move 0 to lbReadonly // move 0 to lbCapslock // end // // if (liInputType=WFIT_AUTO) begin // if (liType=DF_TEXT) move WFIT_TEXTAREA to liInputType // else move WFIT_SIMPLE to liInputType // end // // set value WFIP_INPUT_TYPE to liInputType // // if (liInputType=WFIT_SIMPLE) begin // set value WFIP_SIZE to (liLen min liMaxSizeVertical) // set value WFIP_MAXLENGTH to liLen // end // if (liInputType=WFIT_TEXTAREA) begin // set value WFIP_ROWS to 3 // set value WFIP_COLS to liMaxSizeVertical // end // if (liInputType=WFIT_RADIO) begin // end // if (liInputType=WFIT_CHECKBOX) begin // set value WFIP_DB_TRUE_VALUE to lsTrueValue // end // if (liInputType=WFIT_DROPDOWN) begin // end // if (liInputType=WFIT_PASSWORD) begin // set value WFIP_SIZE to (liLen min liMaxSizeVertical) // set value WFIP_MAXLENGTH to liLen // end // // if (liInputType=WFIT_RADIO or liInputType=WFIT_DROPDOWN) begin // if lhDD begin // get Field_Table_Object of lhDD liField to lhValTbl // if lhValTbl begin // send DoCreateOptionsObject // get phOptions to lhValueSet // send fill_from_validationtable_setup of lhValueSet lhValTbl // end // end // end // set value WFIP_DB_FILE to liFile // set value WFIP_DB_FIELD to liField // set value WFIP_DB_FIELDNAME to lsFieldName // set value WFIP_READONLY to lbReadonly // set value WFIP_CAPSLOCK to lbCapslock // set value WFIP_TOOLTIP to lsToolTip // end_procedure // DoSetFileFieldDD // // // Make as combo field, fill from parent table. // procedure DoParentTableCombo integer liFile integer liField integer liIndex integer lbStatic // OK // integer lhValueSet // // set value WFIP_INPUT_TYPE to WFIT_DROPDOWN // set value WFIP_DB_FIELD to 0 // set value WFIP_READONLY to 0 // // send DoCreateOptionsObject // get phOptions to lhValueSet // // send fill_from_table_setup of lhValueSet liFile liIndex liField lbStatic // end_procedure // // procedure DoReset // WebInput // integer lhValueSet // get phOptions to lhValueSet // if lhValueSet send destroy of lhValueSet // set phOptions to 0 // send delete_data // end_procedure // // procedure OnStyle_Widget // end_procedure // procedure DoStyle_Widget // integer lhStyler // get phCssStyler to lhStyler // if lhStyler send OnStyle_Widget // end_procedure // // procedure OnStyle_Label // end_procedure // procedure DoStyle_Label // integer lhStyler lbLabelErrorColor // string lsError // get phCssStyler to lhStyler // if lhStyler begin // send clear_all_properties of lhStyler CSS_FORM_INPUTLABEL // get value item WFIP_ERROR_TEXT to lsError // if (lsError<>"") begin // If there has been an error set the label color accordingly // get pbLabelErrorColor to lbLabelErrorColor // if (lbLabelErrorColor>=0) set property_value of lhStyler CSS_FORM_INPUTLABEL CSSPS_TEXT_COLOR to (RGB_ToHTML(lbLabelErrorColor)) // end // send OnStyle_Label // end // end_procedure // // procedure DoWriteHtml integer liWhat // WebInput, 0=Label, 1=control, 2=Extra info 3=Error text // integer liInputType lbChecked lbLabelErrorColor liTable liRecnum // integer lbReadOnly lbNoBorder // string lsValue lsLabel lsTrueValue lsErrorText lsToolTip lsLink // get value WFIP_INPUT_TYPE to liInputType // // get pbLabelErrorColor to lbLabelErrorColor // get value item WFIP_ERROR_TEXT to lsErrorText // // get value WFIP_READONLY to lbReadOnly // if lbReadOnly get value WFIP_TRANSPARENT to lbNoBorder // else move 0 to lbNoBorder // // if (liWhat=0) begin // Label // if (liInputType<>WFIT_CHECKBOX and liInputType<>WFIT_TEXTONLY) begin // get value WFIP_LABEL to lsLabel // if (lsLabel<>"") begin // move "" to lsLink // if (integer(value(self,WFIP_LABEL_AUTO_LINK))) begin // get value item WFIP_DB_FILE to liTable // if liTable begin // get_field_value liTable 0 to liRecnum // if liRecnum get QryString_RecordEditLink liTable liRecnum to lsLink // end // end // // if (lsLink="") begin // send XHTML_Add_Closed_Element "span" lsLabel // end // else begin // send XHTML_Add_Closed_Element "a" lsLabel // send XHTML_Add_Attribute "href" lsLink // end // send add_attribute_class "" "inputlabel" // X // send add_attribute_style CSS_FORM_INPUTLABEL // end // end // end // if (liWhat=1) begin // Control (alias widget) // get value WFIP_TOOLTIP to lsToolTip // if (liInputType=WFIT_PASSWORD) begin // send XHTML_Add_Closed_Element "input" "" // send add_attribute_class "" "input" // send XHTML_Add_Attribute "type" "password" // send XHTML_Add_Attribute "name" (value(self,WFIP_NAME)) // if (value(self,WFIP_SIZE)<>"") send XHTML_Add_Attribute "size" (value(self,WFIP_SIZE)) // send XHTML_Add_Attribute "value" (value(self,WFIP_VALUE)) // if (integer(value(self,WFIP_MAXLENGTH))) send XHTML_Add_Attribute "maxlength" (value(self,WFIP_MAXLENGTH)) // if lbReadOnly send XHTML_Add_Attribute "readonly" "readonly" // if lbNoBorder send XHTML_Add_Attribute "style" "background-color: transparent" // if (lsToolTip<>"") send XHTML_Add_Attribute "title" lsToolTip // end // if (liInputType=WFIT_SIMPLE) begin // send XHTML_Add_Closed_Element "input" "" // send add_attribute_class "" "input" // send XHTML_Add_Attribute "type" "text" // send XHTML_Add_Attribute "name" (value(self,WFIP_NAME)) // if (value(self,WFIP_SIZE)<>"") send XHTML_Add_Attribute "size" (value(self,WFIP_SIZE)) // send XHTML_Add_Attribute "value" (value(self,WFIP_VALUE)) // if (integer(value(self,WFIP_MAXLENGTH))) send XHTML_Add_Attribute "maxlength" (value(self,WFIP_MAXLENGTH)) // if lbReadOnly send XHTML_Add_Attribute "readonly" "readonly" // if lbNoBorder send XHTML_Add_Attribute "style" "background-color: transparent" // if (lsToolTip<>"") send XHTML_Add_Attribute "title" lsToolTip // end // if (liInputType=WFIT_TEXTAREA) begin // get value item WFIP_VALUE to lsValue // send XHTML_Add_Closed_Element "textarea" lsValue // send add_attribute_class "" "textarea" // send XHTML_Add_Attribute "name" (value(self,WFIP_NAME)) // send XHTML_Add_Attribute "cols" (value(self,WFIP_COLS)) // send XHTML_Add_Attribute "rows" (value(self,WFIP_ROWS)) // if lbReadOnly send XHTML_Add_Attribute "readonly" "readonly" // if lbNoBorder send XHTML_Add_Attribute "style" "background-color: transparent" // if (lsToolTip<>"") send XHTML_Add_Attribute "title" lsToolTip // end // if (liInputType=WFIT_TEXTONLY) begin // get value item WFIP_LABEL to lsValue // send XHTML_Add_Closed_Element "span" lsValue // send add_attribute_class "" "textonly" // end // if (liInputType=WFIT_RADIO) begin // send DoWriteHtmlOptions of (phOptions(self)) WFIT_RADIO (value(self,WFIP_NAME)) (value(self,WFIP_VALUE)) 1 "radiooption" (integer(value(self,WFIP_READONLY))) lsToolTip // end // if (liInputType=WFIT_CHECKBOX) begin // send XHTML_Add_Closed_Element "input" "" // send XHTML_Add_Attribute "type" "checkbox" // send XHTML_Add_Attribute "name" (value(self,WFIP_NAME)) // // get value of self item WFIP_DB_TRUE_VALUE to lsTrueValue // // if (lsTrueValue<>"") move (value(self,WFIP_VALUE)=lsTrueValue) to lbChecked // else move (integer(value(self,WFIP_VALUE))) to lbChecked // if lbChecked send XHTML_Add_Attribute "checked" "checked" // // if lbReadOnly send XHTML_Add_Attribute "disabled" "disabled" // if lbNoBorder send XHTML_Add_Attribute "style" "background-color: transparent" // // A checkbox allways outputs it label to the immediate right of the box // send XHTML_Add_Closed_Element "span" (value(self,WFIP_LABEL)) // send add_attribute_class "" "label" // X // send add_attribute_style CSS_FORM_INPUTLABEL // if (lsToolTip<>"") send XHTML_Add_Attribute "title" lsToolTip // end // if (liInputType=WFIT_DROPDOWN) begin // send XHTML_Add_Open_Element "select" // send add_attribute_class "" "select" // send XHTML_Add_Attribute "name" (value(self,WFIP_NAME)) // send XHTML_Add_Attribute "size" "1" // Setting this to anything over 1 (the default) is really defeating the purpose of having the options hidden away // if (lsToolTip<>"") send XHTML_Add_Attribute "title" lsToolTip // if lbReadOnly send XHTML_Add_Attribute "disabled" "disabled" // if lbNoBorder send XHTML_Add_Attribute "style" "background-color: transparent" // send DoWriteHtmlOptions of (phOptions(self)) WFIT_DROPDOWN "" (value(self,WFIP_VALUE)) 0 "" lsToolTip // send XHTML_Close_Element // end // end // if (liWhat=2) begin // Extra info // send XHTML_Add_Closed_Element "div" (value(self,WFIP_EXTRA_INFO)) // send add_attribute_class "" "extrainfo" // X // send add_attribute_style CSS_FORM_INPUTINFO // end // if (liWhat=3) begin // Error text // send XHTML_Add_Closed_Element "div" (value(self,WFIP_ERROR_TEXT)) // send add_attribute_class "" "errortext" // X // send add_attribute_style CSS_FORM_INPUTERROR // end // end_procedure //end_class // WebInput // //class WebFormButton is a BasicWebInput // procedure construct_object // forward send construct_object // property string psLabel public "Button" // property string psDetectionValue public "" // property string psClass public "" // property string psStyle public "" // set piInputObjectType to WIOT_BUTTON // end_procedure // // procedure OnStyle_Widget // // CSS_FORM_BUTTON // end_procedure // procedure DoStyle_Widget // integer lhStyler // get phCssStyler to lhStyler // if lhStyler send OnStyle_Widget // end_procedure // // procedure DoStyle_Label // end_procedure // // procedure DoWriteHtml integer liWhat // WebFormButton, 0=Label, 1=control, 2=Extra info 3=Error text // string lsStyle lsToolTip // if (liWhat=1) begin // 1=Control (alias widget) // send XHTML_Add_Closed_Element "input" "" // Add an input for detecting name of form // send XHTML_Add_Attribute "type" "submit" // send XHTML_Add_Attribute "name" (psDetectionValue(self)) // send XHTML_Add_Attribute "value" (HtmlEncodeNoCrLf(psLabel(self))) // if (integer(value(self,WFIP_READONLY))) send XHTML_Add_Attribute "disabled" "disabled" // send add_attribute_class (psClass(self)) "formbutton" // X // send add_attribute_style CSS_FORM_BUTTON //// get psStyle to lsStyle //// if (lsStyle<>"") send XHTML_Add_Attribute "style" lsStyle // get value WFIP_TOOLTIP to lsToolTip // if (lsToolTip<>"") send XHTML_Add_Attribute "title" lsToolTip // end // end_procedure // // procedure WriteXml // WebFormButton // integer lhBuilder // move oItemPropertyArrayXmlBuilder to lhBuilder // send add_closed_element of lhBuilder "label" (psLabel(self)) // send add_closed_element of lhBuilder "detectionvalue" (psDetectionValue(self)) // send add_closed_element of lhBuilder "class" (psClass(self)) // send add_closed_element of lhBuilder "style" (psStyle(self)) // end_procedure // // procedure ReadXml integer lhNode // WebFormButton // string lsClass lsStyle lsLabel // integer liValue // get ChildNodeValue of lhNode "label" to lsLabel // get ChildNodeValue of lhNode "detectionvalue" to liValue // get ChildNodeValue of lhNode "class" to lsClass // get ChildNodeValue of lhNode "style" to lsStyle // set psLabel to lsLabel // set psDetectionValue to liValue // set psClass to lsClass // set psStyle to lsStyle // end_procedure // // procedure OnClick // end_procedure //end_class // WebFormButton // //class WebFormSelList is a WebSelectionList // This is an input // procedure construct_object // forward send construct_object // property integer piAutoLocation public 0 // N/A, Doesn't matter // // property integer priv.NextScrollAction public 0 // 0=First, 1=Previous, 2=Next, 3=Last // end_procedure // // procedure OnPreviousNextButtons integer liFirstRecnum integer liLastRecnum // // In this class we use OnPreviousNextButtons to write hidden inputs containing // // the record ids for the for the first and the last records in the list. // string lsSellistId // get psSubmitIdPrefix to lsSellistId // // send DoWriteHiddenInput (lsSellistId+"FirstRecId") (string(liFirstRecnum)) // send DoWriteHiddenInput (lsSellistId+"LastRecId") (string(liLastRecnum)) // end_procedure // // procedure DoWriteHtmlScrollButtons // string lsSellistId // get psSubmitIdPrefix to lsSellistId // // send XHTML_Add_Closed_Element "input" "" // send XHTML_Add_Attribute "type" "submit" // send XHTML_Add_Attribute "name" (lsSellistId+"first") // send XHTML_Add_Attribute "value" (HtmlEncodeNoCrLf("<<")) // // send XHTML_Add_Closed_Element "input" "" // send XHTML_Add_Attribute "type" "submit" // send XHTML_Add_Attribute "name" (lsSellistId+"previous") // send XHTML_Add_Attribute "value" (HtmlEncodeNoCrLf("<")) // // send XHTML_Add_Closed_Element "input" "" // send XHTML_Add_Attribute "type" "submit" // send XHTML_Add_Attribute "name" (lsSellistId+"next") // send XHTML_Add_Attribute "value" (HtmlEncodeNoCrLf(">")) // // send XHTML_Add_Closed_Element "input" "" // send XHTML_Add_Attribute "type" "submit" // send XHTML_Add_Attribute "name" (lsSellistId+"last") // send XHTML_Add_Attribute "value" (HtmlEncodeNoCrLf(">>")) // end_procedure // // procedure DoWriteHtmlClearAndCancel // string lsSellistId // get psSubmitIdPrefix to lsSellistId // // send XHTML_Add_Closed_Element "input" "" // send XHTML_Add_Attribute "type" "submit" // send XHTML_Add_Attribute "name" (lsSellistId+"clear") // send XHTML_Add_Attribute "value" (HtmlEncodeNoCrLf("Clear")) // // send XHTML_Add_HorizontalSpace "20px" // // send XHTML_Add_Closed_Element "input" "" // send XHTML_Add_Attribute "type" "submit" // send XHTML_Add_Attribute "name" (lsSellistId+"cancel") // send XHTML_Add_Attribute "value" (HtmlEncodeNoCrLf("Cancel")) // end_procedure // // procedure DoWriteHtmlCreateButton // integer liTable // string lsLink // get piMainFile to liTable // get sCreateNewRecordLink liTable to lsLink // if (lsLink<>"") begin // send XHTML_Add_Open_Element "div" // send XHTML_Add_Attribute "style" "text-align:center;width:100%" // send XHTML_Add_Closed_Element "a" (translate_value("ls.btn.create")) // send XHTML_Add_Attribute "href" lsLink // send XHTML_Add_Attribute "style" "text-decoration:none" // send XHTML_Close_Element // div // end // end_procedure // // procedure OnStyle_Widget // end_procedure // procedure DoStyle_Widget // end_procedure // // procedure OnStyle_Label // integer lhStyler // get phCssStyler to lhStyler // if lhStyler send OnStyle_Widget // end_procedure // procedure DoStyle_Label // integer lhStyler // get phCssStyler to lhStyler // if lhStyler send OnStyle_Label // end_procedure // // procedure DoWriteHtml integer liWhat // WebFormSelList, 0=Label, 1=control, 2=Extra info 3=Error text // integer liScrollAction liFindDirection liRecnum // integer liFirstRecnum liLastRecnum lbPopup // string lsSellistId // get psSubmitIdPrefix to lsSellistId // // get WafGetHtmlFormValue (lsSellistId+"FirstRecId") to liFirstRecnum // get WafGetHtmlFormValue (lsSellistId+"LastRecId") to liLastRecnum // // if (liWhat=1) begin // 1=Control (alias widget) // get priv.NextScrollAction to liScrollAction // if (liScrollAction=0) begin // move liFirstRecnum to liRecnum // move 2 to liFindDirection // Find next // end // if (liScrollAction=1) begin // move liFirstRecnum to liRecnum // move 1 to liFindDirection // Find previous // end // if (liScrollAction=2) begin // move liLastRecnum to liRecnum // move 2 to liFindDirection // Find next // end // if (liScrollAction=3) begin // move 0 to liRecnum // move 3 to liFindDirection // Find last // end // if (liScrollAction=4) begin // move 0 to liRecnum // move 0 to liFindDirection // Find last // end // set priv.NextScrollAction to 0 // forward send DoWriteHtml liRecnum liFindDirection 0 // // get pbPopupState to lbPopup // // // ifnot lbPopup begin // send DoWriteHtmlCreateButton // end // // if (piRecordsPerPage(self)) begin // send DoWriteHtmlScrollButtons // if lbPopup begin // send XHTML_Add_HorizontalSpace "20px" // send DoWriteHtmlClearAndCancel // end // end // else begin // if lbPopup begin // send DoWriteHtmlClearAndCancel // end // end // end // end_procedure // // function DetectFormActionValue returns string // WebFormSelList // string lsSubmitIdPrefix lsValue // get psSubmitIdPrefix to lsSubmitIdPrefix // get WafGetHtmlFormValue (lsSubmitIdPrefix+"first") to lsValue // if (lsValue<>"") set priv.NextScrollAction to 4 // else begin // get WafGetHtmlFormValue (lsSubmitIdPrefix+"previous") to lsValue // if (lsValue<>"") set priv.NextScrollAction to 1 // else begin // get WafGetHtmlFormValue (lsSubmitIdPrefix+"next") to lsValue // if (lsValue<>"") set priv.NextScrollAction to 2 // else begin // get WafGetHtmlFormValue (lsSubmitIdPrefix+"last") to lsValue // if (lsValue<>"") set priv.NextScrollAction to 3 // else begin // get WafGetHtmlFormValue (lsSubmitIdPrefix+"clear") to lsValue // if (lsValue<>"") move (lsSubmitIdPrefix+"clear") to lsValue // else begin // get WafGetHtmlFormValue (lsSubmitIdPrefix+"cancel") to lsValue // if (lsValue<>"") move (lsSubmitIdPrefix+"cancel") to lsValue // else begin // get WafGetHtmlFormValue (lsSubmitIdPrefix+"selectedrowid") to lsValue // if (lsValue<>"") begin // move (lsSubmitIdPrefix+"listselect") to lsValue // end // end // end // end // end // end // end // function_return lsValue // end_function // // procedure OnClick string lsSubmitValue // WebFormSelList // end_procedure // procedure DoClick string lsSubmitValue // WebFormSelList // string lsSubmitIdPrefix lsSubmitValueInput // string lsRowId // get psSubmitIdPrefix to lsSubmitIdPrefix // if (lsSubmitValue=(lsSubmitIdPrefix+"listselect")) begin // A record was selected. // // Found out which and inform the relevant DD (or just activate the buffer) // move (lsSubmitIdPrefix+"selectedrowid") to lsSubmitValueInput // get WafGetHtmlFormValue lsSubmitValueInput to lsRowId // send DoFindByRecnum (piMainFile(self)) lsRowId // set psPopupFieldSet to "" // Pop off // end // if (lsSubmitValue=(lsSubmitIdPrefix+"clear")) begin // clear // send DoFindByRecnum (piMainFile(self)) 0 // set psPopupFieldSet to "" // Pop off // end // if (lsSubmitValue=(lsSubmitIdPrefix+"cancel")) begin // cancel // set psPopupFieldSet to "" // Pop off // end // send OnClick lsSubmitValue // end_procedure // // procedure WriteXml // WebFormSelList // end_procedure // procedure ReadXml integer lhNode // WebFormSelList // end_procedure // // procedure DoEntryUpdate // class WebFormSelList // end_procedure // procedure DoEntryDisplay // class WebFormSelList // end_procedure // // procedure end_construct_object // WebFormSelList // forward send end_construct_object // send register_input_object WIOT_SELLIST self // // end_procedure //end_class // WebFormSelList // //class WebFormFreeStyleElement is a BasicWebInput // procedure construct_object // forward send construct_object // property integer pbFullWidth public TRUE // set piInputObjectType to WIOT_FREESTYLE // end_procedure // procedure DoWriteHtml // WebFormFreeStyle // end_procedure //end_class // // --- WebFormButtonBar class ----------------------------------------------------------- // object WebFormButtonBarDefaultLayoutOuterSequence is a WebLayoutSequence // send add_open_element "table" // send add_open_element "tr" // send add_sub_sequence "drawouter" 0 // send close_element // /tr // send close_element // /table // end_object // object WebFormButtonBarDefaultLayoutInnerSequence is a WebLayoutSequence // send add_open_element "td" // send add_sub_sequence "drawinner" 0 // send close_element // /td // end_object // // //> The WebFormButtonBar class is used for generating a button bar inside // //> the cWebForm object. // class WebFormButtonBar is a cExtendedItemPropertyArray // procedure construct_object // forward send construct_object // // property string psComponentLabel public "" // Label to identify the object within the form // // property integer phOuterLayout public (WebFormButtonBarDefaultLayoutOuterSequence(self)) // property integer phInnerLayout public (WebFormButtonBarDefaultLayoutInnerSequence(self)) // // property integer piAutoLocation public 0 // 0=top 1=bottom // // property integer priv.Row // // send register_fieldset_object WFCT_BUTTONBAR self // Register with encapsulating WebForm // set column_xml_tag 0 to "class" // set column_xml_tag 1 to "style" // set column_xml_tag 2 to "name" // set column_xml_tag 3 to "value" // set psRowXmlTag to "button" // end_procedure // item_property_list // WebFormButtonBar // item_property string psName.i // --- If both are blank, a space will be added. If only value is // item_property string psValue.i // specified the text will be displayed (not as a button) // item_property string psClass.i // item_property string psStyle.i // end_item_property_list WebFormButtonBar // //> Send DoAddButton to add a button to the button bar. // procedure DoAddButton string lsName string lsValue // integer liRow // get row_count to liRow // set psName.i liRow to lsName // set psValue.i liRow to lsValue // end_procedure // // procedure DoAddFindButtons // send DoAddButton "findfirst" "<<" // send DoAddButton "findprev" "<" // send DoAddButton "find" "=" // send DoAddButton "findnext" ">" // send DoAddButton "findlast" ">>" // set piAutoLocation to 0 // Find buttons usually goes to the top of the form // set psComponentLabel to "findbuttons" // end_procedure // // procedure DoAddMainTableListButton // send DoAddButton "maintablelist" "List" // end_procedure // // procedure DoAddEditButtons // send DoAddButton "save" "ls.btn.save" // send DoAddButton "delete" "ls.btn.delete" // send DoAddButton "clear" "ls.btn.clear" // set piAutoLocation to 1 // Edit buttons usually goes to the bottom of the form // set psComponentLabel to "editbuttons" // end_procedure // // procedure DoReset // WebFormButtonBar // send delete_data // end_procedure // // procedure WriteXml // WebFormButtonBar // integer lhBuilder // move oItemPropertyArrayXmlBuilder to lhBuilder // send add_closed_element of lhBuilder "componentlabel" (psComponentLabel(self)) // send add_closed_element of lhBuilder "suggestedlocation" (piAutoLocation(self)) // send add_open_element of lhBuilder "buttonlist" // forward send WriteXml // send close_element of lhBuilder // buttonlist // end_procedure // // procedure ReadXml integer lhNode // WebFormButtonBar // integer lhChildNode // string lsValue // get ChildNodeValue of lhNode "componentlabel" to lsValue // set psComponentLabel to lsValue // get ChildNodeValue of lhNode "suggestedlocation" to lsValue // set piAutoLocation to lsValue // get FindNode of lhNode "buttonlist" to lhChildNode // forward send ReadXml lhChildNode // send destroy of lhChildNode // end_procedure // // procedure DetectFormAction // class WebFormButtonBar // integer liMax liRow // string lsValue // get row_count to liMax // decrement liMax // for liRow from 0 to liMax // get WafGetHtmlFormValue (psName.i(self,liRow)) to lsValue // if (lsValue<>"") send priv.OnButton (psName.i(self,liRow)) // loop // end_procedure // // procedure DoWriteButton // integer liRow liMax // string lsClass lsStyle lsName lsValue // get priv.Row to liRow // get psClass.i liRow to lsClass // get psStyle.i liRow to lsStyle // get psName.i liRow to lsName // get psValue.i liRow to lsValue // if (lsValue<>"") begin // get HtmlEncodeNoCrLf lsValue to lsValue // if (lsName<>"") begin // Button // send XHTML_Add_Closed_Element "input" "" // send XHTML_Add_Attribute "type" "submit" // // send add_attribute_class lsClass "button" // if (lsStyle<>"") send XHTML_Add_Attribute "style" lsStyle // send XHTML_Add_Attribute "name" lsName // send XHTML_Add_Attribute "value" lsValue // end // else send XHTML_Add_Closed_Element "span" lsValue // end // else send XHTML_Add_Closed_Element "span" "    " // end_procedure // // procedure DoWriteButtons // integer lhInnerLayout liMax liRow // get phInnerLayout to lhInnerLayout // get row_count to liMax // decrement liMax // for liRow from 0 to liMax // set priv.Row to liRow // send DoWriteHtml of lhInnerLayout MSG_DoWriteButton self // loop // end_procedure // // procedure DoWriteHtml // WebFormButtonBar // integer lhOuterLayout // get phOuterLayout to lhOuterLayout // send DoWriteHtml of lhOuterLayout MSG_DoWriteButtons self // end_procedure // end_class // WebFormButtonBar // // // --- WebFormFieldSet class ------------------------------------------------------------ // // class WebFormFreestyleFieldset is a cArray // To be instatiated inside a WebForm object // procedure construct_object // forward send construct_object // property string psComponentLabel public "" // Label to identify the fieldset within the form // property integer piAutoLocation public 0 // 0=Below 1=Right (of fieldset) // property integer piAutoLocationSpan public 0 // 0=No span,x=span x columns, -1=span to end of row // property string psLegend public "" // property integer pbBorder public true // property integer pbSuppressFieldsetElement public false // Supress fieldset element all together // property integer pbPopupState public 0 // // send register_fieldset_object WFCT_FREESTYLE_FIELDSET self // end_procedure // procedure DoSeedFindValues // WebFormFieldSet // end_procedure // procedure DoReadPostedFormValues // WebFormFieldSet // end_procedure // procedure DoEntryUpdate // WebFormFieldSet // end_procedure // procedure DoEntryDisplay // WebFormFieldSet // end_procedure // procedure DoWriteHtml // WebFormFieldset // end_procedure // end_class // WebFormFreestyleFieldset // // class WebFormFieldset is a cArray // To be instatiated inside a WebForm object // procedure construct_object // forward send construct_object // property string psComponentLabel public "" // Label to identify the fieldset within the form // property integer piAutoLocation public 0 // 0=Below 1=Right (of fieldset) // property integer piAutoLocationSpan public 0 // 0=No span,x=span x columns, -1=span to end of row // property string psLegend public "" // property integer pbBorder public true // property integer pbSuppressFieldsetElement public false // Supress fieldset element all together // property string psClass public "" // property integer phFieldsetLayout public 0 // // Setting pbPopupState to TRUE will make sure that this fieldset is only rendered when // // psPopupFieldSet of the WebForm is set to the value of psComponentLabel // property integer pbPopupState public 0 // // //> Although the maxlength attribute of the input will be set to // //> the number of characters that corresponds to DB field it represents, // //> you may set the maximum visible size that will be used. // //> // //> It is the same size that will be used for the default width of