Getting Parent Fragment as null, how to fix it? - android-fragments

I have five tabs,within that, one tab contains multiple tabs i am trying to load that tab data,first time that data is loading,next-time on wards not loading the data.i was debugged,getting parent fragment as null.Please help to fix this issue.

Related

JavaFX how to check if mouse click triggered Tab selection

I have a tab pane that contains a bunch of tabs (obviously). Normally you can set a listener to each tab by calling setOnSelectionChanged() on the Tab. However, if the TabPane is being reorganized in some way, the tab pane automatically selects the first tab in the list. This is causing some performance issues for me so I would like to know if there is a way to know if a Mouse Click caused the Tab to be selected. Apparently tabs cannot have onMouseClick() listeners.
Whilst the solution to the answer wasn't found since tabs aren't actually nodes and don't have mouse click listeners, the performance issues were solved.
When changing tabs, I was (lazily) recreating the entire view and applying the model to the view. This caused a delay of approximately 140ms or more every time the tab changed. It was a bigger issue when implementing a search box to find the correct tab because as the tabs were being recreated from the search, the views were being recreating as the selection of the tabs changed (Tab pane automatically selects the first tab when adding new tabs).
Ultimately the design was changed to having the controller create the view once, and simply hooking the model to the view as the tab changed instead of recreating the view over and over.
I highly recommend looking at this post if your having performance issues and are relatively new to MVC/JavaFX programming:
Scene loads too slow
Currently changing tabs take approximately 15ms which is a significant improvement!

Data Binding issue while navigation & routing?

Today I faced a strange issue (could be a silly one) for data binding while navigating to 2nd view which is showing List of data coming from OData model and Panel at the bottom
I have replicate the code into this link - http://plnkr.co/edit/ClZqvo?p=info (You can run this as well through RUN on the Top) - Kindly run it in chrome with disabled security (Due to CORS issue)
Now the problem is when I am navigating to 2nd view (OData Table) and then Select any List Item, you will see in the bottom, the Panel will reflect the selected item (as I have used BindElement method to bind the path). After this I clicked back and then my 1st view will appear (JSON table) again I clicked on Next Button and then 2nd view will appear again. When I select the same item which I have selected previously then this time Panel will not show the selected items. This issue is coming only when I navigate back and forth and select the same item. Not able to understand what caused this?
But if I choose any other item then it will show me the selected item.
Anyone having any idea about this?
~Rahul
This is common issue when using bindElement, I have faced it too. It might be failing to resolve context of referenced entity. So, fields are not binded with respective values.
As a alternative you can use setBindingContext to bind fields within panel.
Since you are using named model, it should be specified as argument to setBindingContext.
So your code will be like
onSelect: function(oEvent) {
var oContext = oEvent.getSource().getBindingContext("odataModel");
var oProductDetailPanel = this.getView().byId("prodDetailsPanel");
oProductDetailPanel.setBindingContext(oContext, "odataModel");
}

What is the proper way to create subtable in a QTableWidget?

I have already implemented a subtable functionality in a QTableWidget. That is, if you click a row that contain a Left Arrow icon, a new row will be added and in there another instance of QTableWidget will be attached using setCellWidget.
All is working fine.. until I need to sort the table in an interval bases: this row that contain subtable, should be kinda sticky to its parent row. But, the sort method made them separate. I browse again the documentation, and I found this : QAbstractItemView#setIndexWidget. I am not sure how to implement this, but it seems like it will make the subtable attached to this row, without the need to add a new row.
Have you face this kind of issue before? Would love to know how you solve it
UPDATE
I think the proper way is indeed to use QAbstractItemView.setIndexWidget: it'll keep the data / model untouched so the rows can be properly sorted. We just have to properly display a new widget that don't override the current data appearance

why in UINavigation bar, push and pop are not working proper according (XCode5) ios sdk-7?

i am getting these error:
nested push animation can result in corrupted navigation bar.
Unbalanced calls to begin/end appearance transitions.
I am trying to push one view controller to another one.i am getting following issues:
on that it is not showing title while i gave it in view will appear.
if i turn back it is now showing me blank view (transparent) having that title what i was not able to see in previous view controller.
if now i again turn back, it is showing me right sequence of titles as i am popping but without content.i mean blank (transparent).*
I had the same issue, it turned out to be that I was making two repeated calls to pushViewController:, which presented the same View Controller twice, and when I was going to pop it, the content would stay but the navigation bar would do the animation. I was having this message on the log 'Unbalanced calls to begin/end appearance transitions for ...'
Xcode_5_developer_preview_6 (beta5) is the answer for this. i just installed it. they have resolved this issue which was in Xcode_5_developer_preview beta4.

Replace "Loading..." message in ListFragment when list is empty

I have two ListFragments next to each other.
The left one shows categories to be selected while the right on shows the elements in the selected category.
Now at the very start of the screen the left ListFragment shows all categories while the right one is empty and waits for a category to be selected. Only then it can display the memebers of the selected categry.
While it's empty however, the "Loading.." message gets display - which I think looks quite good.
All I like to do now is replace the "Loading..." text by my own.
Is this possible without having to implement the complete ListFragment class?
Many thanks.
ListFragment.setEmptyText(..) should do the trick!
The method setEmptyText shows a TextView when the list is empty therefore "Loading..." will not be shown. From Documentation
The default content for a ListFragment has a TextView that can be
shown when the list is empty. If you would like to have it shown, call
this method to supply the text it should use.
whereas spinning loading animation is an indeterminant progress indicator and is normally shown as per the docs
public void setListShown (boolean shown)
Since: API Level 11 Control whether the list is being displayed. You
can make it not displayed if you are waiting for the initial data to
show in it. During this time an indeterminant progress indicator will
be shown instead.
Applications do not normally need to use this themselves. The default
behavior of ListFragment is to start with the list not being shown,
only showing it once an adapter is given with
setListAdapter(ListAdapter). If the list at that point had not been
shown, when it does get shown it will be do without the user ever
seeing the hidden state.
Parameters shown If true, the list view is shown; if false, the
progress indicator. The initial value is true.

Resources