0
votes

I have a project showing comments database
I put the comments in FlexTable TabelKomen and I put the text in HTML format like this:

private static final int y=1;

public void UpdateTabelKomen(JsArray str){ 
 for(int i=0; i str.length(); i++){     
  UpdateTabelKomen(str.get(i)); 
}
}

public void UpdateTabelKomen(ImageDetailData str){
   TabelKomen.setWidget(y, 0, new HTML(str.getmember + "'s comment :" + str.getkomen()));
   TabelKomen.getFlexCellFormatter().setWordWrap(y, 0, true);
   y++;
}

The data was shown, but my text comment is not word wraped and make my flex table wider. Of course that will ruin my web appearance.
I change new HTML with new ScrolPanel(new HTML) seems not working.
so
How can I Format my FlexTable? is there any option beside flextable or scrollpanel?

2
You haven't accepted any answers yet. Perhaps you could go back to your pervious questions and accept the answer that solved your problem. Then you might find that more people will be interested in answering your questions.Mark Byers
ow.. I already check accept. I just know that now. tyuser315196

2 Answers

1
votes

well, looks like that a silly question. its not wrapped because my string is wkwkwkwk.... with no space. its already auto wordwrapped in the flextable. hahah! thanks anyway.

0
votes

Is it possible that y has the wrong value here? A better way to do this is to get rid of the variable y and use FlexTable#getRowCount, like so:

public void UpdateTabelKomen(ImageDetailData str){
   int row = TableKomen.getRowCount();
   TabelKomen.setWidget(row, 0, new HTML(str.getmember + "'s comment :" + str.getkomen()));
   TabelKomen.getFlexCellFormatter().setWordWrap(row, 0, true);
}