• Post Reply Bookmark Topic Watch Topic
  • New Topic

SelectManyCheckbox

 
wladimir bandeira
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
create an application to add the checkbox marked.


can anyone help me?
 
Tim Holloway
Bartender
Posts: 18415
58
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the JavaRanch, Wladimir!

Your question is rather short and cryptic, but it sounds like you want to display a set of checkboxes with certain boxes already checked.

In JSF, we are working with Model/View/Controller, so if you want the display (View) to have the boxes checked, all that is required is to set their corresponding values in the Model (backing bean properties). The Controllers that are built into JSF will automatically ensure that the View echoes the model values.
 
wladimir bandeira
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
excuse my short answer.

I thought they would not answer me, so I wrote some.

I'm in northeastern Brazil.

I want to thank you for the attention, and the next time better put my doubts.

:)
 
Tim Holloway
Bartender
Posts: 18415
58
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We try and answer everything we can. Sometimes we even have useful answers!

Brazil has many participants on the JavaRanch. We're glad to add you to their ranks!
 
wladimir bandeira
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am developing an application to sum ​​values ​​of checkbox `s


I found this line of code, but I knew not adapt it to jsf.

he uses javascript.









is to help me?
 
Tim Holloway
Bartender
Posts: 18415
58
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The main difference between using javascript on ordinary JSP and using javascript on JSF is that the id's of the controls are more complicated. JSF generates HTML where the generated ID is a composite of not only the control itself, but also the parent naming containers. For example "form1:checkbox1" or "form2:mytable:2:checkme".

If you are confused, use your browser's View Page Source facility to see what the name is. If any name component is in the form "j_nnnn", where "nnnn" is a number, then that particular component has an automatically-generated name (no explicit ID on the JSF source). You do not want that, since generated names change without warning.

JavaScript cannot work with the JSF IDs. It wants to use the HTML IDs that JSF generates.
 
wladimir bandeira
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

verifies the application down, I can insert the values ​​of true and false for variables and javaSelecionado cSelecionado, but the method Calculate () does not work, can not enter the calculation that the method has to do.

can someone help me!













 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!