Questions tagged [phoenix-live-view]

Phoenix LiveView is a feature of Elixir's Phoenix framework that enables rendering web pages on the server via HEEx templates, and updating them via websockets / Phoenix Channels. Use this tag together with [elixir] and/or [phoenix-framework] for questions specific to this feature.

Official github repository: https://github.com/phoenixframework/phoenix_live_view

138 questions
2
votes
1 answer

How can I add LiveView to an existing Elixir/Phoenix app?

I want to change a form in my existing Phoenix app to use LiveView so I can take advantage of the better image uploading capability described here. However the documentation that I've seen only talks about running mix phx.new my_app --live to set it…
ijt
  • 3,505
  • 1
  • 29
  • 40
2
votes
1 answer

Why is Phoenix LiveView Function `push_event` undefined?

I want to send an Event from liveView server to the Client, with this funtion: def handle_event("test", _, socket) do {:noreply, push_event(socket, "testEvent", %{coins: 23, user: "user"})} end This is explained very similar in the docs of…
franz909
  • 182
  • 2
  • 15
2
votes
3 answers

Reset form input field after submit in Phoenix LiveView

I have a form in Phoenix LiveView with a phx-submit binding. The form can be submitted by either clicking the "Send" button or by pressing the enter key in the text field. My problem is that if I submit the form by pressing the enter key, the input…
user2615926
2
votes
1 answer

LiveView throws no component for CID error in console

I have a liveview called Menu with 3 Live Component Categories, Products, and Variants phx-click set up on each category, product, so when click on category, handle_event will return assign(socket, :products, products) ProductsComponent will…
lusketeer
  • 1,890
  • 1
  • 12
  • 29
2
votes
1 answer

Update the value of a form field after phx-change

I have a LiveView application which searches for airport codes. When a user enters ham it should replace the content of that form field with HAM (String.upcase/1) but it doesn't. But according to my understanding of my code it should. What do I have…
wintermeyer
  • 8,178
  • 8
  • 39
  • 85
2
votes
1 answer

Trigger change on value of form field change

I have a liveview form and a text input: <%= search_input :filter, :search, id: "filter_search_field", class: "input", placeholder: "Search", value: @search_field, "phx-debounce": "300"%> Now there is a moment when I want to clear this field…
Daniel
  • 2,320
  • 1
  • 14
  • 27
1
vote
2 answers

Cannot compile ssl_verify_fun in Windows 11

Background I have a phoenix application in Windows 11. Unfortunately for me, I cannot compile the application because of a dependency error in Windows. What I tried First I tried the downloading Erlang from the official website…
Flame_Phoenix
  • 16,489
  • 37
  • 131
  • 266
1
vote
1 answer

Phoenix 1.7 welcome page assets not showing properly

Background I have a a fresh umbrella project with a Phoenix app inside. To create the app I used the following commands: mix new test_app --umbrella cd test_app/apps mix phx.new.web web_interface --no-dashboard --no-ecto --no-gettext --no-mailer cd…
Flame_Phoenix
  • 16,489
  • 37
  • 131
  • 266
1
vote
1 answer

Fresh new 1.7 Phoenix app inside umbrella fails build

Background I have a fresh umbrella app and I am trying to create a Phoenix app inside it. However, even though I can create the Phoenix app inside the umbrella, I cannot build it successfully. Problem I am creating a phoenix app inside a fresh…
Flame_Phoenix
  • 16,489
  • 37
  • 131
  • 266
1
vote
1 answer

Elixir/Phoenix LiveView documentation for conditional rendering attributes like :if

I can't find it for the life of me. Does Phoenix have documentation for these attributes used with templates? Sigh. // where is documentation?
0 result.
Jonathan Lightbringer
  • 435
  • 2
  • 12
  • 27
1
vote
0 answers

Elixir Phoenix Liveview Form Submission Problem With Disabling Submit Button

In a liveview, I have a form that is defined like this: <.form let={f} for={:user} action={Routes.user_path(@socket, :create)} phx-change="validate_changeset" phx-debounce="blur", as={:user}> ... The submit button looks like this: <%=…
paulrusu
  • 117
  • 1
  • 7
1
vote
1 answer

Modify AlpineJs X-Data from Elixir Phoenix Liveview's JS Library

In an elixir phoenix liveview, I have a modal that is opened like so: and then
What I would want to do is to,…
paulrusu
  • 117
  • 1
  • 7
1
vote
1 answer

Updating nested html element in LiveView of Phoenix application without rendering the whole component

I have the following leex template with a collection of cards and inside each card, there is a nested button. I would like to update the text on the button only without rendering again the whole component. Is it possible? I am stuck here. The idea…
Dmitry Dyachkov
  • 1,715
  • 2
  • 19
  • 46
1
vote
1 answer

How to call handle_event from test using Elixir Live View

In LiveView how do I call a handle_event from within a test. @impl true def handle_event("do_thing", _, socket) do send(self(), :do_the_thing) {:noreply, assign(socket, :cycler, true)} end
bezzoon
  • 1,755
  • 4
  • 24
  • 52
1
vote
0 answers

Phoenix framework: How to decode Phoenix Session Cookie with Java

I am trying two different ways to decode Phoenix Session Cookie. First one is Elixir's interaction shell, and the second one is with Java. Please see the following examples; IEx iex(1)> set_cookie =…
1 2
3
9 10