Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ class public ChileCompanyCustomerForm extends BBjWidget
methodend

method public void onFormSubmit(BBjCustomEvent ev!)
REM we will get data row object with submitted form values in ev!.getObject()
REM Need to handle db operation here
ClientUtil.consoleLog(str(ev!.getObject()))
methodend

Expand Down
13 changes: 12 additions & 1 deletion framework/FormControlPanel/FormControlPanel.bbj
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ class public FormControlPanel

method public void setResultSet(ResultSet rs!)
#RS! = rs!
#dataRow! = new DataRow(rs!)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what does that mean - build a DataRow object from a ResultSet? Create a DataRow from a ResultSet?
Take the first record? What if the ResultSet is null() or empty?
It's unclear to me what is the dataRow! variable versus the ResultSet!in this class, maybe a few comments would do goo.

methodend

method public DataRow getResultSet()
Expand Down Expand Up @@ -99,9 +100,12 @@ class public FormControlPanel

columnName! = columnNames!.get(i)
_fieldLabel! = new InputField(fieldWnd!)
_fieldLabel!.setId(columnName!)
_inputField! = _fieldLabel!.getInputField()
_fieldLabel!.setCallback(InputField.ON_INPUT_CHANGE, #this!, "onInputChange")

if #isEdit! = 1 THEN
_fieldLabel!.getInputField().setText(str(#dataRow!.getFieldValue(columnName!)))
_inputField!.setText(str(#dataRow!.getFieldValue(columnName!)))
else
_fieldLabel!.setPlaceHolder(columnName!)
fi
Expand Down Expand Up @@ -137,6 +141,13 @@ class public FormControlPanel
#overlay!.setCallback(Overlay.ON_OVERLAY_DISSMISSED, #this!,"onOverlayDissmiss")
methodend

method public void onInputChange(BBjCustomEvent ev!)
obj! = ev!.getObject()
fieldId! = obj!.getId()
fieldValue! = obj!.getInput()
#dataRow!.setFieldValue(fieldId!, fieldValue!)
methodend

method public void onFormSubmit(BBjButtonPushEvent ev!)
#overlay!.onOverlayDissmiss(null())
BBjAPI().postCustomEvent("ON_FORM_SUBMIT", #dataRow!)
Expand Down
2 changes: 1 addition & 1 deletion widgets/InputField/InputField.bbj
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ class public InputField extends BBjWidget implements Icon
endif
endif
endif
#fireEvent(#ON_INPUT_CHANGE, "")
#fireEvent(#ON_INPUT_CHANGE, #this!)
methodend

method public void focus()
Expand Down