• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • paul wheaton
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Tim Holloway
  • Carey Brown
  • salvin francis

SelectManyCheckbox

 
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?
 
Bartender
Posts: 21003
128
Android Eclipse IDE Tomcat Server Redhat Java 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: 21003
128
Android Eclipse IDE Tomcat Server Redhat Java 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: 21003
128
Android Eclipse IDE Tomcat Server Redhat Java 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!













 
The City calls upon her steadfast protectors. Now for a tiny ad:
create, convert, edit or print DOC and DOCX in Java
https://products.aspose.com/words/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!