How to get ecm.widget.viewer.ContentViewer items - ibm-content-navigator

I have a page where first half (vertical) of the page has a gridx and second half of the page has a contentViewer. When a user clicks on an item from the grid, I'm loading the respective image and is working fine. When the user clicks on the second item from grid, the viewer is loading the second image but the issue is it is retaining the first image as well (images are opened as a tab). So I need to remove the first image when loading the second image. Is there a way to get items from ContentViewer so that I can close the previous one before loading the new one?

The getViewersStatus() method of ContentViewer will return to you a structure that includes all the currently open items. You can then iterate through this and call closeItem() on each one.
But if you are using Navigator 2.0.3.3 or later, what you probably want to do is call closeAllViewers() on the ContentViewer widget to close all open items without prompt to save changes.
Ref: https://www.ibm.com/support/knowledgecenter/en/SSEUEX_2.0.3/com.ibm.developingeuc.doc/doc/JavaScriptdoc/symbols/ecm.widget.viewer.ContentViewer.html

Ok here is what I did to achieve this.
if(this.imgViewer.mainTabContainer.getChildren().length>0){
array.forEach(this.imgViewer.mainTabContainer.getChildren(),function(child){
this.imgViewer.mainTabContainer.removeChild(child);
});
}

Related

Device back button has different result rather than getx toNamed

I have two screen, first is for load list off all shop data and second is the detail screen of the shop. When I'm in second page and go back with arrow icon with Get.toNamed the first screen will load all list again but when I in the second page and I go back with my device back button in the first page it just showing loader icon and the list not loading. Can someone help me why it can be happen ?
Use Get.off() or follow this article.

ListView item value change when I swip screen..Unity

I am new in unity. I create a project in unity where I bind some items in listview and in one item I use two different images and change on click the item. It's works fine..But when I go to other tab(or browser) and come back to unity then the item will change on it's default state..
Default state of image
Changing state of image
Not sure how you to implement the tabs switch.
An easy way to keep the button status is using PlayerPrefs
// before click other tab
PlayerPrefs.SetInt("BtnStatus", someitem.status);
// after come back
someitem.status = PlayerPrefs.GetInt("BtnStatus", 0);

How to Refresh the Google Map in my application using Swift?

I have made a tab bar application, in which one tab(MapTab) consist of an GoogleMap and in another one(ImageTab) all the images are saved. now, when the image get saved in ImageTab it get displayed on a MapTab in the form of Marker.
Now my question is, when i delete the image from ImageTab it gets deleted but how to remove it from MapTab i.e. GoogleMap.
First clear the all the mapView's previous markers with:
mapView.clear()
And then refresh your image array. Now again draw the markers for the refreshed array of images.

Ionic either doesn't show back button or page doesn't load at all

I am trying to create a new page from an existing page with a back button. I have recreated the issue here in a plunkr. In the trip analytics option When I click the first card i.e. Enter Home address. I want the todayDetail .html page to come up with a back button. I have already tried two approaches
First approach The ng-click approach. In which I give $state.go(statename) to give that page. But then I wouldn't get a back button as the navigation stack is changed.
Second approach - If I keep the navigation stack i.e. keep the state name as initial.trips.today.todayDetail. The page doesn't load at all.
What is the issue? How should I go about it?

Positioning ListViews in WinJS Metro apps using scrollIntoView

I am building a jscript-based Windows 8 Metro app. The main screen of this application is a scrolling "panorama" view with several list views showing various aspects of the app's state. In some cases the user will select something on the page which results in a navigation to another page (using the WinJS.Navigation.navigate method.
When the user hits the back arrow on the other page, it returns to the main screen, and I use "scrollIntoView" on to position the screen to the section that the user was working on before the navigation occurred.
Unfortunately this hardly ever results in correctly positioning the view. It seems random. I suspect that the page isn't finished being built yet and that the scroll values are set based on the state at some snapshot in time.
Now the question:
Is there some what to be notified by WinJS ListView objects that they are completely rendered and layed out? Or is this the job of the page's ready function?
Thanks for any insight!
Putting multiple list views side by side is Not A Good Idea(TM). I would recommend putting one list view, and placing your content in a grouped data source to get the groups. If the items have different templates, then you can use a custom item Template selector to dynamically select a template.
Additionally, to ensure that the list view is scrolled to the right position, you need to use the indexOfFirstVisible to set the items the name suggests.