Atlassian JIRA   History | Log In     View a printable version of the current page. Get help!  
Issue Details [XML]

Key: XRP-8
Type: Bug Bug
Status: Closed Closed
Resolution: Applied
Priority: Major Major
Reporter: Istvan Orban
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
xReporter

Parameter kept even it's not selected

Created: 09/Oct/03 01:42 PM   Updated: 29/Apr/05 03:44 PM
Component/s: xReporter-Cocoon
Affects Version/s: 1.2
Fix Version/s: 1.2.1

Environment: win2000, tomcat 4.0, cocoon version 2.0.4,


 Description   
I have a report having two parameter-> validfrom, validto filtering a date.

I have a flow where, there is a step where you can enter the parameters.
validfrom is mandatory but validto.
validfrom also has default expression (last month's first day)

first:

I put value to the validfrom only (mandatory)
validto is empty

click on submit.

-> result is shown
second:

edit parameters : put value to the validto as well.

click on submit
-> result is shown

edit parameters: delete the value from the validto
click on submit

-> result is shown although bottom of the page I can still see both parameters set.

it seems if there is no value entered for a parameter it keeps the old value.

cheeers,

istvan

 All   Comments   Change History      Sort Order:
Comment by jasmeet bhatia [14/May/04 11:04 PM]
I fixed the bug. Here is the solution:

modify org.outerj.xreporter.report.instance.Parameter

public void submit(Map submitValues, ExecutionContext executionContext, boolean rawLocale)
    {
        String value = (String)submitValues.get(getName());
        if (value != null && !value.equals(""))
        {
            enteredValue = value;
            ValidationResult validationResult = definition.getDataType().validate(value, executionContext, rawLocale);
            if (validationResult.isValid())
            {
                this.validationErrorMsg = null;
                this.value = validationResult.getValue();
            }
            else
            {
                this.validationErrorMsg = validationResult.getErrorMsg();
                this.value = null;
            }
        }
        else if (definition.isRequired())
        {
            this.value = null;
            enteredValue = "";
            validationErrorMsg =

executionContext.getResourceHandle().getBundle("org/outerj/xreporter/report/ReportMessages").getString("required-value");
        }

//XREPORTER XRP-8 BUG FIX
else if(!definition.isRequired() && (value==null || value.equals(""))){
this.validationErrorMsg = null;
this.value=null;
}
//END XRP-8 BUG FIX

Jasmeet,
(assuming it is proper for me to use that part of your name)

thx for your effort, it looks like we can actually
safely achieve the same by just adding:

else // !definition.isRequired() && (value == null || value.equals(""))
{
    this.validationErrorMsg = null;
    this.value=null;
}

i.e. we don't need to re-enforce the test actually...
-marc=


Comment by Marc Portier [09/Nov/04 06:12 AM]
Administrative close (patch applied some time ago)