Forums Register Login

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

+Pie Number of slices to send: Send
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
+Pie Number of slices to send: Send
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.
+Pie Number of slices to send: Send
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
+Pie Number of slices to send: Send
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
+Pie Number of slices to send: Send
Hi Gerardo,

Thank you so much.

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

Thanks a lot.
+Pie Number of slices to send: Send
You're welcome.
Please do not shoot the fish in this barrel. But you can shoot at this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 3296 times.
Similar Threads
Print new rows in dataTable
datatable iteration
h:selectBooleanCheckbox
datatable renders empty rows
how to add HR tag between rows when using datatable???
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 05:56:06.