cancel
Showing results for 
Search instead for 
Did you mean: 

Table cell in web dynpro java

Former Member
0 Kudos

Hi,

     Is there any event for table cell. I meant, I have table fields (sunday, monday,tuesday...saturday and finally totals field). My requirement is when I enter some data (say 10 hours) in sunday cell and moved to monday cell , it should update totals field with 10 automatically. Subsequently when I enter 8 hours in monday field and moved to tuesday field, totals field should be updated with 20. Is there any code for that?

Thanks and Regards,

Teja.

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member191044
Active Contributor
0 Kudos

This is quite easy. I assume you habe basic WD4J know how. On your tableCellEditor you can choose "Events" and create one for "onChange". This action will be triggered every time you change the value. There you can implement the easy addition of the the cells and set it for the sum cell.

Former Member
0 Kudos

Hi Tobias,

     Thanks for your reply. But we have created this table dynamically. How can we do the same with dynamically created table.

Thanks and Regards,

Teja

former_member191044
Active Contributor
0 Kudos

Just set the action on your dynamically created tableCellEditor-Element:


// Input1 is the element you use as tableCellEditor

IWDInputField input1 = view.createElement(IWDInputField.class, "tableInput1");

// Set your action. In your case your calculation action

input1.setOnChange(wdThis.wdGetCalculateSumAction());

Best Regards,

Tobias

junwu
Active Contributor
0 Kudos

maybe you can bind it to calculated attribute