-1

I'm having some trouble solving this issue. the code that matters is:

 for( k=1; tamanho>k ; k++) {

 var a= "#{BDEStats.getListaJobStats().get(k).getName()}";

This is javascript and im trying to pass "k" to my bean invocation. but JS doesnt recognize "k" inside the bean call

Do you know a way I can escape a character so JS recognizes it? or concatenate the bean invocation?

Any ideas??

Thank you in advance.

Christian Phillips
  • 18,399
  • 8
  • 53
  • 82
  • `#{BDEStats.getListaJobStats().get(k).getName()}` evaluate on server side but `k` is a javascript vaiable which runs in client, so i think its not possible. – seenukarthi Dec 01 '14 at 09:45
  • @Karthikeyan is right, your options are either generate the full array of values when the page is generated (of course, values will not be updated) or use ajax/partial rendering of JSF. – SJuan76 Dec 01 '14 at 09:47

1 Answers1

0

Problem solved by using JSON and pasing a JSON Object to Javascript. Further details Read a Java array in Javascript

Community
  • 1
  • 1