on 11-26-2010 11:53 AM
HI....
Am Fresher to WebDynpro java....... I dont know how to handle the null pointer exception Even if there are no rows in the table or if there are any,when we click on the remove button then null pointer exception shouldn't occur.How to Handle this type of problem??...
plz help me in this regard....
Edited by: Venkat5939 on Nov 26, 2010 1:39 PM
Hi,
Try it by changing the cardinality of your node that is binded with table.
Hope it will work.
Regards,
Saurabh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Use try Catch in the remove button event.
Put your remove code in that try block.
if you are trying to remove all the lines in the table, the use:
wdContext.nodeTable().invalidate();
if you are removeing one element at a time, use:
int index = wdContext.nodeTable().getLeadSelection();
wdContext.nodeTable().removeElemenAt(index);
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Venkat,
If you try to delete a row from the table using current element of the table node when the table is empty, It would throw the NullPointer exception. Also when there are N number of rows and no one was lead selected, there you will get the same exception.
Kindly modify your code with some validation logics or implement a Try Catch block to handle exceptions.
Regards
Karthik
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Venkat
Try to change the cardinality of node from o..n to 1..n and chekc the application
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.