diff --git a/view/types/hk_form_entry.anubis b/view/types/hk_form_entry.anubis index ed98f85..2708763 100644 --- a/view/types/hk_form_entry.anubis +++ b/view/types/hk_form_entry.anubis @@ -25,8 +25,8 @@ public type HK_Form_Entry: //legacy VT_Edit information (String s_name, String c_name, String v_name, Int width, HK_Help_Text help), //s_name = show_name for translation, v_name = string to show text (String s_name, String c_name, String value, HK_Help_Text help), //s_name = show_name for translation, c_name = table column name password (String s_name, String c_name, HK_Help_Text help), //s_name = show_name for translation, c_name = table column name - foreign_text(String s_name, String c_name, DB_id selected, String f_table_name, HK_Form_Selector selector, HK_Help_Text help), - foreign_text_search(String s_name, String c_name, DB_id selected, String f_table_name, List(String) search_fields, HK_Help_Text help), + foreign_text(String s_name, String c_name, DB_id selected, String f_table_name, HK_Form_Selector selector, List(HK_Foreign_Key_Active_Filter) active_filters, HK_Help_Text help), + foreign_text_search(String s_name, String c_name, DB_id selected, String f_table_name, List(String) search_fields, List(HK_Foreign_Key_Active_Filter) active_filters, HK_Help_Text help), choices_text(String s_name, String c_name, String selected, HK_Form_Selector selector, HK_Help_Text help), text_area (String s_name, String c_name, String value, HK_Text_Field_Attr area_att, HK_Help_Text help), //s_name = show_name for translate, c_name = table column name boolean (String s_name, String c_name, Bool value, HK_Help_Text help), diff --git a/view/view_table_renderer.anubis b/view/view_table_renderer.anubis index edd6758..0d24cc4 100644 --- a/view/view_table_renderer.anubis +++ b/view/view_table_renderer.anubis @@ -678,7 +678,7 @@ public define List(CXM_Form_Field) password_entries ], - foreign_text(s_name, c_name, _value, foreign_table_name, select, help) then + foreign_text(s_name, c_name, _value, foreign_table_name, active_filter, select, help) then with uid = "_"+generate_random_string(20)+"_", with refresh_func = uid+foreign_table_name+"_"+c_name+"_selector_refresh", //Get the priority of the web argument content for the value, this means the value already set by the user or called with programmaticaly with it @@ -698,7 +698,7 @@ public define List(CXM_Form_Field) ], - foreign_text_search(s_name, c_name, _select, foreign_table_name, s_fields, help) then + foreign_text_search(s_name, c_name, _select, foreign_table_name, s_fields, active_filter, help) then with uid = "_"+generate_random_string(20)+"_", //Get the priority of the web argument content for the select, this means the value already set by the user or called with programmaticaly with it with select = get_DB_id(lwa, c_name, _select), @@ -869,7 +869,7 @@ public define List(CXM_Form_Field) edit_form_cell ( SQLite3DataBase db, - String fk_clause, + //String fk_clause, HK_Referer table_referer, List(Web_arg) lwa, //web arguments of the request (String) -> String _T, @@ -884,11 +884,11 @@ public define List(CXM_Form_Field) empty then [empty], hidden(name, value) then //print("hidden "+name+" = "+value); - [hidden(html_Id(""), wan(name), wav(value))], + [hidden(html_Id(name), wan(name), wav(value))], label(name) then [div([],text(_T(name)))], primary_key(idx) then - [hidden(html_Id(""), wan("id"), wav(idx))], + [hidden(html_Id("id"), wan("id"), wav(idx))], information(s_name, c_name, value, width, help) then [input_readonly(no_label, wan(c_name), init(not_null_String(value)), if width > 0 then custom(width) else narrow), help_line(help, _T)], text(s_name, c_name, value, help) then @@ -910,8 +910,9 @@ public define List(CXM_Form_Field) password_entries ], - foreign_text(s_name, c_name, _value, foreign_table_name, select, help) then + foreign_text(s_name, c_name, _value, foreign_table_name, active_filter, select, help) then //[selector_c([],no_label, html_Id(""), wan(c_name), 1, select.get(db, table_referer, fk_clause), success(init(to_String(value))), mandatory), help_line(help, _T)], + with fk_clause = "", with uid = "_"+generate_random_string(20)+"_", with refresh_func = uid+foreign_table_name+"_"+c_name+"_selector_refresh", with value = get_DB_id(lwa, c_name, _value), @@ -929,7 +930,7 @@ public define List(CXM_Form_Field) ]) ], - foreign_text_search(s_name, c_name, _select, foreign_table_name, s_fields, help) then + foreign_text_search(s_name, c_name, _select, foreign_table_name, s_fields, active_filer, help) then //[raw_in_form(literal(""))] with uid = "_"+generate_random_string(20)+"_", with select = get_DB_id(lwa, c_name, _select), @@ -951,31 +952,32 @@ public define List(CXM_Form_Field) ] choices_text(s_name, c_name, value, select, help) then - [selector_c([],no_label, html_Id(""), wan(c_name), 1, select.get(db, no_referer, ""), success(init(value)), mandatory), help_line(help, _T)], + [selector_c([],no_label, html_Id(c_name), wan(c_name), 1, select.get(db, no_referer, ""), success(init(value)), mandatory), help_line(help, _T)], text_area(s_name, c_name, value, txt_editor, help) then - with uid = "_"+generate_random_string(20), - with id = if txt_editor is { none then "", rich_editor then uid+"_editor"}, + //with uid = "_"+generate_random_string(20), + //with id = if txt_editor is { none then "", rich_editor then uid+"_editor"}, [ if txt_editor is { none then empty, rich_editor then partial(partial_content( [js(js_file("ckeditor/ckeditor.js")), js_inline(jquery_ready( - " var cke_instance = CKEDITOR.replace( '"+id+"' ); - cke_instance.on('blur', function() { cke_instance.updateElement(); }); + " var cke_instance = CKEDITOR.replace( '"+c_name+"' );"+ + //" var cke_instance = CKEDITOR.replace( '"+id+"' ); + " cke_instance.on('blur', function() { cke_instance.updateElement(); }); "))],empty)) }, - text_area([],no_label, html_Id(id), wan(c_name), init(not_null_String(value)), narrow, (Int)5, mandatory), help_line(help, _T)], + text_area([],no_label, html_Id(c_name), wan(c_name), init(not_null_String(value)), narrow, (Int)5, mandatory), help_line(help, _T)], boolean(s_name, c_name, value, help) then - [checkboxr([],label(_T(s_name), no_help)/*no_label*/, html_Id(""), wan(c_name), value, mandatory), help_line(help, _T)], + [checkboxr([],label(_T(s_name), no_help), html_Id(c_name), wan(c_name), value, mandatory), help_line(help, _T)], integer(s_name, c_name, value, help) then - [input(no_label, wan(c_name), init(abs_to_decimal(value)), small, mandatory), help_line(help, _T)], + [input(no_label, html_Id(c_name), wan(c_name), init(abs_to_decimal(value)), small, mandatory), help_line(help, _T)], float(s_name, c_name, value, help) then - [input(no_label, wan(c_name), init(float_to_string(value, 5)), small, mandatory), help_line(help, _T)], + [input(no_label, html_Id(c_name), wan(c_name), init(float_to_string(value, 5)), small, mandatory), help_line(help, _T)], choices_int(s_name, c_name, value, select, help) then - [selector_c([],no_label, html_Id(""), wan(c_name), 1, select.get(db, no_referer, ""), success(init(to_String(value))), mandatory), help_line(help, _T)], + [selector_c([],no_label, html_Id(c_name), wan(c_name), 1, select.get(db, no_referer, ""), success(init(to_String(value))), mandatory), help_line(help, _T)], date(s_name, c_name, value, help) then [input([class("datepicker")], no_label, html_Id(c_name), wan(c_name), init(not_null_String(value)), small, non_mandatory), help_line(help, _T)], time(s_name, c_name, value, help) then @@ -983,7 +985,7 @@ public define List(CXM_Form_Field) datetime(s_name, c_name, value, help) then [input([class("datetimepicker")], no_label, html_Id(c_name), wan(c_name), init(not_null_String(value)), custom(18), mandatory), help_line(help, _T)], color( s_name, c_name, value, help) then - [input([class("jscolor"), style("background-color: #"+value+";")], no_label, wan(c_name), init(not_null_String(value)), narrow, mandatory), help_line(help, _T)], + [input([class("jscolor"), style("background-color: #"+value+";")], no_label, html_Id(c_name), wan(c_name), init(not_null_String(value)), narrow, mandatory), help_line(help, _T)], phone( s_name, c_name, value, phone_type, help) then with sms_options = (Maybe(List(CoreAttrs)))if phone_type = cellphone then success([event(onclick, "hk_send_sms(this)"), class("clickable")]) else failure, with event = (List(CoreAttrs))if phone_type = fax then [] else [event(onclick, "hk_phone_call(this)"), class("clickable")], @@ -1017,9 +1019,9 @@ define CXM_Form_Field HK_Referer table_referer, (String) -> String _T, List(Web_arg) lwa, - List(HK_Form_Table_Line) form_lines, - Bool create, //this is new entry, db_id = none - Bool no_add //not allow to add new entry in dropdown + List(HK_Form_Table_Line) form_lines, + Bool create, //this is new entry, db_id = none + Bool no_add //not allow to add new entry in dropdown )= div([], table([class("striped")], @@ -1032,7 +1034,7 @@ define CXM_Form_Field { //construct one cell hk_form_table_cell(cell_attributes, entry) then - cell(make_cell_option(cell_attributes), to_HTML_In_Form(edit_form_cell(db, "", table_referer, lwa, _T, entry, create, no_add, []), lwa, "form_field table", false)), + cell(make_cell_option(cell_attributes), to_HTML_In_Form(edit_form_cell(db, table_referer, lwa, _T, entry, create, no_add, []), lwa, "form_field table", false)), //construct table in one cell hk_form_table_cell_table(cell_attributes, lines) then cell(make_cell_option(cell_attributes), to_HTML_In_Form([construct_edit_form_table(db, table_referer, _T, lwa, lines, create, no_add)], lwa, "form_field table", false)) @@ -1153,14 +1155,14 @@ public define Maybe(HTML_Partial_Content) (String) -> String _T, String lang, List(Web_arg) lwa, - String table, //table name + String table_name, //table name String view_name, //view name to use HK_Form_action action, //new_entry or edit an existing record VTM vtm, String fk_clause, HK_Referer referer ) = - if vtm_get_edit(table, vtm.edit_list) is + if vtm_get_edit(table_name, vtm.edit_list) is { failure then failure, success(vtm_e) then @@ -1168,10 +1170,10 @@ public define Maybe(HTML_Partial_Content) //get editor by his view name if get_edit(db, action, view_name) is { - hk_form_in_list(tb_name, v_name, list_form_entries, list_tabs) then - success(renderer_edit_list_form(db, _T, lang, /*web_site_directory,*/ tb_name, /*v_name,*/ list_form_entries, list_tabs, lwa, vtm, /*clause,*/ fk_clause, referer)), - hk_form_in_table(tb_name, v_name, form_in_table) then - success(renderer_edit_table_form(db, _T, lang, /*web_site_directory,*/ tb_name, /*v_name,*/ form_in_table, lwa, /*vtm,*/ /*clause,*/ fk_clause, referer)) + hk_form_in_list(_, v_name, list_form_entries, list_tabs) then + success(renderer_edit_list_form(db, _T, lang, table_name, /*v_name,*/ list_form_entries, list_tabs, lwa, vtm, /*clause,*/ fk_clause, referer)), + hk_form_in_table(_, v_name, form_in_table) then + success(renderer_edit_table_form(db, _T, lang, table_name, /*v_name,*/ form_in_table, lwa, /*vtm,*/ /*clause,*/ fk_clause, referer)) } }. -- libgit2 0.21.4