Adding javascript onchange to attribute_edit_gui

Author Message

Kedar Deshpande

Monday 11 May 2009 12:26:40 pm

Is there a way to add attributes to a attribute_edit_gui call to provide an onchange call? I saw on the forums that there is an example of creating a call from a dropdown selection but it is not using the attribute_edit_gui operator.

http://ez.no/developer/forum/setup_design/adding_javascript_call_to_a_attribute_edit_gui_object

Current:

{attribute_edit_gui attribute_base=$attribute_base attribute=$attributes.item view_parameters=$view_parameters}

which produces source as:

<select id="ezcoa-423_lead_content_type" class="ezcc-cc_lead ezcca-cc_lead_lead_content_type" name="ContentObjectAttribute_ezselect_selected_array_3150[]" ><option value="0" >Image</option><option value="1" >Feed</option>
</select>

How/What can be passed to the attribute_edit_gui operator for the addition of onChange="javascript:func(this);" in the select statement?

thanks.

André R.

Monday 11 May 2009 12:31:34 pm

Override the template used by attribute_[edit|view]_gui (enable DebugOutput and ShowTemplates in site.ini to get the clues you need.) and make your custom template look for custom attribute_onchange variable if you need to define this in edit template.

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

Kedar Deshpande

Monday 11 May 2009 12:40:04 pm

Thanks for the tip. I thought there might be a way to pass the needed fields into the existing operator, but making my own with the required values sounds good as well.

Thanks

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 18:23:53
Script start
Timing: Jan 18 2025 18:23:53
Module start 'layout'
Timing: Jan 18 2025 18:23:53
Module start 'content'
Timing: Jan 18 2025 18:23:54
Module end 'content'
Timing: Jan 18 2025 18:23:54
Script end

Main resources:

Total runtime0.6624 sec
Peak memory usage4,096.0000 KB
Database Queries57

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0044 588.0469152.6406
Module start 'layout' 0.00450.0023 740.687539.4766
Module start 'content' 0.00680.6543 780.1641535.4531
Module end 'content' 0.66100.0014 1,315.617212.1250
Script end 0.6624  1,327.7422 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00290.4418160.0002
Check MTime0.00120.1833160.0001
Mysql Total
Database connection0.00060.088810.0006
Mysqli_queries0.618393.3434570.0108
Looping result0.00050.0778550.0000
Template Total0.636896.120.3184
Template load0.00170.259720.0009
Template processing0.635095.864920.3175
Template load and register function0.00020.031610.0002
states
state_id_array0.00100.157610.0010
state_identifier_array0.00080.114920.0004
Override
Cache load0.00140.2090180.0001
Sytem overhead
Fetch class attribute can translate value0.00060.091320.0003
Fetch class attribute name0.00160.243540.0004
XML
Image XML parsing0.00060.090920.0003
class_abstraction
Instantiating content class attribute0.00000.001440.0000
General
dbfile0.00080.1207170.0000
String conversion0.00000.001240.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
3content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
5content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 13
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs