Add column to datatable,a question...

G

gbattine

Hi guys,
i've a question for you..
i've created a datatable with jsf that is composed by input fields and
5 columns,that are linked with 5 backing bean properties and
everythings it's ok.
Now i have to add a casual number of columns to my datatable,depending
by a number that user insert in a precedent page.
Suppose the number is n,can someone show me some code to do it?
This is my jsp page
<h:dataTable
value="#{biosamplesTable.biosamples}"
var="biosampleItem"
binding="#{biosamplesTable.biosampleDataTable}" border="3"
bgcolor="pink" >

without showing you the input fields...
the number of rows is decided by user and biosamples list come from
public void loadBiosamples() throws Exception {

for (int i = 0; i < nrows; i++) {
Biosample biosample = new Biosample();
biosamples.add(biosample);
setBiosamples(biosamples);
}

What i want to know is how adding dynamically 3 columns if 3 is
inserted by user?
Please help me with code,i'm inexpert...
i've read how use UIInput and valuebinding for creating a dynamic
table,but now i want to add a dynamic part to a datatable
existing...please help me
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,734
Messages
2,569,441
Members
44,832
Latest member
GlennSmall

Latest Threads

Top