how do I get a variable in scoop in swift so I can pass it data? - swift

how do I get my serialnumberLabel in scoop of the itemsviewController when its in a different file and where would I put it because I'm new to swift I know very little please help

You should reload current tableView in completionHandle closure and store text in ItemsViewController, then update serialNumberLabel.text in tableView(_:cellForRowAt:).

You need to change logic by steps:
Step1: Make a list common model for table view
Step2: when you modify item you set for model common in table view.
Step3: when you callback item you can only call reload table view.
All done.

Related

Drools Business Central Workbench - Test Scenario: List subproperty on object

Is there a way to populate a List property on an object being tested under the "new style" test scenario?
I see some "legacy" test cases which seem to achieve this so am wondering if the new style test scenario handles this.
I added the List model to my test case, which enabled me to expand the sub-property on the object, however there is only one field available there, "empty" (boolean). Is there a way to add an object here? If it makes any difference, the model is an external java dependency.
Update
The reason I wasn't able to add the List of objects was because I didn't explicitly import that object dependency into the test. Once you import it you can follow the steps given in the answer below.
It's definitely possible to manage a List property under the Test Scenario Editor.
Please consider the following example: A Book class with a List<String> property named topics.
Creating a new Test Scenario assets, please select the column where you need to add the List property, and in the right part of the editor select the property expanding the Book class, as shown below:
Pressing Insert Data Ojbect button will assign the selected List property to the selected column:
To fill the data in the List property, please double click on the Insert value cell, in the first scenario data row. A popup will appear. Its aim is to fill data inside a collection
To add a value, please press the Add list value link in the bottom part of the popup. Here, you'll be able to fill a single item on the list
Repeat this step for all the items you need to add to the list. When completed, simply press to Save button
The popup will close and you should see the previously selected data cell filled with a label similar to List(2), the number represents the number of the items in the list.

Create your own custom filter bar in smart filter

I have a smart table with OperationIsReleased column in it. I had implemented a smart filter bar, where now I want to add filter option based on OperationIsReleased, i.e. if OperationIsReleased=true / OperationIsReleased=false.
I have created item list like this:
And my view.xml code is
I had Googled online but I can not find out how to refresh my table based on item list value I choose? What code should I write in controller for this? Can anyone please share some code with me where it is implemented?
(My column name coming from CDS view is OperationIsReleased, and it has Boolean values true/false.).
Thanks in advance.
you have to attach an event handler of beforeRebindTable of SmartTable.
Every time the Go button in the smart filter bar is pressed, this event will be triggered.
In the oControlEvent parameter, you will get all the existing Filters from it.
var aFilters = oControlEvent.getParameter("bindingParams").filters;
You basically need to add your additional Filter of OperationIsReleased to the Filters of the bindingParams.
Thank you!

How to retrieve view from controller of another view?

I am just wondering how can I get one of the UI5 views in an application.
I know there is a method:
sap.ui.jsview(); // in case the view is written in JavaScript
But the problem with this method is: if you assign ID for any of the controls and you have already inflated this view, you get an error.
So I want to know how to check if the view already exists and then if yes return that existing view, otherwise create the view with the corresponding API such as the above one.
I also know in the control for view I can go
this.getView();
But as I said, how to get this view from another view?
I am not quite understanding your question
With managed object id's are unique, so if you try and create the same view twice you will get an error.
when you create your view the easiest way to access it is via an Id
sap.ui.jsview("view1",'testapp.view.view1');
sap.ui.getCore().byId('view1');
NB. views should not talk to anyone other than their controller A terrific Model View Controller (MVC) diagram
sap.ui.getCore().byId(<id_of_the_view>)
Where <id_of_the_view> can be obtained in the following way:
suppose that the corresponding controller of <id_of_the_view> is "controllerA.js",
then you can console.log, inside controllerA.js,
console.log(this.getView())
This will print you an object which contains the id of such view. This will be <id_of_the_view>
I think here is one solution.
Make a global variable;
Use it to create element.
In First View:
var mytextField ;(use it as global)
mytextField = new sap.ui.commons.TextField('textfieldId');
In Second View:
var myValue = mytextField .getValue();
~Mansi Rao

NSSortDescriptor/NSPredicate to organize my tableView

i have a table view. In the table view, there is a custom UILabel, And each label with have a letter. "A, B, C, D" etc.. You can hit a plus button on the nav bar and it bring you to another view controller to enter info, and you hit save, and it adds the row onto the table view. Is there a way to utilize NSSortDescriptor/NSPredicate to make all the "A"'s together (together meaning i want all the cells with a to be with each other, but i still want them in the same section. ) if that makes sense! Is there a way to do this? Im using Core Data to save all my information. Any help is appreciated. Thanks in advance
I assume you are using NSFetchedResultsController. If not, please refactor and do.
The section grouping is anyway taken care of by the key path during the initialization of the fetched results controller with the argument sectionKeyPath.
As the sorting does not change, simply add a sort descriptor to the fetch request before initializing the fetched results controller:
fetchRequest.sortDescriptors = #[[NSSortDescriptor
sortDescriptorWithKey:#"textAttributeName" ascending:YES]];
where textAttributeName is the whatever you called your A B C label attribute in your entity.

UISwitch propagate state

I'm still rather new to iPhone development and I tried something I didn't it was possible. I have a UIView for my TableView Section Header with a switch on it, and I also have a UITableCellView with another Switch on it. It all looks fine, but now I want to propagate the UISwitch state from the section header to all the UISwitches on the section rows. Can anyone enlighten me how can I accomplish this?
Thank you.
Create a mutable array and whenever you create a table cell with a switch save a reference to the switch as a new element in the array. Then when the switch in your section header is changed, loop over the array and send a message to each switch, telling it to update its state.
UPDATE: for multiple sections, do the following
To keep track of which switch belongs to which header, set the tag property on the switches in the headers:
[myHeaderSwitch setTag:sectionHeader];
Then have an array of mutable arrays, one for each section as described above and use this to update the switches in the correct section