Javascript and CSS questions

Just two quick questions. First, I am trying to change the value of one of my backing bean properties using js. It is a boolean and what I tried was:

onfocus="{ ${displayOnly} = true}"

however, as expected, this tries to set the actual value of displayOnly (false) to true which cant be done. How do I set the variable displayOnly to true?

My other questions is about css. I have a panelgrid which has many inputText and labels. Using a styleclass on the panelgrid changes the styles of the labels but the inputText stay the same. Is there a way to write a subclass of my panelgrids style (pgstyle)? I tried .pgstyle t:inputText and .pgstyle #t:inputText but neither worked. As you can see, I have no idea what I am doing when it comes to subclassing style classes so I would appreciate any help I can get.

[831 byte] By [jco1323a] at [2007-11-27 10:24:25]
# 1

> Just two quick questions. First, I am trying to

> change the value of one of my backing bean properties

> using js. It is a boolean and what I tried was:

>

> onfocus="{ ${displayOnly} = true}"

>

> however, as expected, this tries to set the actual

> value of displayOnly (false) to true which cant be

> done. How do I set the variable displayOnly to true?

JavaScript is executed on the client side. Your backing bean lives on the server side. So the only way to modify the backing bean properties is when the server is processing a request. You can use JavaScript to help define what this request will be and even invoke it, but you cannot directly change the backing bean via JavaScript.

>

> My other questions is about css. I have a panelgrid

> which has many inputText and labels. Using a

> styleclass on the panelgrid changes the styles of the

> labels but the inputText stay the same. Is there a

> way to write a subclass of my panelgrids style

> (pgstyle)? I tried .pgstyle t:inputText and .pgstyle

> #t:inputText but neither worked. As you can see, I

> have no idea what I am doing when it comes to

> subclassing style classes so I would appreciate any

> help I can get.

CSS is interpreted on the client side. The inputText components are interpreted on the server side; they generate HTML which is what the browser sees.

You need to have a solid understanding of what is executed where in order to develop web applications.

RaymondDeCampoa at 2007-7-28 17:27:50 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...