Databases Reference
In-Depth Information
Next, a local variable is checked to see if a user selected a jQuery UI theme. If so, the correct CSS file for
the theme is added to the page.
ELSE
apex javascript.add library(
p name => 'com pluggen password',
p directory => p plugin.file prefix,
p version => NULL
);
IF l jqueryui theme IS NOT NULL
THEN
apex css.add file(
p name => 'jquery-ui',
p directory => apex application.g image prefix || 'libraries/
jquery-ui/1.8/themes/' || l jqueryui theme || '/',
p version => NULL
);
END IF;
A call to APEX PLUGIN.GET INPUT NAME FOR PAGE ITEM is used to obtain the value which should be
assigned to the name attribute of the password element. This will ensure that the value of the item is saved
in session state when the page is submitted. Then a call to SYS.HTP.P is used to add HTML output to the
output buffer. Various attribute values set by the plug-in user are used to determine exactly what HTML
is output.
l name := apex plugin.get input name for page item(FALSE);
sys.htp.p(
'<input type="password" name="' || l name || '" id="' || p item.name
|| '" size="' || p item.element width || '" maxlength="' || p item.element max length
|| '" ' || p item.element attributes || ' '
|| CASE
WHEN l submit on enter = 'Y'
THEN 'onkeypress="return submitEnter(this,event)"'
END
|| '/>'
);
The following lines of code build up a string of JavaScript and then use
APEX JAVASCRIPT.ADD ONLOAD CODE to add the code to the page so that it will be executed when the DOM
is ready. The JavaScript code initializes the password widget with the input element.
APEX JAVASCRIPT.ADD ATTRIBUTE is used to add attributes to the options object of the widget.
l onload code := 'apex.jQuery("input#' || p item.name || '").pg password({' || l crlf
|| ' ' || apex javascript.add attribute('warningMsgIcon', l message icon) || l crlf
|| ' ' || apex javascript.add attribute('warningMsgText', l message text) || l crlf
|| ' ' || apex javascript.add attribute('warningMsgWidth', l message width) ||
l crlf
|| ' ' || apex javascript.add attribute('warningMsgAlignment',
l message alignment) || l crlf
Search WWH ::




Custom Search