Predefined filter with form: Keep values when same attribute or xpath more than once

michaelk5974358

26-10-2017

Hello

Here is a part of the form of the predefined filter “By age range”:

<form colcount="3">

<enter>

<set value="0" xpath="/tmp/@min"/>

<set value="0" xpath="/tmp/@max"/>

</enter>

<container colcount="2">

<input label="Minimum age" minValue="0" noTransaction="true" type="number" xpath="/tmp/@min"/>

<input label="Maximum age" minValue="0" noTransaction="true" type="number" xpath="/tmp/@max"/>

</container>

I did something similar with dates (minimum and maximum date). But if I use the “/temp/” path the inserted values are not kept when I later come back.

In contrast to this is the form of the predefined filter “By name or email”, where the values are kept when I come back later:

<form colcount="2">

<input noTransaction="true" xpath="@lastName"/>

<input noTransaction="true" xpath="@email"/>

</form>

But I can’t do it that way because in my case it would be something like:

<form colcount="2">

<input label="Minimum date of deliveries" noTransaction="true" type="datetime" xpath="execution/@broadStartDate"/>

<input label="Maximum date of deliveries" noTransaction="true" type="datetime" xpath="execution/@broadStartDate"/>

</form>

So the xpath for both input tags is the same ("execution/@broadStartDate"), and I see no way of dealing with it in the filter conditions of the General tab.

So: Is there a solution, where I can use the same attribute or xpath in the form of a predefined filter twice in a way that the inserted values are kept, so I can see them when later I come back?

Michael

Accepted Solutions (1)

Accepted Solutions (1)

Jean-Serge_Biro

MVP

30-10-2017

Hi Michael,

Sorry you are right!

I was using as is for so long time that I thought it was off-the-shelf feature for age predefined filter.

So with a bit additional test, if you duplicate the factory filter on age to create a similar one withour the enter section, or your filter on broadStartDate, but without the enter section with values=0 initialisation, you won't lost the values entered by switching back and forth.

That works fine

Regards
J-Serge

Answers (3)

Answers (3)

michaelk5974358

27-10-2017

Hi Jean-Serge,

no, this is not the problem. It works even with age, if i do NOT use the path "/temp/" (the value is shown in the form also when I come back later, in a solution where I only use ONE age field).

But I do not find a way to do it without "/temp/", if there are 2 attributes or xpath of the same kind: be it 2 with "age" or in my special case 2 with "broadStartDate".

Michael

Jean-Serge_Biro

MVP

26-10-2017

Hi Michael,

Yes, it is an usual behavior; I think it is because age is a calculated element of the schema; so you loose the filter criteria cache when you leave the form.

Regards.
J-Serge