getElementName for Tabpanels in find mode

Questions, tips and tricks and techniques for scripting in Servoy

getElementName for Tabpanels in find mode

Postby irenem » Tue Sep 13, 2011 6:38 pm

Hi,

is there a way to get the name of the selected element in a tabpanel, or the name of the tabpanel itself in find mode?

Code: Select all
var name = arguments[2].getSource().getName()

works for a field but if i select a field in a tabpanel it returns an error.
Irene Meyer

Version: 6.0.5
Java version 1.6.0_29
Mac OS X Version 10.7.3
User avatar
irenem
 
Posts: 279
Joined: Tue Aug 28, 2007 2:09 pm
Location: Netherlands

Re: getElementName for Tabpanels in find mode

Postby jcompagner » Wed Sep 14, 2011 4:07 pm

whats is arguments[2] ?
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8828
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Re: getElementName for Tabpanels in find mode

Postby irenem » Wed Sep 14, 2011 4:37 pm

Hi Johan,

in the screenshot you can see what I mean.

If I'm in find-mode and I click on a field in the form, enter my search criteria and enter I get a name that I can use in my onSearch method.
JSEvent(type = form, source = TEXT_FIELD[name:fld_customer_ref,x:368,y:94,width:228,height:18,value:hello], formName = repair_registration, elementName = fld_customer_ref, timestamp = Wed Sep 14 16:05:42 CEST 2011,modifiers = 0,x =0,y = 0,data = null) {data:null}


If I do the same with a field in a tabpanel in the same form I get this, and of course an error running the method.

JSEvent(type = form, source = FormController[form: repair_registration, fs size:1, selected record: FindRecord[COLUMS: {proj_id,proj_name,proj_description,proj_rel_name,proj_act_id,proj_act_name,proj_date,proj_name_display,proj_number,proj_icon_select,proj_rel_id,proj_status,proj_always_email,proj_end_date,proj_course_price,proj_course_time,proj_course_starttime,proj_course_endtime,proj_date_form_back,proj_rel_type,proj_rel_short_name,proj_cration_date,proj_mod_user,proj_mod_date,proj_creation_user,proj_always,proj_quot_number,proj_address,proj_rel_cont,proj_rel_cont_id,proj_rel_id2,proj_place,proj_template_confirm,proj_confirm_link,proj_module,proj_your_ref,proj_template_pourchase,proj_pourchase_link,proj_housenumber,proj_zip,proj_city,proj_phone,proj_fax,proj_email,proj_cathegory,proj_serialnumber,proj_model,proj_imei,proj_date_pourchase,proj_date_bill,proj_customer_ref,proj_problem,proj_model_number,proj_part_damaged,proj_shipping_number,proj_headphone,proj_proof_purchase,proj_gsx_coverage,proj_received,proj_quotation_ok,proj_invoice_scan,proj_cs_code,proj_accidental_damage,proj_reparable_damage,proj_modifier,proj_part_number,proj_shipping_number_return,proj_status_logistik,proj_serialnumber_new,proj_status_billing,proj_waybill,proj_gsx_order_number,proj_invoice_note,proj_eee_code,proj_price_purchase,proj_price_sale,proj_invoice_number,proj_comp_tia_code,proj_comp_tia,proj_warraty_type,proj_return_type,proj_repair_type,proj_payment,proj_payed,proj_address_id,proj_phone_id,proj_email_id,proj_country,proj_barcode_number,proj_barcode_imei,proj_barcode_serial,proj_batch_id,proj_cust_id,proj_rel_full,proj_rel_full_adr,proj_date_received,proj_imei_new,proj_repeat_repair,proj_count_parts,proj_damage_reason,proj_date_waybill,proj_ntf,proj_swh,proj_number_display,proj_repair_description,proj_rel_folder_name,proj_open,proj_expensive,proj_tot_cost,proj_prod_cost,} DATA:{}, RELATED: {projects_to_hours=FoundSet[Table:hours,Size: 1,Relation: projects_to_hours,CachedRecords: 1,SELECTED INDEX: 0], projects_to_project_rules=FoundSet[Table:project_rules,Size: 1,Relation: projects_to_project_rules,CachedRecords: 1,SELECTED INDEX: 0]}]], formName = repair_registration, elementName = <no name>, timestamp = Wed Sep 14 16:17:55 CEST 2011,modifiers = 0,x =0,y = 0,data = null) {data:null}


What I try to do is to catch the element name of the itemI click on.
Attachments
Screen shot 2011-09-14 at 16.09.28.png
Screen shot 2011-09-14 at 16.09.28.png (37.56 KiB) Viewed 3335 times
Irene Meyer

Version: 6.0.5
Java version 1.6.0_29
Mac OS X Version 10.7.3
User avatar
irenem
 
Posts: 279
Joined: Tue Aug 28, 2007 2:09 pm
Location: Netherlands

Re: getElementName for Tabpanels in find mode

Postby jcompagner » Thu Sep 15, 2011 8:31 am

But what kind of event are we really talking here for both fields?
onAction of a field? or is it the onSearch event of a form?
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8828
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Re: getElementName for Tabpanels in find mode

Postby irenem » Thu Sep 15, 2011 8:39 am

the onSearch event of a form.
Irene Meyer

Version: 6.0.5
Java version 1.6.0_29
Mac OS X Version 10.7.3
User avatar
irenem
 
Posts: 279
Joined: Tue Aug 28, 2007 2:09 pm
Location: Netherlands

Re: getElementName for Tabpanels in find mode

Postby jcompagner » Thu Sep 15, 2011 4:47 pm

yes this is currently the behavior that is explicitly programmed this way

you can't have an JSEvent that tells you that is is for Form "X" but the source component is from a Form "Y"
Need to see if we can change this and how
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8828
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet


Return to Methods

Who is online

Users browsing this forum: No registered users and 17 guests