• Post Reply Bookmark Topic Watch Topic
  • New Topic

display error in datatable  RSS feed

 
sonia khetarpal
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to display the error messages inside the datatable just alongside its editable inputtext fields. I can do this if I use the required=true in jsf but
i have different actions to be performed for this datatable ie.
1. save -just save the data w/o performing validation for required fields
2. next - perform required field validation and save data

how can i do this?
[ January 17, 2007: Message edited by: Bear Bibeault ]
 
Andres Quinones
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by sonia khetarpal:
I want to display the error messages inside the datatable just alongside its editable inputtext fields. I can do this if I use the required=true in jsf but
i have different actions to be performed for this datatable ie.
1. save -just save the data w/o performing validation for required fields
2. next - perform required field validation and save data

how can i do this?


Hi Sonia, I think that one possible solution is to add a String field to the class that has each element of your table. So when you validate each position of the list that is the value for the table you can fill that property and when the table is rerendered the validation message could be there an the user can read it.
Don�t forget to put an outputText so you can show this property.

Another solution is to create a list with the same size of the list that has the value of the table. There you can have Strings with the error for each row. So with the modelIndex of the table you can get each position of the error list to render it in the row of the table.

I hope this helps.

[ January 17, 2007: Message edited by: Andres Quinones ]
[ January 17, 2007: Message edited by: Andres Quinones ]
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66207
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please refrain from posting in all uppercase. I have changed your title for you.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!