displaying web pages over web views in collection view using cocoa bindings - cocoa

I tried sample example given at this link - Collection View Programming Guide
It is simple and it worked. Considering it as a reference I tried a simple application which will show a collection view of web views with some web page displayed over each web view.
The model class has two properties: NSString *pageName, and NSURL *pageURL.
I then followed each and every step written in tutorial above with required modifications but I was caught in the step -
How to bind web view to collection
view item?
In binding tab it shows three possibilities : Editable, Hidden, Tool tip but none of these is working.
Can anyone suggest me way to accomplish my requirement?
Thanks,
Miraaj

WebView does not expose bindings for the URL (one would think it would, but it doesn't). You'll need to make use of NSCollectionViewItem (create a custom subclass) and update your WebView's URL when its represented object is changed.
The quick start guide you referenced does not show how to use a custom collection view item (it shows a very basic case). You'll need to delve a little deeper into the documentation (and online examples) to achieve your goal.
I would offer one thought to consider regarding your overall goal: WebView is a "heavy" object, so keep your performance expectations realistic regarding creating many of these views.

Related

How to discover pages where portlet appears?

I want to get programmatically all pages (or one) where portlet is presented on Webspehe portal. Actualy can't find any information about my issue.
The available SPI really was not designed to work back up the chain like this
you can go from layoutcontrol to portletwindow to portletdefinition to portlet
So the ugly way to do this would be to get the content model, loop over all page types, get the layout model for the page, then get the layout controls, from those get the portlet windows, and then go to portlet definition.
The shorter way is to iterate over a full xmlaccess and parse and build the list that way. I did write a whitepaper on how to get the layout controls on the page ftp://public.dhe.ibm.com/software/dw/lotus/Controller_Model_SPI_Final.pdf

How to best apply an MVC architecture in dojo mobile (custom controllers)?

I'm pretty new to Dojo and I'm wondering about some best practises for building a MVC application. I know there are modules like dojox/app, but it seems like these are made for more complex applications.
It seems like the best way to go is to make custom page-level controller objects with will handle all the page logic, but I'm not quite sure how to fit this piece in the puzzle. What is the proper way to switch between views and passing through parameters through them following a MVC archtiecture.
I have an overview page with list items, each with their own ID. I want to navigate to another page passing through the corresponding item ID so I can retrieve the details for this item externally. What would be the proper way of doing this?
I could call a method on the corresponding controller (Page1 Controller or Page2 Details controller) directly using a button and passing the listID parameter directly?
Another way of doing this could be by working with transition states and addling listeners in the page controller to forward to the correct page. Although I'm not quite sure how to pass parameters in this scenario..
... any better solutions?
Can anybody shed some light on this? It doesn't seem like there is much documentation/examples on this with the latest versions of dojo (1.9).
Thanks!
I will recommend dojox/app since you are already using dojo mobile.
It's very simple to get started and can be use for simple apps or very complex apps
Take a look at this resources:
https://github.com/csantanapr/dapp-examples/tree/master/dapp-request
https://github.com/csantanapr/dapp-boilerplate
http://dojotoolkit.org/documentation/tutorials/1.9/dojox_app/contactsList/

View Controller with Multiple sub views

I have a website page which I need to replicate in my app (as a reference for anyone that wants to help the url is http://www.sccgformulary.co.uk/gis.html) There is a title, some sub-headings, plenty of text in different sections and a few different tables. The colouring in the background isn't needed.
My question is how would this be implemented in Interface Builder (if it is even possible?) I don't know how to design the layout of a page which extends further than 1 screen. I've done it before programatically - is this the only way to design views which need a scrollview with multiple subviews? any help would be greatly appreciated!
What you are looking for is probably a simple UITableView with a custom UITableViewCell.
You might need some way of feeding data to your application via a web service. JSON is popular. but before you go ahead I suggest you read up on UITableView and look at some similar Apps to find out exactly what you want.

When to use more than one Sammy.js application?

As I'm learning about Sammy.js I read that you can have several Sammy.js applications in the same page, each bound to a different element (i.e. div). I would like to understand why would this be useful.
I read in another post that only forms inside a bound element will trigger the route change, I'm thinking this could be used to modularize your application. Is there another use case beside this? Could you provide an example of how to modularize your application in this way?
We implemented a component similar to Sammy in our Silverlight application some time ago. The similarity is in that both represent a kind of a simple browser that can be bound to a UI region. The approach gave us several benefits:
We had an extensible way to add new content implementations. I mean that we could add plugins to our app that contained new forms/views which the application core had no knowledge about.
We could easily implement composite views, e.g. dashboard that were able to show any view implemented in any module. Including themselves. (A-ha, we had created recursive dashboards that worked until the app hit the memory limit. Kind of Inception. :))
Sammy can be used to reach these goals as well.
However, you must understand that from all Sammy applications running on a page, only one can be bound to the browser location bar. Others will have their location visible only to javascript, or you'll need to render location bars for them on the page.

Cocoa: Core Data + NSTableView

I have a core data app set up, and everything is working pretty well. But there is one little problem. When I insert a new object into my entity I have it go to my NSTableViewCell, where I can edit it to the text I want, but there's one little issue, I can edit the cell, but I can't deselect it to save it to core data, it's stuck in edit mode and the only way I can get out of it is by quitting the application, AND it doesn't save the new name I just gave it in my cell.
This kind of functionality is covered in the Core Data tutorials provided by Apple. It will get you to make use of the NSArrayController which is a very helpful class for synchronising the view (NSTableView) and the model (Core Data).
I believe this is a great place to see how this works: http://developer.apple.com/cocoa/coredatatutorial/index.html
Hope that helps.
What method are you using to connect the table view to the core data store? Bindings? Data Source?
My guess is that you haven't implemented this at all. If you are just getting starting then I suggest implementing an NSTableViewDataSource instance.
http://developer.apple.com/mac/library/documentation/Cocoa/Reference/ApplicationKit/Protocols/NSTableDataSource_Protocol/Reference/Reference.html

Resources