benjamin_nagel
I'm new here

Regeln und Werte löschen / Rules and delete values

Jump to solution

Hallo liebe Community,

ich würde gerne unter bestimmten Bedingungen den Wert einer Eingabekomponente durch eine Regel löschen. Dafür habe ich folgende Regel geschrieben:

<ON_EVENT>

    <IF>

        <!-- Meine Bedingung bei der ich den Wert löschen will -->

    </IF>

    <WITH>

        <!-------------------          

                    DAS MUSS LEER SEIN UM EINEN LEEREN WERT

                    IN st_test IM DO TEIL ZU SPEICHERN

        --------------->

    </WITH>

    <DO>

        <PROPERTY source="st_test" name="VALUE" />

    </DO>

</ON_EVENT>

Die Frage ist nun, ob das ein echtes Feature ist, oder ob es ein Bug ist... Oder gibt es eine Möglichkeit die ich bis jetzt übersehen habe?

Liebe Grüße

Benjamin

-------------------------------------------

Dear community,

I would like to delete under certain conditions the value of an input component by a rule. For this I have written the following rule:

<ON_EVENT>

    <IF>

        <!-- My condition when I like to delete the value -->

    </IF>

    <WITH>

        <!-------------------          

                    this must to be empty when I like to save a empty value

                    in st_text in the do part of the rule

        --------------->

    </WITH>

    <DO>

        <PROPERTY source="st_test" name="VALUE" />

    </DO>

</ON_EVENT>

The question now is whether this is a real feature, or if it is a bug ... Or is there a possibility that I've overlooked until now?

Greetings

Benjamin

1 Solution

Accepted Solutions

Emptying a Gadget's value is simply done by setting the property EMPTY of the gadget in the DO section. Any value computed in the WITH section will be ignored.

...

    <DO>
        <PROPERTY source="st_text" name="EMPTY" />
    </DO>

If this does not work in your case, please, report to helpdesk with all information available.

Cheers,

Stefan

View solution in original post

6 Replies
Peter_Jodeleit
Crownpeak employee

Could you try this syntax

<WITH><NULL/></WITH>

and report back?

See answer from Stefan below.

Peter
0 Kudos

Hello,

i can't save <NULL> or <NULL />.

When I try it I get the following Exception:

de.espirit.common.xml.XmlParsingError: unexpected tag 'NULL'

    at de.espirit.firstspirit.forms.rules.RuleParser.create(RuleParser.java:272)

    at de.espirit.firstspirit.forms.rules.RuleParser.readCondition(RuleParser.java:187)

    at de.espirit.firstspirit.forms.rules.RuleParser.create(RuleParser.java:260)

I use FS 5.0.210

Do I something wrong. My current code is:

<ON_EVENT>

    <IF>

        <!-- MY Statement -->

    </IF>

    <WITH>

          <NULL />

    </WITH>

    <DO>

        <PROPERTY source="st_text" name="VALUE" />

    </DO>

</ON_EVENT>

or

<ON_EVENT>

    <IF>

        <!-- MY Statement -->

    </IF>

    <WITH>

          <NULL>

    </WITH>

    <DO>

        <PROPERTY source="st_text" name="VALUE" />

    </DO>

</ON_EVENT>

Kind regards

Benjamin

0 Kudos

i can't save <NULL> or <NULL />.

The missing slash was a typo, I corrected it.

No, you do nothing wrong - I was unsure if this implemented. We support <TRUE/> and <FALSE/> as constants, but sadly not <NULL/>.

Your rule is working "by chance", this was not a planned use-case.

See answer from Stefan below.

Peter
0 Kudos

ok...

I created an idea and I hope my solution workes until this implementation.

https://community.e-spirit.com/ideas/1315

0 Kudos

Emptying a Gadget's value is simply done by setting the property EMPTY of the gadget in the DO section. Any value computed in the WITH section will be ignored.

...

    <DO>
        <PROPERTY source="st_text" name="EMPTY" />
    </DO>

If this does not work in your case, please, report to helpdesk with all information available.

Cheers,

Stefan

Sorry, I should have looked better - see the answer from Stefan.

Peter
0 Kudos