Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6579745
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T15:56:11+00:00 2026-05-25T15:56:11+00:00

I have a Vertiacal panel object and This object contains many radiobuttons So can

  • 0

I have a Vertiacal panel object and This object contains many radiobuttons

So can i get those radioButton objects through Vertiacal panel object.

Maybe via iteration or ?

private void initCourse() {
    coursePopupPanel.clear();
    VerticalPanel verticalPanel = new VerticalPanel();
    coursePopupPanel.setWidget(verticalPanel);
    JsArray<JCourse> jCourseArray = JCourse.getList(stringMainData);
    for (int i = 0; i < jCourseArray.length(); i++) {
        final RadioButton courseRadioButton = new RadioButton("course");
        courseRadioButton.setText(jCourseArray.get(i).getName());
        courseRadioButton.getElement().setId(jCourseArray.get(i).getView());
        verticalPanel.add(courseRadioButton);

        //handler of course radio buttons
        courseRadioButton.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent event) {
            }
        });
    }
}

I have a reference to coursePopupPanel. but i have not reference to vertical panel, so can i get elements of vertical panel sonce holding reference to coursePopupPanel.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T15:56:12+00:00Added an answer on May 25, 2026 at 3:56 pm

    A GWT VerticalPanel is a subclass of ComplexPanel, an abstract class for Panels that contain more than one child widget. In ComplexPanel (and so inherited by VerticalPanel) are methods for getting the number of child widgets, getting references to them by index, and so on. You could build an iterator something like this:

    Iterator<Widget> vPanelWidgets = myVerticalPanel.iterator();
    while (vPanelWidgets.hasNext()){
      Widget childWidget = vPanelWidgets.next();
      if (childWidget instanceof RadioButton) {
        ...do stuff
      }
    }
    

    I tend not to query a widget for its members. That ties me to the decisions I made about how to display the RadioButtons, following your example. What if you decide later to display your radio buttons in the cells of a FlexTable in order to control vertical and horizontal arrangement? To make that change means your widget iterator won’t work. FlexTable is a Panel but not a ComplexPanel. The code I wrote above won’t work if you decide to replace the VerticalPanel with a FlexTable.

    If was to take something like this approach, I would keep my lists of related widgets (like a group of RadioButtons) in some sort of Java Collection. I pass that Collection to my presentation class, and inside there I write the code to do the layout. Usually that’s a UiBinder class, with “@UiField(provided = true)” for these RadioButtons. The code in the presenter then associates the RadioButton elements of the Collection I passed in to the UiField placeholders for the RadioButtons in the UiBinder layout. So all my layout decisions are actually in the UiBinder xml file. If I decide to rip out my Vertical Panel and replace it with a FlexTable, I might not have to touch a single line of Java code, assuming I separated things out correctly.

    [Actually, I would probably keep my decision to use RadioButtons inside the presentation layer, and inside the XML file in particular. That presentation class would fire a message on the EventBus to indicate the user had made a selection via a RadioButton ValueChangeHandler, and I wouldn’t care if I used RadioButtons in a VerticalPanel or ToggleButtons in a FlexTable.]

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have seen many people placing table inside a panel like this one. What
I have an mxml panel in which I'm using a repeater. The panel can
I have one update panel inside which I have datalist. This update panel triggers
I am trying to get a multi-page two-dimensional lattice panel plot to have the
I have this code: import wx class Plugin(wx.Panel): def __init__(self, parent, *args, **kwargs): panel
I have a main canvas 'blackboard' in a panel, this canvas has itself several
I have a panel with flow layout, and it can contain a variable number
Given this little fiddle: http://jsfiddle.net/5Sw3h/8/ I have a navigation panel to the left, a
I have managed to serialize my very basic GUI-object containing a JTextArea and a
I have a ItemsControl with a collection of objects. I wan't to be able

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.