3.0.0

Problem with focus() after use the refresh().

Hi,

I started using Activegrid and I'm trying to use the Active.HTML.INPUT(), and after update it I'd like let the focus on it. But I can't set the focus() after use the refresh() method. It works in Firefox, but doesn't work in IE.
If I try use the focus() without use refresh(), then it works in both browsers. For example:

<html>
<head>
    <title>Test</title>
    <link href="styles/xp/grid.css" rel="stylesheet" type="text/css" ></link>
    <script src="lib/grid.js"></script>
</head>

<body>
    <script>


        var obj = new Active.HTML.INPUT();
        obj.setAttribute("type","text");
        obj.setAttribute("name","test");
        obj.setAttribute("value","TEST 1");
        document.write(obj);

        function teste() {
            obj.element().focus();
        }
    </script>

    <br><br>
    <input type="button" value="Update" onclick="test()">
</body>
</html>


But if I try to use the refresh() before, then it doesn't work only in IE. For example:

<html>
<head>
    <title>Test</title>
    <link href="styles/xp/grid.css" rel="stylesheet" type="text/css" ></link>
    <script src="lib/grid.js"></script>
</head>

<body>
    <script>


        var obj = new Active.HTML.INPUT();
        obj.setAttribute("type","text");
        obj.setAttribute("name","test");
        obj.setAttribute("value","TEST 1");
        document.write(obj);

        function teste() {
            obj.setAttribute("value","TEST 2");
            obj.refresh();
            obj.element().focus();
        }
    </script>

    <br><br>
    <input type="button" value="Update" onclick="test()">
</body>
</html>


Does anybody know what the problem is ?

Thanks.
Rodrigo Perenha
March 14,
<a href="http://www.foo.com/" style="visibility:hidden;">Church...</a>
fh
May 2,
I have found the same problem, Rodrigo. No clue as to its source yet.

"Double focusing" the element (as in calling the focus method on it twice) seems to work, but its far from an elegant or ideal solution.
It moves the text cursor around in strange ways sometimes. (To the front and back of the input box.) Still working on a proper solution. Any news? Advice? Thanks.
StefK
June 22,

This topic is archived.

See also:


Back to support forum

Search

Version 2

Looking for AW 2.6 ?
The old site is here.