Giter Club home page Giter Club logo

Comments (19)

adamstep avatar adamstep commented on July 2, 2024 1

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.

adamstep avatar adamstep commented on July 2, 2024 1

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.

hgray-instawork avatar hgray-instawork commented on July 2, 2024 1

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.

hgray-instawork avatar hgray-instawork commented on July 2, 2024 1

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.

terryatgithub avatar terryatgithub commented on July 2, 2024

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.

adamstep avatar adamstep commented on July 2, 2024

@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 href screen/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, because href 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.

terryatgithub avatar terryatgithub commented on July 2, 2024

Hi @adamstep , thanks for your kind detailed reply. I think I understand your intentional design. It's nice.

  1. 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>.
image

  1. My Question 2 is:
    in the intentional design, where to trigger the make 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.

image

from hyperview.

adamstep avatar adamstep commented on July 2, 2024

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.

terryatgithub avatar terryatgithub commented on July 2, 2024

ok, it's amazing that Instawork app can work. waiting for your good news.

from hyperview.

terryatgithub avatar terryatgithub commented on July 2, 2024

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.

rickheere avatar rickheere commented on July 2, 2024

@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.

adamstep avatar adamstep commented on July 2, 2024

@hgray-instawork can you confirm this is still an issue with the new navigation support you built?

from hyperview.

rickheere avatar rickheere commented on July 2, 2024

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.

rickheere avatar rickheere commented on July 2, 2024

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.

hgray-instawork avatar hgray-instawork commented on July 2, 2024

@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.

eazuka avatar eazuka commented on July 2, 2024

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.

hgray-instawork avatar hgray-instawork commented on July 2, 2024

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.

eazuka avatar eazuka commented on July 2, 2024

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.

hgray-instawork avatar hgray-instawork commented on July 2, 2024

Great thanks for confirming @eazuka!

from hyperview.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.