Forum OpenACS Development: Re: Templating: New widgets

Collapse
Posted by Bruno Mattarollo on

Hey Malte,

Made any progress on this? I am dealing with the same requirement here and I am starting to look at how to create a new widget that would do this.

Tried with creating a widget that would call [input radio ... ] and then append [input text ...] but since I have several options it creates a formgroup and adds the text input box next to every single option of the radio buttons, something like:

( ) [      ] option_label
( ) [      ] option2_label

Any suggestions?

Collapse
Posted by Bruno Mattarollo on
Just a small clarification, it's not really the "label" but the "name" of the option that shows up next to the input text ... :)
Collapse
Posted by Malte Sussdorff on
The way I was pursuing (but got distracted) is to change the /forms/standard.adp for radio. I added this check at the button to insert the textfield. This assumes the widget is called "radio_other". The widget itself would just call "input radio ....".

<if @elements.widget@ in other>
  <input type=text name=\mailto:"@elements.id@.other\">
</if>

Sadly, I did not get the chance to test this thoroughly (previously I was using a hack, where I hardcoded the "other" element as the last one of the options and did a check whether the label was named "other").

If you continue down that road, great, I'll be back on track on monday.