Databases Reference
In-Depth Information
If you run Page 10 again, no errors should appear, like Figure 3-24.
Figure 3-24. From/to date picker with blank rendering
As Figure 3-24's caption states, the region is blank as nothing was displayed. The next set of steps
will create the HTML input element so it displays on the screen. To do so, replace NULL; -- Need to
fill this in with the following code:
-- Not read only
-- Get name. Used in the "name" form element attribute which is different than the "id"
attribute
v_page_item_name := apex_plugin.get_input_name_for_page_item (p_is_multi_value => FALSE);
-- SET VALUES
-- OUTPUT
-- Print input element
v_html := '<input type="text" id="%ID%" name="%NAME%" value="%VALUE%" autocomplete="off">';
v_html := REPLACE(v_html, '%ID%', p_item.name);
v_html := REPLACE(v_html, '%NAME%', v_page_item_name);
v_html := REPLACE(v_html, '%VALUE%', p_value);
sys.htp.p(v_html);
-- JAVASCRIPT
-- Tell apex that this field is navigable
v_result.is_navigable := TRUE;
To summarize the foregoing code, it prints an input element and then tells APEX that it's a navigable
item. The attribute autocomplete is set to off on the input element to prevent a list of values being
displayed when the user focuses on the field.
When defining the HTML code, mnemonics are used and then replaced for their appropriate values.
This is a technique that John Scott showed at ODTUG Kscope 11 to make things easier when writing the
HTML code. You do not need to use this technique, but it does make reading the code a bit easier. Of
course, if your application needs to be as performant as possible, you may want to use a concatenated
string and forgo the extra calls to the REPLACE function.
 
Search WWH ::




Custom Search