the code is really simple: RootPanel rootPanel = RootPanel.get("content"); HorizontalPanel horizontalPanel = new HorizontalPanel(); horizontalPanel.setSpacing(50); rootPanel.add(horizontalPanel); final FlexTable flexTable = new FlexTable(); flexTable.setCellPadding(5); flexTable.setCellSpacing(5); flexTable.setStyleName("table"); horizontalPanel.add(flexTable);
flexTable.setText(0, 0, "05:00"); flexTable.setText(0, 1, "CP1"); flexTable.setText(0, 2, "CP2"); flexTable.getFlexCellFormatter().setRowSpan(0, 1, 2); flexTable.getFlexCellFormatter().setRowSpan(0, 2, 3); flexTable.setText(1, 0, "06:00"); flexTable.setText(2, 0, "07:00"); flexTable.setText(2, 1, "CP3"); flexTable.setText(3, 0, "08:00"); flexTable.setText(3, 1, ""); flexTable.setText(3, 2, "CP4"); flexTable.setText(4, 0, "09:00"); flexTable.setText(4, 1, ""); flexTable.setText(4, 2, ""); flexTable.setText(5, 0, "10:00"); flexTable.setText(5, 1, ""); flexTable.setText(5, 2, ""); flexTable.setText(6, 0, "11:00"); flexTable.setText(6, 1, ""); flexTable.setText(6, 2, ""); flexTable.setText(7, 0, "12:00"); flexTable.setText(7, 1, ""); flexTable.setText(7, 2, ""); flexTable.setText(8, 0, "13:00"); flexTable.setText(8, 1, ""); flexTable.setText(8, 2, ""); final FlexTable flexTable_1 = new FlexTable(); flexTable_1.setCellPadding(5); flexTable_1.setCellSpacing(5); flexTable_1.setStyleName("table"); horizontalPanel.add(flexTable_1); flexTable_1.setText(0, 0, "CP5"); flexTable_1.setText(0, 1, "3"); flexTable_1.setWidget(0, 2, new RadioButton("prog")); flexTable_1.setText(1, 0, "CP6"); flexTable_1.setText(1, 1, "2"); flexTable_1.setWidget(1, 2, new RadioButton("prog")); flexTable_1.setText(2, 0, "CP7"); flexTable_1.setText(2, 1, "1"); flexTable_1.setWidget(2, 2, new RadioButton("prog")); rootPanel.add(horizontalPanel); // Sposta flexTable.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { // Trovo il radio checkato int i=0; RadioButton rb; do{ rb = (RadioButton) flexTable_1.getWidget(i, 2); i++; }while (!rb.getValue() && i < flexTable_1.getRowCount()); // Devo decrementare i di 1 i--; if(i<flexTable_1.getRowCount()) { // C'è qualcosa di selezionato e quindi posso spostare // Riga e colonna in cui spostare int r = flexTable.getCellForEvent(event).getRowIndex(); int c = flexTable.getCellForEvent(event).getCellIndex(); // // Se nella riga colonna selezionata non c'è nulla copio diretto if(flexTable.getText(r, c).equals("")) { flexTable.setText(r, c, flexTable_1.getText(i, 0)); } else { // Salvo tutti gli indici per poterli utilizzare negli Handler final int r_app = r; final int c_app = c; final int i_app = i; /// final DialogBox adv = new DialogBox(); adv.setText("Avviso"); VerticalPanel b = new VerticalPanel(); Label l = new Label(flexTable.getText(r, c) + " " + "la vuoi mettere prima o dopo "+ flexTable_1.getText(i, 0)); Button b_prima = new Button("Prima"); Button b_dopo = new Button("Dopo"); Button b_chiudi = new Button("Chiudi"); b_chiudi.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { adv.clear(); adv.hide(); } }); // PRIMA b_prima.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { adv.clear(); adv.hide(); flexTable.setText(r_app+1, c_app, flexTable_1.getText(i_app, 0)); // Ricavo il RowSpan (durata della fase) int rs = Integer.valueOf(flexTable_1.getText(i_app, 1)); flexTable.getFlexCellFormatter().setRowSpan(r_app+1, c_app, rs); } }); /// // DOPO b_dopo.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { adv.clear(); adv.hide(); // Prima salvo la CP da spostare String s = flexTable.getText(r_app, c_app); // Poi scrivo la nuova CP e setto il RowSpan flexTable.setText(r_app, c_app, flexTable_1.getText(i_app, 0)); // Ricavo il RowSpan (durata della fase) int rs = Integer.valueOf(flexTable_1.getText(i_app, 1)); flexTable.getFlexCellFormatter().setRowSpan(r_app, c_app, rs); // Riscrivo la vecchia CP spostata in avanti tanto quanto il rowSpan flexTable.setText(r_app+rs, c_app, s); } }); // b.add(l); b.add(b_prima); b.add(b_dopo); b.add(b_chiudi); adv.add(b); adv.center(); adv.show(); } } } }); On Mon, Feb 17, 2014 at 12:10 AM, Jens <jens.nehlme...@gmail.com> wrote: > Maybe your column index is off by one while generating the table and later > when adding your second text to column 0 results in column 0 to be created. > > Can you provide code? > > -- J. > > -- > You received this message because you are subscribed to the Google Groups > "Google Web Toolkit" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to google-web-toolkit+unsubscr...@googlegroups.com. > To post to this group, send email to google-web-toolkit@googlegroups.com. > Visit this group at http://groups.google.com/group/google-web-toolkit. > For more options, visit https://groups.google.com/groups/opt_out. > -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscr...@googlegroups.com. To post to this group, send email to google-web-toolkit@googlegroups.com. Visit this group at http://groups.google.com/group/google-web-toolkit. For more options, visit https://groups.google.com/groups/opt_out.