• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Components missing in component tree for h:dataTable ?

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I have a very basic h:dataTable definition like this


To the two h:inputText I've attached a validator :


What I want to do, is to highlight the field that failed validation with blue background. The problem is that I always get the whole column background color to blue. For instance, if I write Blue in any field in the "Color" column I got the following output
Audi Blue (the field that failed validation)
Mercedes Red (why does this get Blue ?)
Porsche Black (why does this get Blue ?)
Volkswagen Green (why does this get Blue ?)


Actually I think I know the problem, but I dont know why it behaves this way. Or how to solve it. When I look at the Component tree for the page I get this (some attributes removed to readability):


Scoped Variables

It seems there is not a Component in the Component Tree for every h:inputText I have in my view ? Why is it this way ? When I run the program I see the that the validator executes for 8 components :
From log:
SEVERE: Got comp with id: carForm:carDataTable:0:brand and value Audi
SEVERE: Got comp with id: carForm:carDataTable:0:color and value Blue
SEVERE: Failed validation for compcarForm:carDataTable:0:color
SEVERE: Got comp with id: carForm:carDataTable:1:brand and value Mercedes
SEVERE: Got comp with id: carForm:carDataTable:1:color and value Red
SEVERE: Got comp with id: carForm:carDataTable:2:brand and value Porsche
SEVERE: Got comp with id: carForm:carDataTable:2:color and value Black
SEVERE: Got comp with id: carForm:carDataTable:3:brand and value Volkswagen
SEVERE: Got comp with id: carForm:carDataTable:3:color and value Green

...but I cant see them in the Component tree ? Is there a way to force JSF to render Components and add them to the Component Tree ? Othwervise I cant see how to solve the problem.

Best regards
 
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you're using JSF 2.0 there is a very easy way to style invalid components. Works great with datatables.

and css style:
 
Lasagna is spaghetti flvored cake. Just like this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic