private
void showPMCommentUI(){
String compId =
null;String user =
null;String selectedComp = Document.get().getElementById(
"loadCommentUI").getInnerText();Document.get().getElementById(
"loadCommentUI").setInnerText(""); if( selectedComp.indexOf(':') != -1 ){
user = selectedComp.substring(0, selectedComp.indexOf(
':')- 1);}
compId = selectedComp.substring(selectedComp.indexOf(
':') + 2);String compName =
null; if( compId != null && compId.trim().length() > 0 ){
compName = Document.get().getElementById(
"c2").getFirstChildElement().getFirstChildElement().getFirstChild().getNodeValue();}
dialogbox = new DialogBox();Panel panel =
new Panel();panel.setStyleName(
"main-panel");panel.setHeader(
true);panel.setTitle(
" Comment on -"+ model +"/"+ compName);MessageBox.alert(
"Manish 111"); final RichTextArea rta = new RichTextArea();panel.add(rta,
new BorderLayoutData(RegionPosition.CENTER));com.gwtext.client.widgets.Button saveCommentBut =
new com.gwtext.client.widgets.Button("Save"); final String authenticatedUser = user; final String selectedModelCompId = compId; final String selectedModelCompName = compName;MessageBox.alert(
"Manish 222");Panel bttnPanel =
new Panel();saveCommentBut.addListener(
new ButtonListenerAdapter(){
public void onClick(com.gwtext.client.widgets.Button button, EventObject e) { try{
String commentText = rta.getText();
saveComment(authenticatedUser,
model,selectedModelCompId,selectedModelCompName,commentText != null? commentText.trim():commentText , modelDir);}
catch(RequestException re){
MessageBox.alert(re.getMessage());
}
}
});
bttnPanel.addButton(saveCommentBut);
MessageBox.alert(
"Manish 333");com.gwtext.client.widgets.Button cancelCommentBut =
new com.gwtext.client.widgets.Button("Cancel");cancelCommentBut.addListener(
new ButtonListenerAdapter(){
public void onClick(com.gwtext.client.widgets.Button button, EventObject e){
dialogbox.clear(); dialogbox.hide();}
});
bttnPanel.addButton(cancelCommentBut);
MessageBox.alert(
"Manish 444");panel.add(bttnPanel,
new BorderLayoutData(RegionPosition.EAST));MessageBox.alert(
"Manish 555"); dialogbox.setAutoHideEnabled(false); dialogbox.setModal(true); dialogbox.setWidget( panel); dialogbox.show();MessageBox.alert(
"Manish 666");}