This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of The Little Book of Impediments (e-book only) and have Tom Perry on-line!
See this thread for details.
Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
gopal kishan
Ranch Hand
Posts: 99
  • Mark post as helpful
  • send pies
  • 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
 
Gerardo Tasistro
Ranch Hand
Posts: 362
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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
  • 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
  • Quote
  • Report post to moderator
You're welcome.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic