This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
I have a datatable with input fields and 8 rows.
If any of the stylenumbers in a row is entered, then the qty column should be entered and it should be greater than 0.
Only for the rows where style number is entered. Can i use some kind of validation/rendering to make this happen?
Appreciate your help!
The critical thing to keep in mind is that JSF is based on Model/View/Controller. So to update the display, you must update the model. That is, you must update the appropriate properties in the backing bean. In the case of a dataTable, the table's DataModel object is a sub-model, and the individual rows of that table are components of that sub-model, so that's where the updates must be made.
Under stock JSF, the updates could only be done by submitting the entire form containing the table and getting an updated page back. You are using PrimeFaces, I see, so if you prefer, you could take advantage of the PrimeFaces AJAX support features to update parts of the current page instead of submitting and updating the entire page. The technical name for that process is "partial page update" or "partial page refresh".
An IDE is no substitute for an Intelligent Developer.