Re: how to programmatically access the value of this widget

2012-04-14 Thread Alfredo Quiroga-Villamil
In CompositePanel expose a getter for your texbox and then invoke getValue() on it? Best regards, Alfredo On Sat, Apr 14, 2012 at 10:17 AM, tong123123 tong123...@gmail.com wrote: as shown in the attached image, if I want to access the value of the textbox with value value2 (the textbox in

Re: how to programmatically access the value of this widget

2012-04-14 Thread Jens
Store your widgets in fields and add getter/setter methods so you can access their data. Also in your ClickHandler instead of: ((HATestPanel)((Button) event.getSource()).getParent()).add(compositePanel); you can simply do add(compositePanel) or HATextPanel.this.add(compositePanel) if you

Re: how to programmatically access the value of this widget

2012-04-14 Thread tong123123
I think you mean add a getter and setter in CompositePanel, but the problem is how to access it in HATestPanel? as I don't know the variable name of each CompositePanel. just like I click the button three times, then what is the variaible name of these 3 compositePanel? although in each click

Re: how to programmatically access the value of this widget

2012-04-14 Thread Jens
Store them in a separate list or iterate through all child widgets of your HATestPanel using FlowPanel.getWidgetCount() and FlowPanel.getWidget(int index). For each widget check if its a CompositePanel, cast it and call its getter to get the value. Am Samstag, 14. April 2012 17:06:08 UTC+2

Re: how to programmatically access the value of this widget

2012-04-14 Thread Thomas Broyer
On Saturday, April 14, 2012 5:13:39 PM UTC+2, Jens wrote: Store them in a separate list or iterate through all child widgets of your HATestPanel using FlowPanel.getWidgetCount() and FlowPanel.getWidget(int index). For each widget check if its a CompositePanel, cast it and call its getter

Re: how to programmatically access the value of this widget

2012-04-14 Thread tong123123
Sorry, I cannot catch your idea, in my clickhandler, the variable name is compositePanel for each click, and then add to the flowpanel, but if I press the add button three time and then outside the add button, how to refer the name of these three compositePanel? Thomas Broyeræ–¼

Re: how to programmatically access the value of this widget

2012-04-14 Thread tong123123
thanks, now my implementation is public class HATestPanel extends FlowPanel{ Button btnAdd = new Button(Add); Button btnListWidget = new Button(submit); public void onLoad(){ this.add(btnAdd); this.add(btnListWidget); btnAdd.addClickHandler(new ClickHandler(){

Re: how to programmatically access the value of this widget

2012-04-14 Thread Jens
But there is still some problem, if I want to add a delete button after each row, is it very difficult?Or the easier method is add a checkbox before the listbox in class CompositePanel and then add a delete button (one and only one for the HATestPanel, not per row) to the HATestPanel?