problem using javascript in sun stdio creator jsf

Hi,

i am getting a problemwhile using javascript in stdio creator.

my code is

[b]<?xml version="1.0" encoding="UTF-8"?>

<jsp:root version="1.2" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:jsp="http://java.sun.com/JSP/Page" xmlns:ui="http://www.sun.com/web/ui">

<jsp:directive.page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"/>

<f:view>

<ui:page binding="#{test.page1}" id="page1">

<ui:html binding="#{test.html1}" id="html1">

<ui:head binding="#{test.head1}" id="head1">

<ui:link binding="#{test.link1}" id="link1" url="resources/style.css"/>

<script>

function focus1(){

alert("ok");

var f1=document.getElementById("form1:textField2");

f1.focus();

f1.value="ako";

}

</script>

</ui:head>

<ui:body binding="#{test.body1}" id="body1" style="background-color: rgb(0, 204, 204); -rave-layout: grid">

<ui:form binding="#{test.form1}" id="form1">

<ui:textField binding="#{test.textField2}" id="textField2" style="left: 120px; top: 72px; position: absolute"/>

<ui:button action="#{test.button1_action}" actionListener="#{test.myaction}" binding="#{test.button1}" id="button1"

onClick="focus1()" style="position: absolute; left: 120px; top: 120px; width: 120px; height: 24px" text="Button"/>

</ui:form>

</ui:body>

</ui:html>

</ui:page>

</f:view>

</jsp:root>[/b]

[u]my problem is[/u]

[b][u]when i am clicking on button1 it executes the script[/u]

and setting the focus on the textbox and immediatly in few seconds

text box losing the focus why is ithapping like that

and the value of textbox is"ako"for a moment and

immediatly in few second the textbox setting it to empty(default)

[/b]

with regards

ss

[3103 byte] By [shannu] at [2007-11-26 11:28:50]
# 1
After focus() is executed action button submit form
OfPo at 2007-7-7 3:44:35 > top of Java-index,Development Tools,Java Tools...