Forum OpenACS Q&A: Re: break out of a multiple tag?

Collapse
Posted by Tilmann Singer on
Tammy, are you sure you can't achieve what you want using the <group> tag? If there is a common attribute that is the same for those elements that you want to display in the same table row it should be possible, no?

Unfortunatly 'sections' don't add that attribute value to each element but rather insert their own separator element as far as I remember. But maybe you can add your own or add some semantics to the element id.

Collapse
Posted by tammy m on
Hey,

You may be on to something with the <group> tag! I can't find any attributes my form elements that I want to group share though. Is there a way I can add an attribute to my form elements? Then I could use <group> like is done for the section element in form styles.

Functionally, the 'sections' do put a separator in but the code to do it in the adp looks like <group column="section"> so I think it does this by adding an attribute to each element in a 'section.'

Collapse
Posted by Jeff Davis on
Here is a code snippet from acs-templating/resources/forms/standard.adp with a break. It's ugly and bad practice, but it does work (and I think might point to some places where it might make some sense to have a break tag).
<multiple name="elements">
  <if @form_properties.show_required_p@ true>
    <if @elements.optional@ nil and @elements.mode@ ne "display" and @elements.widget@ ne "inform" and @elements.widget@ ne "select" and @elements.widget@ ne "h
idden" and @elements.widget@ ne "submit">
       <span class="form-required-mark">*</span> #acs-templating.required# 
       <% break %>
    </if>
  </if>
</multiple>
Collapse
Posted by tammy m on
Wow,

Thanks Jeff:) How did I miss that?! I have been looking at form style standards all day. Bad eyes? Not to mention that, looking at the sample you posted, it seems so obvious now. Sigh. Programming is sometimes not so easy on the ego!