Without your help i have to renounce.............

G

gbattine

Hi guys,
i've a question for you for a problem that i have in my jsf application
from 10 day and i'm trying to solve it but nothing....please help me.
I'm using 2 nested datatables as described in BalusC article.
I need using them for input fields,so i have a command button at the
end of each row.
My jsp page is

<h:dataTable
value="#{biosamplesTable.outerList}"
var="outerItem"
binding="#{biosamplesTable.outerDataTable}"
cellpadding="5" border="3" cellspacing="5">
<h:column>
<h:inputText value="#{outerItem.name}" />
</h:column>

<h:column>
<h:inputText value="#{outerItem.value}" />
</h:column>

<h:column>
<h:dataTable
value="#{biosamplesTable.innerList}"
var="innerItem"
<h:column>
<h:inputText value="#{innerItem.nam}" />
</h:column>

<h:column>
<h:inputText value="#{innerItem.valor}" />
</h:column>
</h:dataTable>
</h:column>
<h:column>
<f:facet name="header">
<h:eek:utputText value="Actions" />
</f:facet>
<h:commandButton value="Invia"
actionListener="#{biosamplesTable.send}"/>
</h:column>

</h:dataTable

and i've one InnerListMap that maps the index of outerList with the
right innerList.
My problem is that i'm not able to pass the values inserted from user
to innerList,that have ever null values,while outerList go well.
This is my loadInnerListMap

public void loadInnerListMap() {
for (Iterator iter = outerList.iterator(); iter.hasNext();) {
MyData outerItem = (MyData) iter.next();
List innerList = new ArrayList();
MyData2 mydata=new MyData2();
mydata.setNam("italy");
mydata.setValor("naples");
innerList.add(mydata);
innerList.add(new MyData2());
innerList.add(new MyData2());
innerListMap.put(outerItem.getId(), innerList);
}
}



with this code i set the value for the first row of each innerlist and
it goes well...for the second and third row i pass null values and i'm
not able to pass user'values.
This is my send action


public void send(ActionEvent e) throws Exception{
System.out.println("Il numero di lista passatoè "+ident);
List innerListNew = (List) innerListMap.get(((MyData)
outerDataTable.getRowData()).getId());

for (int i=0;i<innerListNew.size();i++){
System.out.println("Il nome dell'elemento è "+((MyData2)
innerListNew.get(i)).getNam());
System.out.println("Il nome dell'valore è "+((MyData2)
innerListNew.get(i)).getValor());
}

myDataItem = (MyData) getOuterDataTable().getRowData();
if (conn != null) {
PreparedStatement pst2 = null;
pst2 = conn.prepareStatement("INSERT INTO esterna(nome,valore)
values(?,?)");

pst2.setString(1, myDataItem.getName());
pst2.setString(2, myDataItem.getValue());
pst2.executeUpdate();
}
}



with this send method i send correctly outerList values to db table.
Can someone help me passing the right values from user to innerList and
from innerList to db table?
Please help me,i'm crazying and i need to go on....>
 
G

gbattine

thanks for your availability...
people like you aren't needed in this forum
PofN ha scritto:
 
R

Rhino

PofN said:
http://mcdonalds.it/lavoro/index.asp

Call them for your next job. Your current one is over your head.

I'm afraid I have to concur. gbattine has been posting several times a day
most days for the last few months, always seeming to need help with
something on his current project. We all need help from time to time but if
I had to ask for help that often, I'd seriously question my own competence
to do the job they're paying me to do.
 

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

No members online now.

Forum statistics

Threads
473,968
Messages
2,570,154
Members
46,702
Latest member
LukasConde

Latest Threads

Top