I am attempting to limit the size of a FlexTable and its cell.
However, whenever an exceptionally large piece of text is added to the
cell, the table grows to accommodate this. Not a desirable action. I
want to limit the size of the table and have additional text be
displayed on following lines similar to as if I had newlines in the
text string.

Following the code that creates the main panel as well as the panels
added to the main panel. Note that an attempt is made to constrain the
width of the table (650 px) in the method and constrain the width of
the panel that contains the table in the .css (700 px).

Thanks for your help!

(Working with GWT 1.6)

------------------------------------------------------------------------------------------------------------------------------------------------------------------

private Panel createCommentsPanel() {
// create comments main panel
VerticalPanel mainCommentPanel = new VerticalPanel();
mainCommentPanel.setStyleName("mainCommentPanel");

Label commentsLabel = new Label("Comments:", false);
commentsLabel.setStyleName("createBuildLabel");

Label addCommentLabel = new Label("Add Comment:", false);
addCommentLabel.setStyleName("boldLabel90");


// comments table
String[] commentTypeHeaders = {"Comments" };
commentsTable = new FlexTable();
createFlexTable(commentsTable, commentTypeHeaders);
commentsTable.setWidth("650px");


// add button
VerticalPanel buttonPanel = new VerticalPanel();
buttonPanel.setStyleName("addCommentsButtonPanelPadding");
addCommentButton = new Button("Add Comment");
addCommentButton.setStyleName("addEditButtons");
addCommentButton.addClickHandler(this);

//call method to add the comments to the table
addCommentsToTable(buildModel.getCommentsList());

//add components to the panels
VerticalPanel Panel = new VerticalPanel();
Panel.setStyleName("commentsPanel1");
Panel.add(commentsTable);
Panel.add(addCommentButton);



mainCommentPanel.add(commentsLabel);
mainCommentPanel.add(Panel);
mainCommentPanel.add(buttonPanel);

return mainCommentPanel;

}


Following is the relevant .css

//the main panel that contains the labels and the panel that contains
the FlextTable. Width set to 100%
so as to be in sync with other panels of the application
.mainCommentPanel {
   border: 2px solid inset silver;
   width: 100%;
   height: 100%;
   background-color: #F0F0F0;
}



//the panel that contains the FlexTable. Note that the width is set to
700px (slightly larger than the flex table width setting)


.commentsPanel1 {
  padding-top: 10px;
  padding-left: 25px;
  padding-bottom: 15px;
  width: 700px;
  height: 100%;

}

//padding around the button. Can't see how this would affect the table
but including for completeness
.addCommentsButtonPanelPadding {
   padding-bottom:10px:
   padding-left: 25px;

}

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to