Skip to content

Added SegmentedBarItem to element registry. #179

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 14, 2016

Conversation

nsndeck
Copy link
Contributor

@nsndeck nsndeck commented Apr 14, 2016

Added SegmentedBarItem to element registry. And now SegmentedBarItem could be added via HTML.

<SegmentedBar>
    <SegmentedBarItem title="Waiting" ></SegmentedBarItem>
    <SegmentedBarItem title="Done" ></SegmentedBarItem>
</SegmentedBar>

@nsndeck nsndeck merged commit 4bafb79 into master Apr 14, 2016
@nsndeck nsndeck deleted the nnikolov/SegmentedBarItemsInXml branch April 14, 2016 13:44
@dbenninger
Copy link

This works on iOS, but on Android I get the following error:

Unhandled Promise rejection: Error in pages/rides/rides.html:2:8 caused by: Cannot read property 'newTabSpec' of undefined ; Zone: angular ; Task: Promise.then ; Value: Error: Error in pages/rides/rides.html:2:8 caused by: Cannot read property 'newTabSpec' of undefined TypeError: Cannot read property 'newTabSpec' of undefined
JS: at SegmentedBar.insertTab (/data/data/net.comerge.PubliBikeLocal/files/app/tns_modules/ui/segmented-bar/segmented-bar.js:153:31)
JS: at SegmentedBar._addChildFromBuilder (/data/data/net.comerge.PubliBikeLocal/files/app/tns_modules/ui/segmented-bar/segmented-bar-common.js:113:18)
JS: at ViewUtil.insertChild (/data/data/net.comerge.PubliBikeLocal/files/app/tns_modules/nativescript-angular/view-util.js:59:20)
JS: at ViewUtil.createAndAttach (/data/data/net.comerge.PubliBikeLocal/files/app/tns_modules/nativescript-angular/view-util.js:103:18)
JS: at ViewUtil.createView (/data/data/net.comerge.PubliBikeLocal/files/app/tns_modules/nativescript-angular/view-util.js:110:25)
JS: at NativeScriptRenderer.createElement (/data/data/net.comerge.PubliBikeLocal/files/app/tns_modules/nativescript-angular/renderer.js:198:30)
JS: at DebugAppView._View_RidesComponent0.createInternal (RidesComponent.ngfactory.js:31:30)
JS: at DebugAppView.AppView.create (/data/data/net.comerge.PubliBikeLocal/files/app/tns_modules/@angular/core/bundles/core.umd.js:9419:25)
JS: at DebugAppView.create (/data/data/net.comerge.PubliBikeLocal/files/app/tns_modules/@angular/core/bundles/core.umd.js:9631:48)
JS: at DebugAppView._View_RidesComponent_Host0.createInternal (RidesComponent_Host.ngfactory.js:18:14)
JS: Error: Uncaught (in promise): Error: Error in pages/rides/rides.html:2:8 caused by: Cannot read property 'newTabSpec' of undefined

@adisoftbn
Copy link

I get the same error on android, sadly...

@playmuser
Copy link

Same error...

@rhanb
Copy link

rhanb commented Jan 19, 2017

Same error..

@murphmar
Copy link

murphmar commented Mar 2, 2017

Having this issue as well. This is almost a year old, any update here at all?

@OscarArnaizLopez
Copy link

OscarArnaizLopez commented Mar 13, 2017

I managed to fix it by adding a setTimeOut into the 'insertTab' prototype method. It seems android bridge to native is not there on time, (quite heavy stuff to be exported, I guess). No need to add time to the setTimeOut though, moving it to the bottom of the stack is enough. Not best fix but worked for me.
screen shot 2017-03-13 at 10 55 38

@murphmar
Copy link

murphmar commented Mar 13, 2017

That worked for me, awesome!

Only now I have another issue. The segmented bar items repeat to the end of the view until I do something to refresh the view. Ie: I have Daily, Weekly, Monthly SegmentedBarItems and it displays "Daily/Weekly/Monthly/Daily/Weekly/Monthly" until I navigate to another page, when I go back it displays them correctly. Hmm.

Edit: Looks like the issue is combining it with *ngIf. I removed the if from the StackLayout housing the Segmented Bar and all is well.

@OscarArnaizLopez
Copy link

OscarArnaizLopez commented Mar 17, 2017

Yep, went throughout it too @murphmar . Managed to fix it by not using <SegmentedBar.items> element.

Try this

<SegmentedBar>
    <SegmentedBarItem title="Daily" ></SegmentedBarItem>
    <SegmentedBarItem title="Weekly" ></SegmentedBarItem>
    <SegmentedBarItem title="Monthly" ></SegmentedBarItem>
</SegmentedBar>

Let me know how that goes.

Thanks

@murphmar
Copy link

@OscarLopezArnaiz Still the same issue for me. What ended up working for me was creating the whole thing programmatically on the component.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants