Pavan
Pavan

Reputation: 21

how to get managed bean property values inside javascript

Iam new to JSF,

I want to retrieve bean values inside javascript.

Could you please help me out?

Tried like this:

function Call() 

{

  var value= "#{myBean.property}";

  alert(value);

} 

Upvotes: 2

Views: 2066

Answers (1)

cнŝdk
cнŝdk

Reputation: 32145

Use the <h:outputScript> tag to call any Javascript code within your JSF page:

<h:outputScript>
    function call() {    
        alert("#{myBean.property}");
    }
</h:outputScript>

Upvotes: 1

Related Questions