Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
how to programmatically access the value of this widget
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  9 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
tong123123  
View profile  
 More options Apr 14 2012, 10:17 am
From: tong123123 <tong123...@gmail.com>
Date: Sat, 14 Apr 2012 07:17:36 -0700 (PDT)
Local: Sat, Apr 14 2012 10:17 am
Subject: how to programmatically access the value of this widget

as shown in the attached image, if I want to access the value of the
textbox with value "value2" (the textbox in the second row after the "add"
button"), how to do it as seem there is no a specific name to access it.

the code is as follow:

and the implementation of  CompositePanel is as follow:

maybe my design is poor, any better method suggested?
in reality, the listbox is used for user select "searc field", and the
textbox is for user enter search value for that search field.

  ha_1.JPG
109K Download

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Alfredo Quiroga-Villamil  
View profile  
 More options Apr 14 2012, 10:31 am
From: Alfredo Quiroga-Villamil <laww...@gmail.com>
Date: Sat, 14 Apr 2012 10:31:50 -0400
Local: Sat, Apr 14 2012 10:31 am
Subject: Re: how to programmatically access the value of this widget

In CompositePanel expose a getter for your texbox and then invoke
getValue() on it?

Best regards,

Alfredo

--
Alfredo Quiroga-Villamil

AOL/Yahoo/Gmail/MSN IM:  lawwton


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jens  
View profile  
 More options Apr 14 2012, 10:36 am
From: Jens <jens.nehlme...@gmail.com>
Date: Sat, 14 Apr 2012 07:36:21 -0700 (PDT)
Local: Sat, Apr 14 2012 10:36 am
Subject: Re: how to programmatically access the value of this widget

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 like.

-- J.

Am Samstag, 14. April 2012 16:17:36 UTC+2 schrieb tong123123:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
tong123123  
View profile  
 More options Apr 14 2012, 11:06 am
From: tong123123 <tong123...@gmail.com>
Date: Sat, 14 Apr 2012 08:06:08 -0700 (PDT)
Local: Sat, Apr 14 2012 11:06 am
Subject: Re: how to programmatically access the value of this widget

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 handler its name is
compositePanel.

Jens於 2012年4月14日星期六UTC+8下午10時36分21秒寫道:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jens  
View profile  
 More options Apr 14 2012, 11:13 am
From: Jens <jens.nehlme...@gmail.com>
Date: Sat, 14 Apr 2012 08:13:39 -0700 (PDT)
Local: Sat, Apr 14 2012 11:13 am
Subject: Re: how to programmatically access the value of this widget

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 schrieb tong123123:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Thomas Broyer  
View profile  
 More options Apr 14 2012, 11:18 am
From: Thomas Broyer <t.bro...@gmail.com>
Date: Sat, 14 Apr 2012 08:18:18 -0700 (PDT)
Local: Sat, Apr 14 2012 11:18 am
Subject: Re: how to programmatically access the value of this widget

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 to get the value.

In other words: variables are a mean to give name to things; fields are
just variables with a distinct scope (object instance instead of local to a
block or method). If you need/want names for things, it's up to you to give
them such a name.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
tong123123  
View profile  
 More options Apr 14 2012, 11:38 am
From: tong123123 <tong123...@gmail.com>
Date: Sat, 14 Apr 2012 08:38:50 -0700 (PDT)
Local: Sat, Apr 14 2012 11:38 am
Subject: Re: how to programmatically access the value of this widget

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於 2012年4月14日星期六UTC+8下午11時18分18秒寫道:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
tong123123  
View profile  
 More options Apr 14 2012, 11:48 am
From: tong123123 <tong123...@gmail.com>
Date: Sat, 14 Apr 2012 08:48:21 -0700 (PDT)
Local: Sat, Apr 14 2012 11:48 am
Subject: Re: how to programmatically access the value of this widget

thanks, now my implementation is

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?

I see this forum attachment page, it has a delete link after the browse
button of each attachment row, but I have no idea how could this be
implemented in my case?

Jens於 2012年4月14日星期六UTC+8下午11時13分39秒寫道:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jens  
View profile  
 More options Apr 14 2012, 12:05 pm
From: Jens <jens.nehlme...@gmail.com>
Date: Sat, 14 Apr 2012 09:05:39 -0700 (PDT)
Local: Sat, Apr 14 2012 12:05 pm
Subject: Re: how to programmatically access the value of this widget

> 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?

If you add a Button to each composite panel you can call
CompositePanel.removeFromParent() to delete itself from the view.
If you add a CheckBox in each composite panel and a single delete Button in
HATestPanel you first have to find all composite panels (same loop as for
your submit button) which are checked for deletion (implement a isChecked()
method in CompositePanel) before calling removeFromParent() on them.

Its up to you.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »