Getting Widgets in a panel is a nice way to interact with widgets you make. You can add several widgets into a panel, and get all of them by looping through the widgets in the panel. I make a specific panel to put all my reminder widgets in. Then I gather data and use it elsewhere.
/**
* get my reminders
* @return ReminderData
*/
private ReminderData[] getReminderData() {//count my reminders i have in the verticalpanel pReminder
int count = pReminder.getWidgetCount();//I use ReminderData object to transport my data around
ReminderData[] reminderData = new ReminderData[count];//loop through my ReminderWidget(s) in the pReminderPanel
for (int i=0; i < count; i++) {//cast the widget to my ReminderWidget
ReminderWidget rw = (ReminderWidget) pReminder.getWidget(i);//I use a method to gather up the values in the reminder Widget
reminderData[i] = rw.getReminderData();
}//then I return the values to the next object, and then to rpc
return reminderData;
}
Add A Comment
You must be logged in to post a comment.
