G
gbattine
Hi guys,
i've a great problem with JSF application and i'm not able to go on.
I've defined a datatable and it works fine.
I have an edit link that clicked allow user to edit fields in another
page.
I want to know if
1) Does exists a method for showing datatable giving immediately
possibility to user to modify fields, whitout press edit botton?
Can you say me how can i do it?
2) i'm trying to working this save method, to save an edited row but it
performs navigation but not update values
public String saveUser(){
try{
UsersTable table=new UsersTable();
table.getUserItem();
DataSource dataSource=Singleton.getInstance().getDataSource();
Connection conn=dataSource.getConnection();
if (conn != null) {
PreparedStatement pst = null;
pst = conn.prepareStatement("UPDATE utente set
username="+userItem.login+"password="+userItem.password+"nomegruppo="+userItem.teamname+"tipo="+userItem.role+"nome="+userItem.firstName+"cognome="+userItem.lastName+"citta="+userItem.city+"datanascita="+userItem.date+"indirizzo="+userItem.address+"professione="+userItem.profession+"email="+userItem.email);
pst.executeUpdate();
pst.close();
conn.close();
}
}
catch(Exception e){};
return "ok";
}
Can you help me?
I'm bit confused...
i've a great problem with JSF application and i'm not able to go on.
I've defined a datatable and it works fine.
I have an edit link that clicked allow user to edit fields in another
page.
I want to know if
1) Does exists a method for showing datatable giving immediately
possibility to user to modify fields, whitout press edit botton?
Can you say me how can i do it?
2) i'm trying to working this save method, to save an edited row but it
performs navigation but not update values
public String saveUser(){
try{
UsersTable table=new UsersTable();
table.getUserItem();
DataSource dataSource=Singleton.getInstance().getDataSource();
Connection conn=dataSource.getConnection();
if (conn != null) {
PreparedStatement pst = null;
pst = conn.prepareStatement("UPDATE utente set
username="+userItem.login+"password="+userItem.password+"nomegruppo="+userItem.teamname+"tipo="+userItem.role+"nome="+userItem.firstName+"cognome="+userItem.lastName+"citta="+userItem.city+"datanascita="+userItem.date+"indirizzo="+userItem.address+"professione="+userItem.profession+"email="+userItem.email);
pst.executeUpdate();
pst.close();
conn.close();
}
}
catch(Exception e){};
return "ok";
}
Can you help me?
I'm bit confused...