Editing a cell in Nat table - nattable

I have a Nat table with some data in it.I want to add a new row just after the selected cell.I was able to do it. Now I have to select the newly added cell(0,new rowPosition) and edit it too. Using the selectCellCommand I was able to select the cell but the problem is with editing the cell. when I try to get the cell from Nat table using the api getCellByPoition I get null. Now this happens when I have a scrollbar and few rows are hidden at the top.Selection layer works fine and selects the first cell of the newly added row but Nat table doesn't give me the cell for the same row position.How can I get the cell to edit it? I am firing the EditCellCommand for the specified rowposition and getting the cell editor from nat table using getActiveCellEditor method.

It seems you are not aware of the position-index transformations in NatTable. I suppose you try to access your object via index. But in scrolled state the position is not equal to the index.
Please read our getting started tutorial on this topic http://www.vogella.com/tutorials/NatTable/article.html#architecture_layers

Related

Saving Order on UITableView data

I have created a reorder-able UITableView. I am loading data from Realm, and showing that data into UITableView. My UITableView has Section and rows.
now User can hold Any cell in any section and can reorder them in 2 ways
User can reorder cell with in the same section.
User can reorder cell across the different section.
What I need:
Once the user has made the order he should see same item in same order
when he come back to App. For any type of reordering I have to do
indexing. But I do not have clue how to reorder them in database.
My Idea to resolve the requirement
My idea is to include the String type value in the Model where I can replace something like (1,10) that will indicate section 1, row 10.
But I do not have idea how to tackle this and how to save the reordering as i need here. Any idea about that?? please share

Testing not visible rows in ui-grid with protractor

My e2e-test for ui-grid is the following:
I'm adding the new item with the name that includes timestamp, saving it to the server.
I'm checking if the item with this name has been added to the ui-grid table.
The problem is that the table can get very big and ui-grid apparently uses lazy loading and puts only the visible rows to the DOM. I found this library of helper methods for testing, but it doesn't provide anything to search for the rows which are not in visible now.
So, question, is one of the following is possible in my Protractor test?
1) can I check how many rows do I have in my ui-grid table?
2) can I search for the certain cell by text, even if the cell is not visible?
1) Can I check how many rows do I have in my ui-grid table?
As long as the row is in the DOM, you can access it. However, if it's not visible you won't be able to do any operation on it (e.g. click). To get number of table rows you can use count:
$$('table tr').count();
2) Can I search for the certain cell by text, even if the cell is not visible?
Yes, you can search for (but not interact with) the cell as long as it's in the DOM. It doesn't have to be visible. But selecting elements by their text is rather fragile, so you should try to use some other method, if possible.

scala, swing : make a table scroll to the last row non empty

I would like to be able to add a row in a table, to achieve this I thought to a button near the table, with the caption "New/Update". if no row is selected, then clicking on this button makes the table "scroll" to display the first empty row, then the person enter the informations in this row, and a second click on the button stores the new row.
But I need to make the table scroll, how can I do this?
I searched on internet and found this : here, but it is in Java and I did not find the scala equivalent to getCellRect method.
please note I did not used a model for the table.
If there's a method that isn't implemented in the Scala version, you can use peer to access the underlying Java Swing version.
So you should be able to access the method in your question, if you have a Table t, using t.peer.getCellRect.

Mapping a dataset to textfield inside UItableView

In my app, I am using some .net asmx services (as backend) to get some data and populating it on my views. In one of the modules, i need to edit and save the data which am getting from the services.In that am getting several rowkeyvalues and accordingly am creating those many row cells in my tableview, which consists two UItextfields as well, which displays some unique code and comments.
Now if I have to edit and save some fields, I need to map each one of those rowkeys to each row cell and after that am creating object which is basically the wsdl proxy class which I have generated using Sudzc and pass each dataset and serialize it to XML and POST it through SOAP.
The real problem here, am not getting how to map each unique rowkeys to each row cell and create unique dataset(which mainly contains other fields as well including rowkey) for each row and pass it to proxy object (WSDL stubs).
Not sure I understand your problem, but there are 2 ways I can think of to map a row cell to something.
1. Each UITableViewCell is a subclass of UIView, and so it has a "tag" attribute, which is an int.
You can set this and check it's value.
2. When a user taps a row, the tableView:didSelectRowAtIndexPath: is called. IndexPath.row is an int that gives the absolute row postiion within it's section (and if only one section, then in the whole table).
Usually, in cellForRowAtIndexPath: you fetch your backing data corresponding to the IndexPath.row and populate the cell. You could also set the cell's tag at that point.
This ties together the row, the cell and the data.
Hope that helps.
-Mike

Multiple selection in UITableView. And the tables are dynamically generated

I have multiple uitableviews.
I created the multiple tables by using a loop.
The number of tables depend on the result of the webservice.
And each table have multiple selections. I have to pass all the values selected from every table to next webservice.
How can I do this task ?
Thank You,
1-> you can use check Boxes for in your UITableView for mutli section (Check box can be implemented by UIButton). one check box per row.
2-> Use a flag (BOOL isSelected),set it true when user select a cell (tableView:didSelectRowAtIndexPath:),and make it false for next touch,
for second approach you could use a custom UITableViewCell and use a image to show cell selection to the user (image can be changed by using isSelected value in tableView:didSelectRowAtIndexPath: method.