You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi !
I just observed a strange behavior building a client-server Eliom application, I report it in case it is a bug.
I used ocsigen-start and customized it this way:
(* inside app_name_handlers.eliom *)
let%shared wish_page =
let open Eliom_content.Html.D in
let wish_input = (Raw.input ~a:[a_input_type `Text]) () in
let wish_submit = (Raw.input ~a:[a_input_type `Submit; a_value "Send"]) () in
let wish_list = div ~a:[a_id "wish-list"] [] in
[%client (
let open Js_of_ocaml_lwt.Lwt_js_events in
async (fun () -> let open Eliom_content.Html in
clicks (To_dom.of_input ~%wish_submit)
(fun _ _ -> let open Js_of_ocaml in
let wish = Js.to_string (To_dom.of_input ~%wish_input)##.value in
let%lwt ok =
Eliom_client.call_ocaml_service
~service:~%App_name_services.wish_service () wish
(* ocaml service that returns a unit *)
in
Lwt.return(ok)
)): unit)];
Eliom_content.Html.D.div [wish_input; wish_submit; wish_list]
let%shared main_service_handler myid_o () () =
Docgenius_container.page
~a:[ a_class ["os-page-main"] ]
myid_o (
[ wish_page
; p [%i18n welcome_text1]
<default ocsigen-start code> ...
App_name_services.wish_service is defined and registered as one would expect, and the app builds up fine. The page displays then as expected and:
If I write something in the input field, I can click on the submit button, and it triggers expected behavior.
But then, if I refresh the page, submit button disappears. I can however get it back clicking on the link to the main page (but the if I refresh again, the button disappears again).
I fixed it making wish_page a function that takes a unit as a parameter.
Maybe it is a normal behavior of Eliom_content.Html.D.Raw input elements due to nature of D elements ?
Have a good day !
The text was updated successfully, but these errors were encountered:
RuyBlast
changed the title
Eliom_content.Html.D.Raw.input submit disappear from page on refresh
Eliom_content.Html.D.Raw.input submit disappears from page on refresh
Mar 27, 2020
Hi !
I just observed a strange behavior building a client-server Eliom application, I report it in case it is a bug.
I used ocsigen-start and customized it this way:
App_name_services.wish_service is defined and registered as one would expect, and the app builds up fine. The page displays then as expected and:
If I write something in the input field, I can click on the submit button, and it triggers expected behavior.
But then, if I refresh the page, submit button disappears. I can however get it back clicking on the link to the main page (but the if I refresh again, the button disappears again).
I fixed it making wish_page a function that takes a unit as a parameter.
Maybe it is a normal behavior of Eliom_content.Html.D.Raw input elements due to nature of D elements ?
Have a good day !
The text was updated successfully, but these errors were encountered: