Re: getting the current row count from the button

2010-07-05 Thread nasionalem
Hello Rashmi,

Thanks alot, your code works successful.. :)
Thank you so much..

On Jul 3, 7:02 am, Rashmi guptara...@gmail.com wrote:
 Below is the code for ClickHandler I have written for removing a row.
 The button is placed in each row in the FlexTable and removes that
 particular row.

         public class RemoveRowButtonClickHandler implements ClickHandler {
                 @Override
                 public void onClick(ClickEvent event) {
                 Cell cell = flexTable.getCellForEvent(event);
                 if(cell != null) {
                         removeRow(cell.getRowIndex());
                 }

                 }
         }

 On Jul 2, 5:52 pm, nasionalem sakarya.me...@gmail.com wrote:



  Hello,

  I have a simple problem. I am using GWT 2.0 and I need help.
  I add a row with a button in FlexTable. The button should remove the
  row when click.
  But I didnt get current current row count..

  private void addItem() {

  // Add a button to remove this Item from the table.
  final int itemRowCount = testFlexTable.getRowCount();
  final Button removeStockButton = new Button(x);
  removeStockButton.addStyleDependentName(remove);
  removeStockButton.setTabIndex(itemRowCount);

  removeStockButton.addClickHandler(new ClickHandler() {
         public void onClick(ClickEvent event) {
          int removedIndex = // ** I should get the current current row
  count here ***
          testFlexTable.removeRow(removedIndex);
          }});

  testFlexTable.setText(itemRowCount, 0, Test + itemRowCount);
  testFlexTable.setWidget(itemRowCount, 1, removeStockButton);}- Hide quoted 
  text -

 - Show quoted text -

-- 
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-tool...@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.



Re: getting the current row count from the button

2010-07-05 Thread Merih


Hello all,

I've created  a new Vertical Panel and I've added it in East Edge.
Than I put the FlexTable in the Vertical Panel. But I still didnt
align it on right side. I still cant change the position.. :(


private DockLayoutPanel p = new DockLayoutPanel(Unit.EM);
private VerticalPanel vPanel = new VerticalPanel();
private FlexTable testFlexTable = new FlexTable();


p.addNorth(new HTML(north), 5);
p.addSouth(new HTML(south), 2);
p.addEast(vPanel,40);
p.addWest(new HTML(west));
p.add(new HTML(center));


testFlexTable.setText(0, 0, Symbol);
testFlexTable.setText(0, 1, Price);
testFlexTable.setText(0, 2, Change);
testFlexTable.setText(0, 3, Remove);


// I have tried to set the position of the Vertical Panel. But It
didnt worked. It is still left side..

vPanel.add(testFlexTable);
vPanel.setHorizontalAlignment(HasAlignment.ALIGN_RIGHT);
vPanel.setCellHorizontalAlignment(testFlexTable,
HasAlignment.ALIGN_RIGHT);


any idea?

-- 
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-tool...@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.



getting the current row count from the button

2010-07-02 Thread nasionalem
Hello,

I have a simple problem. I am using GWT 2.0 and I need help.
I add a row with a button in FlexTable. The button should remove the
row when click.
But I didnt get current current row count..

private void addItem() {

// Add a button to remove this Item from the table.
final int itemRowCount = testFlexTable.getRowCount();
final Button removeStockButton = new Button(x);
removeStockButton.addStyleDependentName(remove);
removeStockButton.setTabIndex(itemRowCount);

removeStockButton.addClickHandler(new ClickHandler() {
   public void onClick(ClickEvent event) {
int removedIndex = // ** I should get the current current row
count here ***
testFlexTable.removeRow(removedIndex);
}
});
testFlexTable.setText(itemRowCount, 0, Test + itemRowCount);
testFlexTable.setWidget(itemRowCount, 1, removeStockButton);

}

-- 
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-tool...@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.



Re: getting the current row count from the button

2010-07-02 Thread Rashmi
Below is the code for ClickHandler I have written for removing a row.
The button is placed in each row in the FlexTable and removes that
particular row.

public class RemoveRowButtonClickHandler implements ClickHandler {
@Override
public void onClick(ClickEvent event) {
Cell cell = flexTable.getCellForEvent(event);
if(cell != null) {
removeRow(cell.getRowIndex());
}

}
}

On Jul 2, 5:52 pm, nasionalem sakarya.me...@gmail.com wrote:
 Hello,

 I have a simple problem. I am using GWT 2.0 and I need help.
 I add a row with a button in FlexTable. The button should remove the
 row when click.
 But I didnt get current current row count..

 private void addItem() {

 // Add a button to remove this Item from the table.
 final int itemRowCount = testFlexTable.getRowCount();
 final Button removeStockButton = new Button(x);
 removeStockButton.addStyleDependentName(remove);
 removeStockButton.setTabIndex(itemRowCount);

 removeStockButton.addClickHandler(new ClickHandler() {
        public void onClick(ClickEvent event) {
         int removedIndex = // ** I should get the current current row
 count here ***
         testFlexTable.removeRow(removedIndex);
         }});

 testFlexTable.setText(itemRowCount, 0, Test + itemRowCount);
 testFlexTable.setWidget(itemRowCount, 1, removeStockButton);}

-- 
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-tool...@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.