-
24 Aug 2011 3:56 AM #1
Unanswered: Add widget in right side on ContentPanel
Unanswered: Add widget in right side on ContentPanel
HI Guys,
I want to add child widget (ContentPanel countPanel) in right side on ContentPanel. I tried float attribute but it's not working.
Any suggestion will help me a lot to do this job.
ContentPanel panel = new ContentPanel();
panel.setHeight(24);
panel.setHeaderVisible(false);
panel.setBodyBorder(false);
panel.setBorders(false);
panel.setLayout(new HBoxLayout());
TextField<String> searchField = new TextField<String>();
searchField.setHeight(24);
searchField.setWidth(75);
panel.add(searchField);
Label goButton = new Label("Go");
panel.add(goButton);
populateAlphanPanel(panel);
final ContentPanel countPanel = new ContentPanel();
countPanel.setHeight(24);
countPanel.setHeaderVisible(false);
countPanel.setBodyBorder(false);
countPanel.setBorders(false);
countPanel.setLayout(new FitLayout());
Label countLabel = new Label(getCountStr(0, 0, 0));
countLabel.setHeight(24);
countPanel.add(countLabel);
countPanel.setStyleAttribute("float", "right");
panel.add(countPanel);
RootPanel.get().add(panel);
In this example, I want to add countPanel in the right side of panel.
with warm regards,
Sunny.
-
24 Aug 2011 4:52 AM #2
I see you are using HBoxLayout. Here you can find examples of usage http://www.sencha.com/examples/#hboxlayout
You can add some flex Text first and then your countPanel to the main panel
Also you can use combinations of border layout and some other layout to add necessary panel to the eastCode:HBoxLayoutData flex = new HBoxLayoutData(new Margins(0, 5, 0, 0)); flex.setFlex(1); panel.add(new Text(), flex); panel.add(countPanel);
-
24 Aug 2011 8:10 AM #3
Add Widget in right side on ContentPanel
Add Widget in right side on ContentPanel
HI,
I tried BorderLayoutDate but it didn't work for me...
Please look this code :
BorderLayoutData borderBorderLayoutData = new BorderLayoutData(LayoutRegion.EAST);
panel.add(countPanel, borderBorderLayoutData);
RootPanel.get().add(panel);
-
24 Aug 2011 9:25 PM #4
Do you have this line?
Code:panel.setLayout(new BorderLayout());


Reply With Quote