https://htmx.org logo
Join Discord
Powered by
# htmx-general
  • r

    ripe-action-67367

    08/30/2022, 4:43 PM
    disregard
  • s

    stocky-dentist-80693

    08/30/2022, 4:44 PM
    Can you return a new
    <button ...>
    element in the response that has the correct URL?
  • g

    green-army-74971

    08/30/2022, 4:48 PM
    bit of a different approach, but this could possibly work. i guess htmx processes the response it gets?
  • s

    stocky-dentist-80693

    08/30/2022, 4:48 PM
    Correct, htmx will automatically process the response.
  • s

    stocky-dentist-80693

    08/30/2022, 4:49 PM
    The options you have are outlined in "Update other content" - https://htmx.org/examples/update-other-content/
  • s

    stocky-dentist-80693

    08/30/2022, 4:50 PM
    I find solutions #1 and #2 are the best for most cases.
  • g

    green-army-74971

    08/30/2022, 4:57 PM
    thx. i'm actually using essentially #3 on the site already - i find it works quite elegantly with alpine.js - htmx returns some extra data in a HX-Trigger header, alpine catches that event and update its data store with the new data, then updates the page accordingly - pretty neat. in fact the thing i'm currently trying to get to work starts with one of those interactions. but maybe i should use #1 or #2 just as it's a straightforward way to get the thingy reprocessed.
  • g

    green-army-74971

    08/30/2022, 4:58 PM
    i'll struggle on with this approach for a little bit longer and will probably use one of those if i can't get it to work, thx.
  • m

    mysterious-toddler-20573

    08/30/2022, 5:04 PM
    You could override the URL in the
    htmx:configRequest
    event
  • m

    mysterious-toddler-20573

    08/30/2022, 5:05 PM
    I need to update htmx to not hard code the url, this comes up a lot
  • g

    green-army-74971

    08/30/2022, 5:12 PM
    ah, so that's triggered after the element is (say) clicked, just before it sends the request? yeah, that could work too, thx.
  • m

    mysterious-toddler-20573

    08/30/2022, 5:12 PM
    yeah, you could consult the property and update the url (iirc)
  • m

    mysterious-toddler-20573

    08/30/2022, 5:12 PM
    one sec
  • m

    mysterious-toddler-20573

    08/30/2022, 5:12 PM
    https://htmx.org/events/#htmx:configRequest
  • g

    green-army-74971

    08/30/2022, 5:13 PM
    yeah, i'm there 😉
  • m

    mysterious-toddler-20573

    08/30/2022, 5:13 PM
    i don't think the url is doc'd but I believe it's in there, looking
  • g

    green-army-74971

    08/30/2022, 5:13 PM
    that's ok, i can check
  • m

    mysterious-toddler-20573

    08/30/2022, 5:13 PM
    https://github.com/bigskysoftware/htmx/blob/master/src/htmx.js#L2707
  • m

    mysterious-toddler-20573

    08/30/2022, 5:13 PM
    yeah, path
  • g

    green-army-74971

    08/30/2022, 5:13 PM
    cool, thx
  • g

    green-army-74971

    08/30/2022, 5:14 PM
    fan of ur work, btw! grug-brained admirer.
  • m

    mysterious-toddler-20573

    08/30/2022, 5:17 PM
    🙂 glad you are finding it useful, I need to make the hx-get, etc. dynamic bc this comes up a lot 😑
  • p

    proud-librarian-99598

    08/30/2022, 5:37 PM
    You can render partials in controllers with Thymeleaf. And with https://github.com/wimdeblauwe/htmx-spring-boot-thymeleaf you can combine multiple fragments into 1 response for OOB.
  • m

    mysterious-toddler-20573

    08/30/2022, 5:56 PM
    I have removed my calumny against thymeleaf!
  • a

    acoustic-autumn-94211

    08/30/2022, 6:04 PM
    had to re-read a couple of times myself - first thought was "partials!" before I realized what he's talking about. wonder how hard it would be to create a view result implementation that does this?
  • s

    square-analyst-94375

    08/30/2022, 8:12 PM
    hx-sync works great! Makes my UI look snappy again
  • m

    mysterious-toddler-20573

    08/30/2022, 8:15 PM
    https://tenor.com/view/nodding-yes-approve-approval-i-approve-gif-6191609
  • w

    witty-garage-37227

    08/30/2022, 8:24 PM
    @mysterious-toddler-20573 qq does
    hx-boot=true
    apply hx-indicator? I am trying to have a universal loader for all my top level menu items
  • w

    witty-garage-37227

    08/30/2022, 8:25 PM
    sorry my bad
  • w

    witty-garage-37227

    08/30/2022, 8:25 PM
    a typo
1...802803804...1146Latest