Add setData method to form class.