branch: test-major-pull-requests, broken radiogroup/radio

19 views
Skip to first unread message

Milan Svoboda

unread,
Sep 7, 2012, 1:26:56 AM9/7/12
to nitro...@googlegroups.com
The radiogroup is broken: it doesn't make a group so when you click on a radio it is always selected and never deselected.

Any idea how to fix it?

Milan

Jesse Gumm

unread,
Sep 7, 2012, 2:04:40 AM9/7/12
to nitro...@googlegroups.com
Thanks for the heads up, Milan.

Fixed. It looks to be broken by the addition of the restful elements.
The fix was nice and quick, and if you're interested, feel free to
read the comments in the code.

https://github.com/choptastic/nitrogen_core/commit/8e2aa7478b74ff64a3e735faeee7e62a513c5f95

Thanks again for the bug report, that's exactly what the
test-major-pull-requests branch is for right now! As I'm sure you can
see, I'm still integrating one last big pull request there (primarily
the mobile stuff, but augmenting my own helper elements to simplify
mobile integration, and set up users to more easily begin adding their
own mobile elements).

-Jesse
> --
> You received this message because you are subscribed to the Google Groups
> "Nitrogen Project / The Nitrogen Web Framework for Erlang" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/nitrogenweb/-/5voBqpjxsTAJ.
> To post to this group, send email to nitro...@googlegroups.com.
> To unsubscribe from this group, send email to
> nitrogenweb...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/nitrogenweb?hl=en.



--
Jesse Gumm
Owner, Sigma Star Systems
414.940.4866 || sigma-star.com || @jessegumm

Milan Svoboda

unread,
Sep 7, 2012, 2:25:05 AM9/7/12
to nitro...@googlegroups.com, gu...@sigma-star.com
Thanks!

Milan Svoboda

unread,
Sep 7, 2012, 2:54:32 AM9/7/12
to nitro...@googlegroups.com, gu...@sigma-star.com
Jesse,

It looks like that radiogroup is broken too.

This code works: Note the name=Name
      Name = wf:temp_id(),
      [#radiogroup{body=[
                  [[#radio{name=Name, text=Label, value=Value,
                           checked=if Selected == Value -> true; true -> false end},
                    #br{} ]
                   || {Label, Value} <- Options]
                  ]}]

But without name it behaves the same wrongly.

I would expect that radiogroup groups the radios and there should not be a need to specify name in the radio.

Milan Svoboda

unread,
Sep 7, 2012, 8:36:21 AM9/7/12
to nitro...@googlegroups.com, gu...@sigma-star.com
Ok, my fault.

Result of list comprehension needs to be flattened.

Milan

Jesse Gumm

unread,
Sep 7, 2012, 2:41:36 PM9/7/12
to nitro...@googlegroups.com

Interesting.

That leads me to thinking that a useful new function would be something like wf_render_elements:map_body, which would recursively map over all body elements to apply a function. That would eliminate the need to flatten the list before hand, and would simplify any other elements that need to do simple transformations of the contents of the body.

That seems like a useful thing to me.

--
Jesse Gumm
Owner, Sigma Star Systems
414.940.4866 || sigma-star.com || @jessegumm

--
You received this message because you are subscribed to the Google Groups "Nitrogen Project / The Nitrogen Web Framework for Erlang" group.
To view this discussion on the web visit https://groups.google.com/d/msg/nitrogenweb/-/TthtVIBCW2oJ.

Milan Svoboda

unread,
Sep 7, 2012, 4:44:31 PM9/7/12
to nitro...@googlegroups.com, gu...@sigma-star.com
Agree. Such function can be really useful.

Milan

Dne pátek, 7. září 2012 20:41:38 UTC+2 Jesse Gumm napsal(a):
Reply all
Reply to author
Forward
0 new messages