converting normal text to textfield

hi,

I am unable to convert the normal text into a textfield by using the following code.Is there any mistake in my code.

my jsf page is

<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>

<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>

<html>

<body>

<f:view>

<h:form>

<h:outputText value="ChangeMe" rendered="#{!myBean.showInputText}" />

<h:inputText value="ChangeMe" rendered="#{myBean.showInputText}"/>

<h:commandButton value="ClickMe" onclick="#{myBean.clicked}"/>

</h:form>

</f:view>

</body>

</html>

and my bean class is

public class MyBean {

private boolean showInputText = true;

private boolean clicked = true;

public boolean getShowInputText() {

if (showInputText)

return false;

else

return true;

}

public boolean getClicked() {

if (showInputText)

showInputText = false;

else

showInputText = true;

return clicked;

}

}

[1086 byte] By [javamnr948a] at [2007-11-27 11:33:04]
# 1

The onclick attribute of the commandButton is for JavaScript (client-side) handlers. You have written a JSF (server-side) handler. Try using the action or actionListener attributes of commandButton instead (although you will need to change the signature of your method).

RaymondDeCampoa at 2007-7-29 16:49:12 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...