Guy Bashan schrieb:

Hi,

Is there a way to skip validation, but still post data to bean?

For example:

I have a screen in which data can be inputted. I also have a link near one of the drop downs: "add new". When pressing "add new" user should go to another screen allowing to enter a new item. Then when saving new item user is directed to previous screen while preserving the value when screen was left.

All my beans are "request scope". So I thought to use another session bean to preserve the data, and when user comes back to the screen, simply copy the data from session to the member of the bean. But, I have a problem posting the data to the bean, when validation is still not satisfied.

Any way of dealing with this issue in JSF?

No, I don't think you can do that. At least not without a whole lot of complex code. I would suggest just requiring the page to be valid before a new user can be added.

The "myfaces orchestra flow" project is actually designed to support this sort of thing. But that is still at an alpha-quality stage, and I would not recommend it for general use at the moment.

If you *really* want to do this, then I think you'll need to either
(a) save the whole view tree before navigating to the "add new" page, then restore it on return (what Orchestra Flow does), or (b) walk the view tree and extract out the submittedValue property of each component, and restore that later, or (c) save the raw submitted form data then reprocess that on return to the original view (minus the data that caused the "add new" command to execute)
I don't think any of these are very easy.

Regards, Simon

Reply via email to