Topener / nl.fokkezb.pullToRefresh

Widget to implement a table pull-to-refresh header in Titanium Alloy
184 stars 60 forks source link

Wrapping pullToRefresh around ListView hides the listview #37

Closed Serfenia closed 9 years ago

Serfenia commented 9 years ago

Hello Fokke,

I am trying to use your widget for refreshing my listview.

For some reason when I wrap your widget around the listview it doesn't show anything in my application.

The view that contains the widget is programmatically added to a window of a tab in a tabgroup.

I use data binding on the listsection to show the list items.

When I remove your widget it works.

Code below of the xml view: schermafbeelding 2015-02-08 om 23 08 01

In the controller I call $.ptr.refresh() and $.ptr.hide() when the movies are retrieved

Ti SDK 3.4.1/3.5.0 iOS 8.1

FokkeZB commented 9 years ago

Are there any errors in the console?

Could you paste the content of the compiled controller in Resources/iphone/alloy/controllers/THECONTROLLER.js ?

Serfenia commented 9 years ago

Allright I have it working now.

But the widget is not my root element now, it is wrapped by a window in the current view: schermafbeelding 2015-02-10 om 13 14 46

Is it possible that when the widget is the root node it doesn't function properly? I don't have time to write a test case to test it, but maybe you have? Anyways for now this issue is fixed for me.

FokkeZB commented 9 years ago

It could well be that the widget can't be the toplevel element. I will write a test case and see if it's an Alloy bug or known limitation.

FokkeZB commented 9 years ago

I could not reproduce this with:

index.xml

<Alloy>
  <TabGroup>
    <Tab title="hi">
      <Window class="container">
        <Require src="req" />
      </Window>
    </Tab>
  </TabGroup>
</Alloy>

req.xml

<Alloy>
  <Collection src="movie" />
  <Widget src="foo">
    <ListView />
  </Widget>
</Alloy>

widget.js

$.addTopLevelView(arguments[0].children[0]);

See any differences I miss from your situation?

nitishdhar commented 9 years ago

Hey, even I am facing this issue with iOS only.

But this does not happen all the time, sometimes the listview is visible and if I close the app and open again, it just disappears. Its random, I have tried to find some patterns, but it seems to be completely random. Some timing issue with the widget rendering?

FokkeZB commented 9 years ago

@nitishdhar Maybe what you see is https://jira.appcelerator.org/browse/TIMOB-19209 ?

nitishdhar commented 9 years ago

@FokkeZB thanks I knew it must be some race condition issue, looks like its still not fixed though. Thanks I will follow up on that Jira, I am assuming this is not an issue with your widget, you may close this issue I guess.