I built a form and created a custom composite element in this form. Webform with custom composite element

I would like to add the table header in the red marked area. So I added the Table Header Label like this one Add Table Header Label

After adding the Table Header Label, my custom composite element turned into the table display Custom Composite element turned into the table display.

Comments

sea2709 created an issue. See original summary.

sea2709’s picture

Version: 6.0.0-alpha20 » 6.0.0-alpha15
jrockowitz’s picture

Status: Active » Postponed (maintainer needs more info)
StatusFileSize
new79.95 KB

I am not able to replicate this issue using any of the below example elements

custom_composite_columns:
  '#type': custom_composite
  '#title': custom_composite_columns
  '#element':
    textfield:
      '#type': textfield
      '#title': textfield
    select:
      '#type': select
      '#options':
        one: One
        two: Two
        three: Three
      '#title': select
custom_composite_no_columns:
  '#type': custom_composite
  '#title': custom_composite_no_columns
  '#multiple__header': false
  '#multiple__header_label': table_header_label
  '#element':
    textfield:
      '#type': textfield
      '#title': textfield
    select:
      '#type': select
      '#options':
        one: One
        two: Two
        three: Three
      '#title': select
address_columns:
  '#type': webform_address
  '#title': address_columns
  '#multiple': true
  '#multiple__header': true
  '#multiple__header_label': table_header_label
address_no_columns:
  '#type': webform_address
  '#title': address_no_columns
  '#multiple': true
  '#multiple__header_label': table_header_label

Can you please post an example?

sea2709’s picture

Please look at the second element "custom_composite_no_columns". As you can see, it is being displayed in columns mode. If I remove the table_header_label of this element, then the element will display in rows.

sea2709’s picture

Status: Postponed (maintainer needs more info) » Active
jrockowitz’s picture

StatusFileSize
new2.41 KB

Here is a very rough patch that adds dedicated support for a #header_label property.

sea2709’s picture

I confirm #6 patch works on my current project (D9.05 & PHP7.4)

jrockowitz’s picture

Version: 6.0.0-alpha15 » 8.x-5.x-dev
jrockowitz’s picture

Version: 8.x-5.x-dev » 6.x-dev
jrockowitz’s picture

Status: Active » Needs review
StatusFileSize
new13.46 KB

This patch definitely has to be committed to only the 6.x branch, since some people might have the #header and #header_label set.

The attached patch has some additional test coverage.

  • jrockowitz authored e8ae4d2 on 6.x
    Issue #3178432 by jrockowitz, sea2709: Table header label does not show...
jrockowitz’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.