cancel
Showing results for 
Search instead for 
Did you mean: 

how to clear the fields

Former Member
0 Kudos

hello everybody,

i had created one view with some elements to insert into the database. when i click on SAVE button, it is inserting. but the data in the view is still remaining.

i wanted to clear those fields after saving..

how to do that.

Accepted Solutions (0)

Answers (4)

Answers (4)

brahmanandam_ausali
Participant
0 Kudos

hi sunil.

u can clear the fields in the view.

after saving into the data base write the following code.

if u want to clear all the fields in the view(ie total context)

wdcontext.invalidate();

in u want to clear one particular node write,

wdcontext.node<urnode>.invalidate();

bye.

brahmanandam ausali

Former Member
0 Kudos

hi sunil

on the on action save button

after saving it to the database

give the following code

set the corresponding attributes to null.

wdcontext.currentcontextelement.set<attribute name>(null);

regards

saravana

Former Member
0 Kudos

hi

in the onaction of ur save button give the code

wdContext.currentcontextelement.set<attributename>("");

Regards

Rathna.

vijayakhanna_raman
Active Contributor
0 Kudos

Hi ,

just use this code in ur save button action handler , this will clear the field after entered in to the database and will ready for the next set of data.

String password=wdContext.currentContextElement().getpwd();

try{

InitialContext ctx=new InitialContext();

DataSource ds=(DataSource)ctx.lookup("jdbc/SAPJ2EDB");

Connection con=ds.getConnection();

con.setAutoCommit(false);

Statement stmt=con.createStatement();

int retIns = stmt.executeUpdate("insert into TMP_NEWUSERDETAIL(PASSWORD) values("password")");

con.commit();

con.setAutoCommit(true);

wdContext.currentContextElement().setpwd(null);

}

or use a seperate button to clear the field.

wdContext.currentContextElement().set<Attributename>(null);

Regards

Vijayakhanna Raman