• 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

how to add HR tag between rows when using datatable???

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

I am using datatable.
i want to add <hr> between rows. since datatable provides only <h:column>
i dont know how to add <hr> between the rows.

please let me know, how to do this.


thanks in advance
Gopal
 
Ranch Hand
Posts: 362
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you want to use the hr tag to show a line separating each row you might want to look into style sheets and set a row style sheet that creates the same effect.
 
gopal kishan
Ranch Hand
Posts: 99
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Gerardo,

I tried to add style sheet for row but it is showing , so i tried to add for columns its works ok not so good.

Actually i want to display "--" if there is no value in the column

eg: empno empname age
101 A --
102 -- 26

i dont know how to set this "--".

please let me know how to do this.

thanks in advance
Gopal
 
Gerardo Tasistro
Ranch Hand
Posts: 362
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ok I'm assuming that by no value you mean null. Please change the validation accordingly if it is not.

The following should work

<h:column>
<h utputText value="--" rendered="#{controlAdmin.testValue==null}"></h utputText>
<h:inputText value="#{controlAdmin.testValue}" rendered="#{controlAdmin.testValue!=null}"></h:inputText>
</h:column>

It has two outputs inside the column tag. One is an inputText and one is an outputText. Only one will be displayed depending on the value of rendered="".

The first tag compares the controlAdmin.textValue variable against null. If it is null it renders the outputText (showing "--"). Hence the second (the inputText) isn't rendered since it's test is against NOT null. So when not null the variables value is shown.

Change controlAdmin for whatever you put in var under dataTable and you should be ready to go. Change inputText to outputText too.

Cheers,
Jerry
 
gopal kishan
Ranch Hand
Posts: 99
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Gerardo,

Thank you so much.

It works fine. i am getting the desired output as i wish(--).

Thanks a lot.
 
Gerardo Tasistro
Ranch Hand
Posts: 362
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You're welcome.
 
I don't get it. A whale wearing overalls? How does that even work? It's like a tiny ad wearing overalls.
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic