Question
Medium to Beginner Interface Doubt
This code does not allow to save input just because I initiate the locals as nulls ( I need them like that for it to be clean and tidy as an interface).
a!localVariables(
local!words_en:null,
local!words_de:null,
{
a!boxLayout(
label: "Add Words",
contents: {
a!sideBySideLayout(
items: {
a!sideBySideItem(
a!tagField(
tags: a!tagItem(
text: "English",
backgroundColor: "SECONDARY"
)
)
),
a!sideBySideItem(
a!tagField(
tags: a!tagItem(
text: "German",
backgroundColor: "SECONDARY"
)
)
),
a!sideBySideItem(
item: a!richTextDisplayField(
value: a!richTextIcon(
icon: "window-close",
color: "SECONDARY",
size: "MEDIUM",
),
marginAbove: "LESS"
),
width: "MINIMIZE"
)
}
),
a!forEach(
items: enumerate(count(local!words_en)),
expression: {
a!sideBySideLayout(
items: {
a!sideBySideItem(
item: a!textField(
value: index(local!words_en,fv!index,null),
saveInto: a!save(local!words_en[fv!index],save!value)
)
),
a!sideBySideItem(
item: a!textField(
value: index(local!words_de,fv!index,null),
saveInto: a!save(local!words_de[fv!index],save!value)
)
),
a!sideBySideItem(
item: a!richTextDisplayField(
value: a!richTextIcon(
icon: "window-close",
color: "NEGATIVE",
size: "MEDIUM",
link: a!dynamicLink(
saveInto: {
a!save(local!words_en,remove(local!words_en,fv!index)),
a!save(local!words_de,remove(local!words_de,fv!index)),
}
),
linkStyle: "STANDALONE"
),
marginAbove: "LESS"
),
width: "MINIMIZE"
)
}
)
}
),
a!richTextDisplayField(
value: a!richTextItem(
text: {
a!richTextIcon(icon: "PLUS"),
" ADD MORE"
},
link: a!dynamicLink(value: null, saveInto: {
a!save(local!words_en,append(local!words_en,save!value)),
a!save(local!words_de,append(local!words_de,save!value))
}
),
linkStyle: "STANDALONE"
)
)
},
marginBelow: "STANDARD",
style: "ACCENT"
)
}
)
