Is it possible to create a bound between 2 views so their z-index is always next to each other? - layout

Is there a way for me to have two views that always remain one on top of the other no matter what gets added?
For example I want to have ViewA contains ViewA1 and ViewA2. and if I decide to add a viewA3 below ViewA1 it won't be added right below it but below the next that is not "constrained" to be below ViewA1.
So ViewA1 and ViewA2 need to always be together and if I try to add a ViewA3 under ViewA1 it will go under ViewA2 instead.
Sort of like a constraint on the z axis between views.
I've tried observing for zPositions, tried to observe changes on the subviews of the superview. No success yet. Any tips are welcome!

I've managed to find a working solution for this — it's possible to observe my superview.layer.sublayers for any changes. Then it's just a matter of making sure the layer of my viewA1 is always near the layer of viewA2.

Related

how can I clear or set values in a digestive-functors view

I have used postForm from Text.Digestive in digestive-functions which returns something like a (Just view, Nothing) in the case of a form error. I can then take the view and render it to HTML to display the form errors.
My issue is that I do not want every field to be rendered as given by the user. Specifically, my captcha value should be reset to a newly computed one rather than reusing the old one (which would give an infinite number of captcha attempts). But I do not know how to compute a new view with one field cleared/set, given the old view.
Alternatively, does anyone know if this would be easier with reform? I haven't looked at it much yet but it seems nice that it does away with the string-based-programming part of digestive-functors.
I repeated the question on the bug tracker where someone eventually came up with a working hack. The view value turns out the be a record. You can mutate its viewInput field before rendering it. viewInput is an association list from paths to forms.

UML Activity Diagram for android project

I have created the below diagram and I wanted to know if the diagram that I have done is correct.
The below diagram is based on an android application. When the application loads the user is given 3 button to select add, update and help. On click on add button the user is given an option to add a new user or add a new item. When he select either of the options he enters the required data once the data is entered the system check if all the values are entered correctly and then finally saved. The same process is applied for update.
Your diagram misses an entry point. Though it's rather obvious that the top action is the start, only the entry point is the one indicating the beginning.
You can omit most of the diamonds and directly transfer via a guard from actions. So your conditions should be guards and written as [Yes] or [No]. The top most action (and quite some others) is(/are) indeed what should be written inside (or aside) the diamond below.
An excerpt for an update could look like this:
Finally Values added does not look like an action but rather as state. It should be omitted. Alternatively use differently named end flows.
So far for the formal points. But as #eyp said: it's a good one and one can understand what you tried to express. The above is just for the picky teachers.
It's a good one but it lacks some detail in the diamonds. You should write besides the diamon the question before choosing the next setp to do.
For example in the diamond after Check update value you may write is valid? or another question that clarifies more the business logic.

How to insert, change or remove a single table item in Tabris?

I'm trying to understand how to design this using Tabris.
My current design updates the tableview by setting a new list:
viewer.setInput(list);
This is not what I want as this refreshes always the entire table with a nasty refresh view behavior.
What I want is just to apply a single change to the table, so remove a tree item, change or insert. Just spend some time to get viewer.insert(...), remove(...) working.
The TreePath required for this call is what confuses me. Tried to create one I'm pretty sure it is not correct.
Does anyone has a good example or any other suggestions to get me in the right direction?
Thanks,
Vincent
I recommend looking at the TreeViewer.replace method. With this method you can change a single item.

Core Data Multiple FetchedResultsController/Views: How do you update all manually?

I have two instances of the same ViewController class accessed in different tab items. Both use the same entity, but with a different predicate. One displays all the items, while the other displays a subset based on its predicate.
The problem occurs when I delete an object from the "All" list. It updates immediately, but when I switch over to the other tab, the object is still there, even after going back and forth in the views. Only after a period of time, around 5 to 10 seconds, does the deletion get reflected in the other view.
The ViewController class use a FetchedResultsController.
Any ideas what the cause is and how to get the results to immediate appear?
Just put a reloadData into viewWillAppear. You can also catch this when the tab bar's selected index changes.
Apparently, there is no solution. There is no way to update UIManagedDocument manually.
This guy came to the same conclusion:
Core Data managed object does not see related objects until restart Simulator
So the solution is to use the default master-detail template and to stop using UIManagedDocument. Wish there was some documentation on this, would have saved me a day of my life.

Need syntax to call a refresh on one component from another on the page

I have a fairly straightforward and common use case. A panel, in which resides a repeat control. The repeat control gets its content from a view lookup by key. Below that repeat control is another panel. This panel has a data binding to a new notesdocument. The panel has a couple of fields on it for the new document and a submit button.
It all works, however after submit (presumably in the "postSaveDocument()" event) I want to call back up to the repeat control and have it re-perform its lookup and refresh its content.
I'm looking to understand syntactically, how I can reference the repeat control and its properties and methods from elsewhere on the document -- and secondarily (though I can look this up once I get the first part figured out) what the refresh() method would be for that that repeat control.
Ideally, I think its something like: xp:page.repeatcontrolname.refresh() -- though I know that isn't right.
I'm sure once I see an example, it will apply to a myriad of other things.
Update :
I discovered that the repeated elements were actually refreshing but I wasn't seeing a new entry added to the list. The reason, ultimately, turned out to be that to add another entry to the repeat list I needed a new "control" -- but I'd checked that box (on the repeat control) that said "Create Controls at Page Creation". It was preventing my XPage from creating another entry for the new document to display!
This article explains the syntax for doing what you describe:
http://avatar.red-pill.mobi/tim/blog.nsf/d6plinks/TTRY-84B6VP
I have a feeling that this one captures the actual use case.
http://www-10.lotus.com/ldd/ddwiki.nsf/dx/Create_and_display_responses
The key setting that people tend to miss is "ignoreRequestParams".
Andrew,
The 'XSP.PartialRefreshGet' call was broken in Domino release 8.5.3 which results in the '_c9 is undefined' error.
Have a look at the article posted by Tommy Valand:
http://dontpanic82.blogspot.com.au/2012/03/patch-for-bug-in-xsppartialrefreshget.html
Basically to work around the problem a second argument is required to be passed to the call, for example:
XSP.partialRefreshGet("#{id:ExistingDevicesList}", "")

Resources