A little background information..
technologies : JSF -> entityManager (stateless / detached) -> entity classes -> oracle
* using hibernate 3.x for the entityManager and entityclasses / annotations
i have an entity class mapped to an oracle table
RATES(ID NUMBER, START_DATE DATE, END_DATE DATE)
there is a check constraint on RATES
CONSTRAINT CK_MRC_RATES
CHECK (EFFECTIVE_END_DATE > EFFECTIVE_START_DATE)
DEFERRABLE INITIALLY DEFERRED
the jsf application has a jsf table with muliple rows.
there are 3 fields in each row : CheckBox, startDate (static Text), endDate (textBox)
the application allows a user to update the endDate on as many rows as they want, but they do need to select the checkbox if the date is to be processed.
I have a jsf message component in the endDate cell and the message is tied to the endDate. I do have a DateTime converter on the endDate with a MM/dd/yyyy pattern and if the user enters a date that is invalid the endDate message displays the error just fine to the.
My real question ...
i want to enforce endDate > startDate without using javascript on (checkbox) selected rows. I also want the error of 'End Date must be greater then Start Date' to appear in the message component only for the rows in question.
What i've figured out so far ...
I can't use custom JSF validation because the validation fires before the checkbox binding occurs and I can't tell if a row has been selected through a TableSelectPhaseListener.
the Hibernate validation package could probably work but the overhead to have the error appear in the 'proper' cell / row seems very high.
capturing the oracle constraint violation has the same problem as trying to deal with hibernate validations. it's actually i little more wonky in that a SQLException is not thrown and i need to parse the stack trace to find the oracle error.
any help is appreciated. maybe javascript is the easy answer .. i don't know
Start Free Trial