ltgaxkeh

ltgaxkeh

Same page rendering

Hi again! How can I achieve page rendering of two templates in one html.

Consider the image below:

My goal is that after I click submit button, the table below will load. But the values from input fields above will stay. I only want the table to be rendered not the whole page. Pardon me but I cannot get the logic on how I will approach this since I’m still newbie in Elixir.

Most Liked

LostKobrakai

LostKobrakai

There are two general ways to achieve that. Either use JS on the client side to update only parts of the website – drab is also JS even though it’s controlled from the server – or you can just re-render the whole page filling the form with the selected values, which is what phoenix’s html form helper can do.

ltgaxkeh

ltgaxkeh

Will try to look at Drab. I’m trying to avoid of rendering the whole page again with the selected values since the input Payor Code has pre-selected values upon clicking the search button besides it. And upon choosing the option, the revenue source is filled up based on chosen option from Payor Code. All data source came from APIs. Rendering the whole page means connecting to API and loading again the data.

I greatly appreciate the ideas. It’s getting more fun along the way studying and developing with elixir.

OvermindDL1

OvermindDL1

Drab or Unpoly here. I’d probably grab unpoly for this as it’s overall significantly less code to write anywhere, you’ll just add a few decorations to your html template and load the script in, this is practically the kind of stuff unpoly is made for.

Drab would be better if you plan to do a lot more, but just simple element replacing between pages is where unpoly rules with a very short amount to write.

Where Next?

Popular in Questions Top

senggen
Erlang/OTP 25 [erts-13.2.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] 15:22:35.803 [error] gen_event {lager_file_backend...
New
vonH
In asking this question I am more interested about the expressiveness of the language itself and less concerned about the availability of...
New
albydarned
Hello all! I am typing this post from my new MacBook Pro with the M1 chip. I’m loving it so far, and will probably use it as my daily dr...
New
openscript
Hello! Sorry for this astonishing simple question, but I’m really stuck. I try to set up the intellij-elixir plugin, but I don’t know ho...
New
ycv005
I have followed this StackOverflow post to install the specific version of Erlang. And When I am running mix ecto.setup then getting fol...
New
hariharasudhan94
I would like to know what is the best IDE for elixir development?
New
lastday4you
I wanted to check elixir version in phoenix because i found that my elixir is 1.5 but when i use Enum.chunk_by it said the function is un...
New
Phillipp
Hey, I have a NanoPi-M3 and try to install Elixir on their Ubuntu image. I followed the Raspberry Pi installation instructions from the ...
New
Patoshizzle
After calling mix ecto.create I get this error: 17:00:32.162 [error] GenServer #PID<0.412.0> terminating ** (Postgrex.Error) FATAL...
New
jc00ke
Expanding on this topic: https://forum.elixirforum.net/t/map-typespec-question/19217 Let’s say I have a map with required and optional k...
New

Other popular topics Top

Qqwy
Update: How to use the Blogs & Podcasts section You can post links to your blog posts or podcasts either in one of the Official Blog...
3268 119930 1237
New
shahryarjb
Hello, I get Persian date from my client and convert it to normal calendar like this: def jalali_string_to_miladi_english_number(persi...
New
sorentwo
Hello! tl;dr Announcing Oban, an Ecto based job processing library with a focus on reliability and historical observability. After spen...
977 41022 311
New
itssasanka
Hi all, Trying to get some more clarity over utc_datetime and naive_datetime for Ecto: https://hexdocs.pm/ecto/Ecto.Schema.html#module-...
New
axelson
This post is a wiki (feel free to hit the edit button near the bottom right of this post to add your own changes!) This post collects co...
239 45766 226
New
jononomo
I am trying to figure out how Mix knows whether the environment is test, dev, or prod -- where is this set? Thanks.
New
Jim
As a follow up to my earlier question: I have the code compiling and running but not getting a successful login from the rest server. ...
New
johnnyicon
Hi all, I've just started learning Elixir and Phoenix Framework, so please pardon my n00bness at this stage. I'm trying to use Postg...
New
Qqwy
Original source of discussion: This topic on the Pragmatic Programmers' Functional Web Development with Elixir, OTP, and Phoenix forum. ...
New
AstonJ
by Lance Halvorsen Elixir and Phoenix are generating tremendous excitement as an unbeatable platform for building modern web application...
460 27162 124
New

We're in Beta

About us Mission Statement