Using addHeaderView in Android - android-listview

On clicking the button following happens to the ListView:
1. Through addHeaderView the header is displayed.
2. SimpleCursorAdapter displays data from the database table.
Now when I click the button again then the header duplicates, in the list while the data from the table is correctly displayed.This keeps happening every time the button is clicked.How to solve the problem.

The Adapter does not provide HeaderView-s and doesn't count them.
Use ListView.getHeaderViewsCount() to get the number of header views. This is how you can avoid adding unnecessary views.

Related

Ionic New Slides - Swiper SlideTo bug

I'm using the latest ionic 1 version 1.3.3.
I've a list of items. On click any of them, it opens the ion-slides with few left and right items (which I'm letting it to control dynamic). The issue is when the slider gets ready, it shows the correct index for the first or couple of time. But shows the first index afterwards when we come back to the list and click on another item.
I've used $scope.slider.slideTo to update the index. I also destroy slides instance before leaving but didn't get success.
Looks like it was not .slideTo() bug. But I think they should provide callbacks for the update methods.
Actually I've binded ng-hide on the slider for the loading.
So the slider was unable to render until the list is prepared. I was updating the index and then toggling the loading.
Resulting conflicts with update slide and index.
I placed style visibility: hidden with ngclass instead of ng-hide. It works perfect.

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.

VIA the GWT places API how do you change the URL/PLACE/Place-Token without reloading the page?

We have a giant table of orders in a GWT page. As users click on an order the bottom half of the page loads the details for that order.
When OnSelect of an entry in the table I could fire a place change event and change the place token from #OrdersPlace: to #OrdersPlace:123 where 123 is the order number. The problem is that would require the entire table to reload as well.
Is there a way to just change the URL from #OrdersPlace: to #OrdersPlace:123 so on a browser refresh I can get back to where I was by reading the Place Token without starting from scratch by reloading the entire activity?
If you are using Gin you can make the view a singleton and just have it hold onto the existing data. Think of it similar to removing the table from the DOM and then just re-adding it.
There are equivalent ways of doing the same thing without using Gin too.

Wicket - need FilterForm ajax events for GoAndClear button events

I've added a FilterForm with GoAndClear buttons to an AjaxFallbackDefaultDataTable. The filtering is working fine except for refreshing my table. I have a dropdown that changes the number of rows to show which does a target.addComponent(my AjaxFallbackDefaultDataTable) which doesn't reload the data but refreshes the. If I use this after I click a Go or Clear button then the table shows the proper rows, item count, and page links.
How can I handle Go and Clear clicks on my FilterForm to update my AjaxFallbackDefaultDataTable?
In the onsubmit method for the filter form just call .renderComponent() for the table.

UITableView form

I am having very annoying issue. I have one form page with 5 custom cells. Each of them has one text field. On the bottom I have one button. In an onclick button function I am gathering values from each of the 5 described text fields.
My problem is that if my keyboard is up, I will get the values of not all but just visible text fields, the ones I don't see are null.
How to override this?
Thx,
Mladen
Separate data you have from your interface, that is store your textfield values in some other place right after you finish input. And access your data there.
UI elements are not intended to store data, but just to display it and allow input - as you can see in your case if you do not see a particular element you cannot be sure that it actually exists.
This might solve your problem..
1. Register your viewcontroller for KeboardNotifications
2.When keyboard will appear resize the view so that all fields will be visible.
3. When keboard will disappear just resize it back and continue..