How to set empty string value in Rule
Author: cpe
Publication Date: 5/23/2023 10:50
Greetings, dear Community!
I have a Combobox with multible values and an Radiobutton with two entries: a value and an empty string (<ENTRY value="">).
Depending on the value of the Combobox, I want to set the value of the Radiobutton. If both entries of the Radiobutton have values, everything works fine. But if I try to set the value to an empty string (<TEXT></TEXT>) in the rule, I get the error "expected token 'Text', got 'Closing tag'.
If I instead use EMPTY and not VALUE in the PROPERTY, the value is set to null and non of the Radiobuttons is selected.
As I am using the value of the Radiobutton in the HTML, the right value would be appreciated.
There is some code, if anyone wants to test around:
The Form parts:
<CMS_INPUT_RADIOBUTTON name="st_text_color" hFill="yes" preset="default" useLanguages="no"> <ENTRIES> <ENTRY value="grey"> <LANGINFOS> <LANGINFO lang="*" label="Grey"/> </LANGINFOS> </ENTRY> <ENTRY value="white"> <LANGINFOS> <LANGINFO lang="*" label="White"/> </LANGINFOS> </ENTRY> </ENTRIES> <LANGINFOS> <LANGINFO lang="*" label="Text Color"/> </LANGINFOS> </CMS_INPUT_RADIOBUTTON> <CMS_INPUT_COMBOBOX name="st_background_color" hFill="yes" singleLine="no" useLanguages="no"> <ENTRIES> <ENTRY value="grey"> <LANGINFOS> <LANGINFO lang="*" label="Grey"/> </LANGINFOS> </ENTRY> <ENTRY value="dark-grey"> <LANGINFOS> <LANGINFO lang="*" label="Dark Grey"/> </LANGINFOS> </ENTRY> <ENTRY value="red"> <LANGINFOS> <LANGINFO lang="*" label="Red"/> </LANGINFOS> </ENTRY> <ENTRY value="dark-red"> <LANGINFOS> <LANGINFO lang="*" label="Dark Red"/> </LANGINFOS> </ENTRY> <ENTRY value="black"> <LANGINFOS> <LANGINFO lang="*" label="Black"/> </LANGINFOS> </ENTRY> <ENTRY value="white"> <LANGINFOS> <LANGINFO lang="*" label="White"/> </LANGINFOS> </ENTRY> <ENTRY value="medium-grey"> <LANGINFOS> <LANGINFO lang="*" label="Medium Grey"/> </LANGINFOS> </ENTRY> <ENTRY value="silver-grey"> <LANGINFOS> <LANGINFO lang="*" label="Silver Grey"/> </LANGINFOS> </ENTRY> <ENTRY value="light-grey"> <LANGINFOS> <LANGINFO lang="*" label="Light Grey"/> </LANGINFOS> </ENTRY> <ENTRY value="dimmed-white"> <LANGINFOS> <LANGINFO lang="*" label="Dimmed White"/> </LANGINFOS> </ENTRY> </ENTRIES> <LANGINFOS> <LANGINFO lang="*" label="Background Color"/> </LANGINFOS> </CMS_INPUT_COMBOBOX>And my rules:
<RULE> <IF> <OR> <EQUAL> <PROPERTY name="ENTRY" source="st_background_color"/> <TEXT>white</TEXT> </EQUAL> <EQUAL> <PROPERTY name="ENTRY" source="st_background_color"/> <TEXT>silver-grey</TEXT> </EQUAL> <EQUAL> <PROPERTY name="ENTRY" source="st_background_color"/> <TEXT>light-grey</TEXT> </EQUAL> <EQUAL> <PROPERTY name="ENTRY" source="st_background_color"/> <TEXT>dimmed-white</TEXT> </EQUAL> </OR> </IF> <WITH> <TEXT></TEXT> </WITH> <DO> <PROPERTY name="VALUE" source="st_text_color"/> </DO> </RULE> <RULE> <IF> <OR> <EQUAL> <PROPERTY name="ENTRY" source="st_background_color"/> <TEXT>grey</TEXT> </EQUAL> <EQUAL> <PROPERTY name="ENTRY" source="st_background_color"/> <TEXT>dark-grey</TEXT> </EQUAL> <EQUAL> <PROPERTY name="ENTRY" source="st_background_color"/> <TEXT>red</TEXT> </EQUAL> <EQUAL> <PROPERTY name="ENTRY" source="st_background_color"/> <TEXT>dark-red</TEXT> </EQUAL> <EQUAL> <PROPERTY name="ENTRY" source="st_background_color"/> <TEXT>black</TEXT> </EQUAL> <EQUAL> <PROPERTY name="ENTRY" source="st_background_color"/> <TEXT>medium-grey</TEXT> </EQUAL> </OR> </IF> <WITH> <TEXT>white</TEXT> </WITH> <DO> <PROPERTY name="VALUE" source="st_text_color"/> </DO> </RULE>I think, this problem is due to XML seeing an empty string as the same as null, but maybe someone has come across this and has found another solution!?
Cheers
Connz
Please sign in to leave a comment.
Comments
0 comments