Multiple path tab setting -> go back

  • ssssadsadasd-1324090798442287206

    ssssadsadasd

    4 months ago

    When clicking a button I immediately set three url paths: tab1, tab2, tab3.
    When the user clicks the back button in the browser I want the user to go the page where the user was when the button was clicked.
    but the user is redirected to the tab1,tab2 url. [see video](https://vimeo.com/1043287886/ce6ed3573f?ts=0&share=copy)

    how can I go immediately to the original page (without refreshing the page)? see [test page](https://toddle.dev/projects/turquoise_o_en_lars_permanent_chicken/branches/start/components/test?leftpanel=design&canvas-width=800&canvas-height=800&rightpanel=events)
    thanks
    1324092253035302912-image.png
  • andreasmoller-1324253146985267253

    Andreas Møller

    4 months ago

    When you update part of the URL path you also update the browser’s history, when you update a quest param you do not.

    If you change the parameters that should not affect the path to be query parameters this won’t happen
  • ssssadsadasd-1325147492853223554

    ssssadsadasd

    4 months ago

    @Andreas Møller I am not sure I understand. why in [this ](https://vimeo.com/1043943801/235c69e4d7?ts=0&share=copy)case there are many path parameters changes but the history shows only one entry? I think the same is true in bubble: it only shows one entry in the history when you change multiple path parameters. thanks
  • andreasmoller-1325148315544981596

    Andreas Møller

    4 months ago

    You are using two actions to update the parameters, so it updates the history twice
  • You can use goToUrl to do a single update, but that will cause a page reload
  • ssssadsadasd-1325148560357851216

    ssssadsadasd

    4 months ago

    hmmm I am not sure how I can update parameters all at once. when I set param1=param1/param2 then it evaluates literally and thus parameter2=null
  • ssssadsadasd-1325148997031301181

    ssssadsadasd

    4 months ago

    but that is my concern. I want to upload multiple path parameters without reloading the page. can I achieve this in toddle rn? thanks
  • andreasmoller-1325149318184828939

    Andreas Møller

    4 months ago

    No that is not possible. The best option would be to change some of the parameters to be query parameters
  • ssssadsadasd-1325149462938779689

    ssssadsadasd

    4 months ago

    ok thanks. no, I want them to be path parameters.
  • lucasg-1325149718455521292

    Lucas G

    4 months ago

    Can you calculate the values before setting the parameters?
  • andreasmoller-1325149810319425669

    Andreas Møller

    4 months ago

    I would like to better understand you use case. Do you think you could record a short video explaining it?
  • ssssadsadasd-1325150343813926976

    ssssadsadasd

    4 months ago

    think of twitter. when I click a tweet from homw (https://x.com/home) I want to go directly to (https://x.com/elonmusk/status/1875538271746634165) such that when the user click back it redirects to https://x.com/home directly
  • ssssadsadasd-1325150573540020244

    ssssadsadasd

    4 months ago

    I am not sure I understand this. what do you mean with calculate?
  • lucasg-1325150858287255704

    Lucas G

    4 months ago

    Why are your paths reliant on another? param1=param2
  • ssssadsadasd-1325150983025721386

    ssssadsadasd

    4 months ago

    it is just a wrong naming convention sorry. should be param1=value1
  • lucasg-1325151659751378975

    Lucas G

    4 months ago

    If you want to set the entire URL at once, you'd have to concat the entire thing before setting it
  • Otherwise, it's as Andreas said, each action will cause a history update
  • ssssadsadasd-1325152119199764541

    ssssadsadasd

    4 months ago

    but concatenation -> go to url -> page reload, right?
  • lucasg-1325152332924583988

    Lucas G

    4 months ago

    The entire thing could be a single param if you're really against reloads
  • ssssadsadasd-1325152731421479025

    ssssadsadasd

    4 months ago

    so a single param (which would look like param1/param2/param3) and then I have some variables that say:
    var1=param1.... right?
  • andreasmoller-1325153295010103348

    Andreas Møller

    4 months ago

    Any particular reason why you are building this as an SPA instead of using seperate pages?
  • ssssadsadasd-1325153746510024856

    ssssadsadasd

    4 months ago

    I actually tried to build it in separate pages initially, but when I went from page to page, the tabs of the sidebar (a reusable) showed "null" for a split second and then it showed the values.
    and I am not sure how going back behavior from page to page (e.g. if the page is where it was left)
    and I think twitter and similar are built as spa
  • ssssadsadasd-1325154636163842272

    ssssadsadasd

    4 months ago

    @Andreas Møller it is just this behavior in [the dashy template](https://dashy_dashboard.toddle.site/) https://vimeo.com/1043948095/4734279e53?ts=0&share=copy
  • ssssadsadasd-1325195998959767634

    ssssadsadasd

    4 months ago

    but yeah, the flick on the sidebar can be solved simply by setting the values of the tabs in the component rather than as an attributes