Databases Reference
In-Depth Information
310 INTO v_affected_elements, v_affected_elements_type, v_affected_region_id,
v_affected_region_static_id
311 FROM apex_application_page_da_acts aapda, apex_application_page_regions aapr
312 WHERE aapda.action_id = p_dynamic_action.ID
313 AND aapda.affected_region_id = aapr.region_id(+);
314
315 IF v_affected_elements_type = 'jquery selector' THEN
316 v_html := 'apex.jQuery(""' || v_affected_elements || '"").hide();';
317 ELSIF v_affected_elements_type = 'dom object' THEN
318 v_html := 'apex.jQuery(""#' || v_affected_elements || '"").hide();';
319 ELSIF v_affected_elements_type = 'region' THEN
320 v_html := 'apex.jQuery(""#' || nvl(v_affected_region_static_id, 'R' ||
v_affected_region_id) || '"").hide();';
321 ELSE
322 -- unknown/unhandled (nothing to hide)
323 raise_application_error(-20001, 'Unknown Affected Element Type');
324 END IF; -- v_affected_elements_type
325
326 apex_javascript.add_onload_code (
327 p_code => v_html,
328 p_key => NULL); -- Leave null so always run
329 END IF; -- v_hide_on_load
330
331 -- RETURN
332 v_result.javascript_function := '$.ui.clarifitDialog.daDialog';
333 v_result.attribute_01 := v_modal;
334 v_result.attribute_02 := v_close_on_esc;
335 v_result.attribute_03 := v_title;
336 v_result.attribute_04 := v_on_close_visible_state;
337
338 RETURN v_result;
339
340 END f_render_dialog;
341
342 ...
Hereis an explanation of key passages in the preceding code listing:
234-243: Application- and component-level custom attributes; remember to
use meaningful names to describe them rather than their attribute number. It
may also be helpful to put a comment on expected values when applicable so
that other developers know what values to expect.
250-253: Variables to store the affected elements; generally, in dynamic action
plug-ins, this information is required only in the JavaScript code (which can be
referenced in the this object). Due to the requirement of hiding the object on
page load, the affected element is required here. This will be discussed further
in the code analysis.
257-266: Inline function to convert Y/N values to true/false (string) values; this
is not required, but if you need to convert some of the same types, attributes
creating inline functions can save time.
Search WWH ::




Custom Search