Comments (19)
This may be a recent regression. Our app is using a slightly older version of HV, so I'll check older versions to see when it stopped working.
from hyperview.
We updated our app to use the latest version of Hyperview. We are currently testing the behavior of the back button, if we find any bugs I will update here.
from hyperview.
I've confirmed it's still not working. I have added it to the list of demo updates we will address in the near future.
from hyperview.
That's correct. However, I do have an update.
I am working on extending the Hyperview demo to illustrate how the new Hyperview Navigation can be implemented using HXML to define a navigator hierarchy. Using the new navigation system, the "back to other" and "close to other" work as expected.
The updated documentation and demo should be released soon as part of the next Hyperview release.
from hyperview.
and so does it when set action to close
.
I'd like to hear your opinions/comments before I try to follow and fix it.
thank you so much.
from hyperview.
@terryatgithub can you give an example of what you'd like to achieve? Like is says in the documentation:
If the provided
href
attribute would load data from the same source as the previous screen, no request happens. However, if the provided href is different, a request will be made to reload the previous screen.
So, let's say you open /screen/a
and then push screen/b
.
- If the XML says
<text action="back" href="/screen/a">Back</text>
, then Hyperview will un-push the screen but not make a request (because the hrefscreen/a
is the same as the previous screen's URL). - If the XML says
<text action="back" href="/screen/c">Back</text>
, then Hyperview iwll un-push the screen and make a request to/screen/c
.
This is intentional design, usually when users are navigating back in the mobile app, they do not need to re-load the content. However, in some cases you may want to reload the previous screen. There are some options:
- Use a timestamp query parameter in the href:
<text action="back" href="/screen/a?id=12345">Back</text>
.12345
is the current timestamp when loading the page. That way, each time the user presses back, the previous screen will reload, becausehref
will be different. - Use event dispatch. The back button will dispatch an event. Screen A listens for the event and will reload itself:
Screen B:
<text action="back" href="/screen/a?id=12345">
<behavior action="dispatch-event" event-name="reload-screen-a" />
Back
</text>
Screen A:
<body>
<behavior trigger="on-event" event-name="reload-screen-a" action="reload" />
...
</body>
from hyperview.
Hi @adamstep , thanks for your kind detailed reply. I think I understand your intentional design. It's nice.
- My question 1 is: below intentional design doesn't work when I tried in the demo.
If the XML says <text action="back" href="/screen/c">Back</text>, then Hyperview iwll un-push the screen and make a request to /screen/c.
i.e. when press the "Back to other" button on below screenshot, it just goes back, will not make a request to /screen/c
.
Does it work normally in your side?
what means is that <text action="back" href="/screen/c">Back</text>
just work exactly same as <text action="back" href="/screen/a">Back</text>
.
- My Question 2 is:
in the intentional design, where to trigger themake a request to /screen/c
in source code ?
is it in below code fragment ?
but in fact it won't run when I debugged the question 1.
please help check. thank you so much.
from hyperview.
Hi @terryatgithub , you are right. The "Back to other" does not work for me in demo app. It does work in the Instawork app though. Let me look into this some more to understand the problem.
from hyperview.
ok, it's amazing that Instawork app can work. waiting for your good news.
from hyperview.
hi @adamstep , now we have implemented the effect of "back to previous page and refresh it's content" by usingaction=navigate
and url?timestamp=1234
;
so this is not urgent. pls note it.
thanks for all your effort.
from hyperview.
@terryatgithub Thank you, this is how I managed to get what I wanted in my app as well.
@adamstep I have to confirm that this is still an issue. I'm on version 0.73.0
from hyperview.
@hgray-instawork can you confirm this is still an issue with the new navigation support you built?
from hyperview.
Another related issue is that if I use close
or back
from within a form the data is not serialized as query parameters although the docs say it should.
If the element triggering the close navigation is a <form> or contained in a <form> element, the form's data will be serialized as query parameters and included in the request
navigate
however, does display this behavior but the doc's don't mention it.
from hyperview.
Ooh, I get it now why you mention it is a demo app issue. This is behavior we need to make our self in the Hyperview component's navigation functions correct?
from hyperview.
@rickheere , we have released 0.75.0 of Hyperview. This includes a new switch at the top to illustrate using the updated Hyperview Navigator setup. When the switch is enabled, the "close" and "back" navigation behaviors should work as expected.
Stay tuned for more examples in the near future.
from hyperview.
Hi @hgray-instawork, it doesn't seem like this new release and feature has been updated to the live document on https://hyperview.org. I have just visited the website doc section to read about the new Navigation implementation but nothing about navigate.
from hyperview.
Hi @eazuka, you should be able to see it in the Reference
section of the site. If you look at the bottom of the sidebar you should see a new "Hyperview Navigation" section. It includes references for the navigator and nav-route components:
Regarding examples, there are none posted in the Examples
section of the site but they are included in the "demo" directory of the source code.
I hope that helps.
from hyperview.
Thanks @hgray-instawork. yes i did checked the Reference section but i was expecting to see it under the Display Elements, didn't know it was at the bottom. Thanks for pointing out the location.
from hyperview.
Great thanks for confirming @eazuka!
from hyperview.
Related Issues (20)
- Web too ? HOT 3
- Date field value is not always YYYY-MM-DD HOT 1
- Incomplete documentation of Hyperview component HOT 1
- What would be a good way to trigger a tree update but from outside of XML? HOT 3
- Example app: Navigation to home doesn't work. HOT 3
- Example app: Scroll to list item doesn't work HOT 4
- Is _web_ URL routing (and reverse routing) supported? HOT 1
- <Image /> Local URL not working HOT 1
- Support connecting external navigation for screen with undefined navigation parameters HOT 2
- `trigger="visible"` behaviour is different on iOS than on Android when navigating screens using react-navigation HOT 3
- xmldom parserError - How to debug HOT 5
- Document fragments HOT 1
- django-hyperview package HOT 1
- Scroll indicator is shown for `<view trigger="refresh" scroll="true" shows-scroll-indicator="false"/>` HOT 5
- Congratulations on a 1000 stars. HOT 1
- Debounce not working with with `change` tigger. HOT 3
- Style and design systems HOT 1
- TypeScript types do not seem to be published with the NPM package. HOT 6
- Spelling/grammar mistake on hyperview.org HOT 1
- List refresh control does not follow orientation
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hyperview.