Skip to content

Commit

Permalink
add value option to input field.
Browse files Browse the repository at this point in the history
  • Loading branch information
wildone committed Jun 21, 2024
1 parent afac6ef commit 3a48dd3
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
"sling:resourceType": "wcm/dialogs/components/include",
"path": "/apps/typerefinery/components/forms/form/common/placeholder"
},
"fieldValue": {
"sling:resourceType": "wcm/dialogs/components/include",
"path": "/apps/typerefinery/components/forms/form/common/fieldValue"
},
"inputType": {
"sling:resourceType": "wcm/dialogs/components/select",
"name": "inputType",
Expand Down Expand Up @@ -52,10 +56,15 @@
"label": "Date",
"value": "date"
},
"time": {
"hidden": {
"sling:resourceType": "wcm/dialogs/components/select/selectitem",
"label": "Time",
"value": "time"
},
"time": {
"sling:resourceType": "wcm/dialogs/components/select/selectitem",
"label": "Hidden (but, visible in edit mode)",
"value": "hidden"
}
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@
component="${model.componentName}"
isInput="true"
id="${model.id}"
type="${model.inputType}"
type="${wcmmode.isEdit && model.inputType == 'hidden' ? 'text' : model.inputType}"
name="${model.name}"
value="${model.value}"
data-fieldId="${model.parentFieldId}"
placeholder="${model.placeholder}"
class=" ${model.variantClassNames}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
"sling:resourceType": "wcm/dialogs/components/include",
"path": "/apps/typerefinery/components/forms/form/common/placeholder"
},
"fieldValue": {
"sling:resourceType": "wcm/dialogs/components/include",
"path": "/apps/typerefinery/components/forms/form/common/fieldValue"
},
"inputType": {
"sling:resourceType": "wcm/dialogs/components/select",
"name": "inputType",
Expand Down

0 comments on commit 3a48dd3

Please sign in to comment.