--
You received this message because you are subscribed to the Google Groups "HAL Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hal-discuss...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/hal-discuss/b4673162-a4c7-4403-b6f5-2dbb0e83095en%40googlegroups.com.
Thanks for the clarification!Is my understanding correct, that this approach effectively doubles the round trips to the database (if no caching is in place)?
First to get the HAL representation of the resource and a second time to get the HAL-FORMS representation to fill in the "value" properties.
How should a human driven UI decide whether to display a form immediately or hide it behind a button?I'm thinking about the difference between an edit form on its own page and a button "create new" on a list view.
To view this discussion on the web, visit https://groups.google.com/d/msgid/hal-discuss/e5c6cdaf-61a7-4c10-829f-3837bac3f991n%40googlegroups.com.
I'm currently trying to implement a HAL-Forms server and Client.The more I'm programming, the more I come to the insight that the spec is a little bit unclear how to present the form to the user if the value of a property is missing or empty.As stated above, the spec states that it should be treated as an empty string.However from the example it looks as if the client must fill in the values from the previous HAL response (The one that contained the link to the resource).
Implementing it that way, the client could cache the form and reuse it.This would mean, that we need at least 11 requests to display 10 resource (1 FORM and 10 HAL)
But if you closely follow the spec, you must send different forms (or the same form, but with different values) for each resource.
This would mean, that we need at least 20 requests to display 10 resource (10 FORM and 10 HAL)
However if you follow solution 1) and implement the server in such a way that the same endpoint can server HAL and HAL-Forms and the client would always request HAL-Forms,you only need at least 10 requests to display 10 resources (10 FORM).
So I'm also seeing that they both are just different representations of the same resource and the client should request whatever it needs.This will probably boil down to having clients without user interaction using HAL while clients that display an UI would use HAL-Forms.At the moment I'm implementing it using the 20 requests as this is closest to the spec, although I do not really like it.
To view this discussion on the web, visit https://groups.google.com/d/msgid/hal-discuss/65210002-d3b5-463e-b663-599d8ca637een%40googlegroups.com.
Thanks for the reply :)> the spec does not say you MUST fill in. this is a choice you can make as a developer. same as HTML forms, XFORMS, etc.If you define a <input type="text" value="foo" /> The browser will render the value defined in the text box.As written above, under 3.3.1.7. value, the specification states:"If it does not exist, clients SHOULD act as if the value property is set to an empty string."
I read this as: "If the value is missing, a blank input field SHOULD be rendered. If you try to follow the spec closely, a SHOULD becomes a MUST.
So if the value is empty, I MUST NOT fill in any value into the input field.
Do you have an example app running somewhere that I could have a look at?
To view this discussion on the web, visit https://groups.google.com/d/msgid/hal-discuss/4795ef7d-5335-4302-adba-45c1b6c7b17cn%40googlegroups.com.
Thanks for the links, these cleared up some things for me.I found out, just using http instead of https for the herokuapp SPA makes it work.Although i got a lot of 404s when navigating the app, one of the most important parts, I found out was that you are using placeholder values, like {id}, {name} and so on as values for your forms.This is the indicator for your app to fill in the values of the previous HAL response.I think, this is a very important part and this should be covered in the spec if it is intended to be the way how clients should fill in the form templates.Otherwise people might just implement different interpretations of how values should be filled in (as you can see above, my first assumption was that an empty value was the indicator to fill in the values of the previous HAL response).
To view this discussion on the web, visit https://groups.google.com/d/msgid/hal-discuss/fee24d5f-6524-43b3-8299-ea7ccc5690ddn%40googlegroups.com.
I know that it is not part of the spec.But by making it (or something else) part of the spec, it would give developers a guidance on how implement forms that can be cached locally and reused.
Without any guidance, each developer has to come up with his own local solution which makes it impossible to cover all corner cases and develop a
"universal" HAL-Forms client.
To view this discussion on the web, visit https://groups.google.com/d/msgid/hal-discuss/0470b39b-0ffb-446d-8fd3-fa28b102e462n%40googlegroups.com.