%--
* Licensed Materials - Property of IBM
*
* 5724-U18
*
* (C) COPYRIGHT IBM CORP. 2011,2014 All Rights Reserved.
*
* US Government Users Restricted Rights - Use, duplication or
* disclosure restricted by GSA ADP Schedule Contract with
* IBM Corp.
--%><%--
This JSP renders the select control.
--%>
<%@ include file = "../common/componentheader.jsp" %>
<%
if(designmode)
{ %>
<%@ include file = "../common/designerevents.jsp" %>
<% }
String width = component.getProperty("width");
width = component.getWebClientSession().attachUOM(width);
String dataattribute = component.getProperty("dataattribute");
String selectitem_keyvalue = "";
String selectitem_label = "";
String selectitem_labelClass = "";
String selectitem_class = null;
String displaystyle = null;
String readonly = "";
// In Firefox, the display:inline doesn't allow for setting the height and width which are needed for the listbox.
// Using the inline-stack and aligning it to the top is the only way to do this, unfortunately. Firefox 3 includes
// support for the more standard "inline-block" which should be used whenever support for Firefox 2 is dropped.
if(USERAGENT.equals("IE"))
displaystyle = "display:inline;";
else
displaystyle = "display:inline-block;vertical-align:top;";
if(WebClientRuntime.isNull(width))
width = "110px";
if(WebClientRuntime.isNull(cssclass))
cssclass = "text cbt";
if(isReadOnly)
readonly = "disabled=\"disabled\" aria-disabled=\"true\"";
String inputMode = component.getProperty("inputmode").toLowerCase();
String keyvalue = null;
if("query".equals(inputMode))
{
keyvalue = control.getDataBean().getQbe(dataattribute);
}
else
{
keyvalue = control.getDataBean().getString(dataattribute);
}
// Note how the select contents is built always - on render as well as on refresh - because updating it
// seems rather impossible. A performance improvement in the future might want to look at setting the
// focused item on refresh to work without the need to regenerate the whole select contents
String selectdivAutoId = "";
if(automation)
{
selectdivAutoId = "automationid=\"" + realId + "_selectdiv\"";
}
String sendEvent = "";
if(!isReadOnly)
{
sendEvent = "sendEvent('setvalue','" + id + "', this.value)";
}
%>
<% //when the control is not set to refreshonreloadevent=false, the call will only come here if the control has changed.
//So make sure the control is not to be changed again unless done explicitly.
control.setChangedFlag(false);
%><%@ include file="../common/componentfooter.jsp" %>