Using input widgets for Calculation (Arithemetical Calculations)

How can i do this

i followed this tutorial

i have been able to create a custom widget for calculations works fine , but i want to have the same like thing in an input widget (Have the two input widgets use something like a javascript expression to calculate)
It should calculate and give the results in a third input box (Editbox)

Pre-populated Form Input

Hello All,

It's very clear how to read complex data in a form and send it back to the activity in the server.

But how do I pre-fill a complex Input object so I have default data in the form?

Thank you.