Get selected row details in submit button as alert - swift

I have a table-view that houses many cells. There is a button[submit] after the table view part with in view controller .Table view consists of number from 1 to 100 and a radio button for selection ,while click on any number it changes to selected state. My question is, how can I display the selected numbers as alert while click on submit button

The key thing here is to forget all about the table view. Instead, concentrate on the model data from which the table view is constructed. Each time the user clicks on a number to toggle whether this one of the "selected" rows, you must read that back into the model data (which will obviously need some sort of property saying whether this is a "selected" row of the data). Now the button's job will be trivial: it just cycles thru the entire model data looking for the numbers whose "selected" is true.

Related

How to refresh a rowrepeater in sapui5

I have developed a small application in which I have a row repeater where I will display the recently created records.
Suppose I have some 150 records in a row repeater.
Now the problem is I scroll down to see the 100th record in the row repeater
and after viewing the 100th record I will go back by clicking on back button.
Now if I again click on the row repeater the page is not displaying from the starting record by default its showing from the 100th record means I again need to scroll up to view the 0th record.
How can I overcome this issue?
You can
ensure that the RowRepeater (or it's surrounding view) is destroyed on back and recreated on enter (only way known to me to handle your requirement with UI5)
use jQuery.scrollTop() on re-entering the view with your row repeater
var oRR = sap.ui.getCore().byId("myRowRepeater");
jQuery(".sapUiRrPage", oRR.getDomRef()).scrollTop();

show the detail of a row in celltable

the requirement is easy, but I don't know how to do it.
there is a celltable with a column of radio button (or check box but only allow select one row), after user select that row, there is a button and user can click that button to see the detail of that row.
How to do it?
I try to SingleSelectionModel, but I assume the user origin select row 3 radiobutton, then the row3 underlying field is set to true, then when user select the row 5 radiobutton, the row 5 corresponding field is set to true, but I have no method to set the previously row 3 selected field to false.
There is no method to do it automatically. you have to do it yourself by applying a loop. use field updater on that column and get the value on basis of that set the value of other check boxes or radiobuttons. you can get all other elements by this code:
GridReportFields ldp=dataGrid.getVisibleItem(rowNo);
here GridReportFields is my model class. now u have object of corresponding rowNo you can set value of any variable of that object. like:
ldp.setCheckBoxValue(true);
here setCheckBoxValue() is a setter method of model class.

table with multiselection and clickable row

I already have a table - CellTable, with single selection model and i used onSelectionChange to find when row was clicked
Next I added to that column which containes check box
and here comes my problem
if i use single selection model, when i tick one row, other row become unticked
i tried to switch to multiselection model, but in this case, i can't click on row, and onSelectionChanges is executed only when i click on my check box, but i can tick more than one box
is any chance how i can have both - multiselection and clickable row?
regards
Yes it is possible.
But I am suprised that it doesn't work because the default behavior of the MultiSelectionModel should be that the row is selected as soon as you click it. However maybe in the presence of a CheckBoxCell column it is different.
Anyways you have to check following JavaDocs:
Constructor of the CheckboxCell
DefaultSelectionEventManager

UITableView Selection & Deselection

I am having two tableviews if the 1st table row gets selected then automatically deselect the row in 2nd table if it is previously selected. Kindly anyone help me in this. Thanx in advance.
If you select a row in your second table you have to store the selected index in a variable of your view controller. Within
didSelectRowAtIndexPath
of your first table you send
deselectRowAtIndexPath
message to your second table. Storing the selected item in a variable may be unnecessary if you manage to receive the selected index in your second table otherwise

Place 3 check marks in a list tableview, press button, display 3 columns in a new tableview

I currently have a List TableView where I can place check marks on any of the Products in that list. Right now, there is no outlet to handle the check marks. What I'd like to do is once the user places check marks on Product names in that list, press a button which would pass those Products' details over to a new tableview, displaying the details of those Products in a side-by-side column-type of tableview for a side-by-side comparison of the 3 Products' details. I could really use some help on the following and any help provided would be much appreciated.
1) Take the check marks and press a button to send that to a new view. I have no idea how to associate and connect those check marks to a button and then program that button to send the details to a new tableview.
2) Create a new view with a tableview capable of displaying 3 side-by-side columns in a tableview. I have read some about creating tables that appear to have multiple columns, but I'm not exactly sure how this is achieved.
Any help would be much appreciated. Thanks.
I'm not sure about number 2, but here's how I'd handle number 1:
Store the "check mark" as an attribute of each Product object in the array where your first table view is getting its data. Then, when you push the next view controller, populate an array by checking which products have a check mark attribute and adding them to a new array for your second table view's data source.