I tried mine with tab key and all is fine here.
Maybe we can compare form setups?
Using latest bootstrap and servoy.
My parent form has a grouping table where:
event: onColumnFormEditStarted has this definition:
- Code: Select all
/**
* Called when the column's form editor is started.
*
* @param {number} [foundsetindex]
* @param {number} [columnindex]
* @param {object} [value]
*
* @private
*
* @properties={typeid:24,uuid:"34B3E135-5D6B-4A50-ADA6-20792B9F1E4C"}
*/
function onColumnFormEditStarted_categories(foundsetindex, columnindex, value) {
//use the column index to get the correct editor
/** @type {CustomType<aggrid-groupingtable.column>} */
var col = elements.groupingtable_categories.getColumn(columnindex);
/** @type {String} */
var col_id = col.id;
switch (col_id) {
case 'note_id':
custom_edit_note(value);
break;
default:
application.output('PITC_0F_admin_categories_ng.onColumnFormEditStarted_categories Unknown column id: ' + col_id + ' for index: ' + columnindex,LOGGINGLEVEL.DEBUG);
break;
}
return;
}
Which calls the function:
- Code: Select all
/**
Custom editor for the note.
@param {object} value
* @private
*
* @properties={typeid:24,uuid:"3E19331A-12E7-48E6-A9AC-03B493B53A63"}
*/
function custom_edit_note(value) {
var value_to_edit = '';//coerce to string
if(value == null || value == undefined){
value_to_edit = '';
} else if (value instanceof String){
value_to_edit = value;
if(value_to_edit.length == 0){
value_to_edit = '';
}
}
forms.custom_cell_editor.vf_text = value_to_edit;//TODO only works for note which is text - needs upgrade for any object?
// forms.custom_cell_editor.vf_text_box_a = null;//debug - ignore
// forms.custom_cell_editor.vf_text_box_b = null;//debug - ignore
return;
}
The custom_cell_editor form is a responsive layout:
The form has no events defined.
There is one label and one textarea. (Tested with text box as well). No events defined.
There are two buttons 'Cancel' and 'Save'. Both have onAction event defined:
onAction_save(event) and onAction_cancel(event).
Note that for the stopCellEditing call I do not have an argument - this was done about a year ago and I see now there is an update to the api.
- Code: Select all
function onAction_cancel(event) {
/*
* on a form's 'properties' you will see an option 'encapsulation'
* In that section you need to uncheck or set to false the 'Hide Elements', then they won't be private.
*/
forms.PITC_0F_admin_categories_ng.elements.groupingtable_categories.stopCellEditing();
return;
}
And the save is as follows.
I was messing about with the idea of multiple fields and hacked a json string - which works ok.
- Code: Select all
/**
* @param {JSEvent} event
*
* @private
*
* @properties={typeid:24,uuid:"9FAA7871-3916-44F4-8F93-0D4F6DEAA6E6"}
*/
function onAction_save(event) {
/*
* on a form's 'properties' you will see an option 'encapsulation'
* In that section you need to uncheck or set to false the 'Hide Elements', then they won't be private.
*/
//create json object
var json_obj = new Object();
json_obj.text_box_a = vf_text_box_a;
json_obj.text_box_b = vf_text_box_b;
json_obj.text = vf_text;
var json_str = JSON.stringify(json_obj);
application.output("json_str= " + json_str);
forms.PITC_0F_admin_categories_ng.elements.floatlabeltextbox_json.floatLabelText = json_str;
forms.PITC_0F_admin_categories_ng.elements.groupingtable_categories.setFormEditorValue(vf_text);//vf_text
forms.PITC_0F_admin_categories_ng.elements.groupingtable_categories.stopCellEditing();
return;
}