on 05-24-2006 3:20 PM
Hi,
I am using htmlb and xhtmlb for my BSP page development, which has a tableView. The content design being used is design2003.
I am using the following javascript code to keep a field selected:
function changeFocus()
{
myForm.barcode.select();
}
myForm is the form name,
barcode is the inputField, within a tableView.
This works fine, when I am using the desing2002 or CLASSIC. But when I use the design2003, this does not work, but it only keeps the cursor focus on the inputfield. I want the entire value to be selected.
Any help in this would be highly appreciated.
Thanks
Shankar
Hi,
Give design attribute value as design2003+design2002 .
You will get the solution.
Regards,
Azaz Ali.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Azaz,
Foll is the layout:
<%@page language="abap" %>
<%@extension name="htmlb" prefix="htmlb" %>
<%@extension name="xhtmlb" prefix="xhtmlb" %>
<html>
<head>
<META HTTP-Equiv="Battery" content="Hide">
<META HTTP-Equiv="Signal" content="Hide">
<META HTTP-Equiv="Scanner" content="Enabled">
<META HTTP-Equiv="HomeKey" content="Enabled">
<SCRIPT LANGUAGE="JavaScript" SRC="utilities.js"></SCRIPT>
</head>
<htmlb:content design="classicdesign2002design2003"
forceEncode="ENABLED"
rtlAutoSwitch="true"
controlRendering="sap">
<htmlb:page title = "Receive Inventory"
onLoad = "javascript:changeFocus()" >
<script>
function changeFocus()
{
<% if lv_toggle = ' '. %>
myForm.barcode.focus();
<% else. %>
myForm.poqty_1_3.select();
myForm.poqty_1_3.focus();
<% endif. %>
}
</script>
<htmlb:form id="myForm" >
<%@include file="page_header.htm" %>
<table BGCOLOR="#cccccc" width="240px" cellspacing="0" cellpadding="0" border="0">
<td><b><%= otr(ZRETAIL_SYMBOL/RECEIVE_INVENTORY) %></b></td>
<td align="right"> <b>
<htmlb:link id="menu" text="<%= otr(ZRETAIL_SYMBOL/MENU) %>" onClick = "menu" />
</b>
</td>
</table>
<%@include file="status_bar.htm" %>
<br>
<% if not application->gv_vendor_type = 'RAC'. %>
<table width="240px" cellspacing="0" cellpadding="1">
<tr>
<td>
<htmlb:textView text="PO Document" />
</td>
<td>
<htmlb:inputField id = "po"
value = "<%= application->gv_po %>"
maxlength = "10"
disabled = "X"
/>
</td>
</tr>
</table>
<% endif. %>
<htmlb:tableView id = "poqty"
design = "STANDARD"
designMode = "HTMLB"
visibleRowCount = "4"
table = "<%= lt_items %>"
width = "240px"
tableLayout = "AUTO"
iterator = "<%= iterator %>"
>
</htmlb:tableView>
<htmlb:textView text="<%= otr(ZRETAIL_SYMBOL/BARCODE) %>" />
<htmlb:inputField id = "barcode"
value = "<%= lv_barcode %>"
submitOnEnter = "X"/>
<br>
<xhtmlb:protectDoubleSubmit/>
<htmlb:button id = "post"
text = "Post"
width = "60px"
onClick = "post"/>
</htmlb:form>
</htmlb:page>
</htmlb:content>
Regards,
Shankar
check this code sample. it works with all designs (2003, 2002, classic)
<%@page language="abap"%>
<%@extension name="htmlb" prefix="htmlb"%>
<htmlb:content design="design2003">
<htmlb:page title = " " onLoad="textFocus();">
<htmlb:form id="myform">
<%
data: test type string .
test = 'Selected' .
%>
<htmlb:inputField id = "IP1"
alignment = "LEFT"
size = "10"
type = "STRING"
value = "<%= test %>" />
<SCRIPT LANGUAGE="JScript">
function textFocus()
{
document.myform.IP1.select();
// document.getElementsByName("IP1")[0].select();
}
</SCRIPT>
</htmlb:form>
</htmlb:page>
</htmlb:content>
in the javascript function textFocus
both the approach works
you can use
document.myform.IP1.select();
or this also
document.getElementsByName("IP1")[0].select();
Regards
Raja
User | Count |
---|---|
86 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.