Skipping the entire validation phase would work for me here.  However, what
are the implications of also skipping the INVOKE_APPLICATION phase?

Thanks, - Dave



Jakob Korherr wrote:
> 
> Hi,
> 
> Do you want to skip the entire validation phase or do just want to disable
> some specific validators?
> 
> In the first case you can set FacesContext.renderResponse(), however also
> the INVOKE_APPLICATION phase will be skipped here.
> In the second case you could set a value in the FacesContext's attribute
> Map
> and consider this value in your validators to either skip or do the
> validation.
> 
> I think these are the best solutions to your problem in MyFaces 1.1. In
> MyFaces 2.0 the attribute "disabled" was added to <f:converter>. This
> would
> perfectly fit you in this scenario, but unfortunately this is not
> available
> in 1.1.
> 
> Hope this helps!
> 
> Regards,
> Jakob
> 
> 2010/3/15 laredotornado <laredotorn...@gmail.com>
> 
>>
>> Hi,
>>
>> I'm using MyFaces 1.1.5 with Tomahawk 1.1.7.  I have a phase listener and
>> was wondering if there is a way I can prevent validations from happening
>> if
>> certain conditions occur.  For example, if I reach the branch with the
>> comment ...
>>
>>        public void beforePhase(final PhaseEvent phaseEvent) {
>>                if (phaseEvent.getPhaseId() ==
>> PhaseId.PROCESS_VALIDATIONS)
>> {
>>                        if (errorsOccur(phaseEvent)) {
>>                                // Prevent other validations from
>> happening.
>>                        }   // if
>>                } // if
>>        }
>>
>> I would like to prevent the validations from taking place in this text
>> field
>> ...
>>
>>                <h:inputText id="domeTourNumber_of_Adults"
>> value="#{domeTour.numAdults}"
>>                                            required="true"
>>                                            size="60"
>>                                            maxlength="60"
>>                                            styleClass="textFields
>> numAdultsField">
>>                <f:validator validatorId="TourNumberValidator" />
>>                <f:validator validatorId="TourTotalPeopleValidator" />
>>                <f:validator validatorId="TourAdultChildRatioValidator" />
>>               </h:inputText>
>>
>> Any insights you can provide are greatly appreciated, - Dave
>>
>> --
>> View this message in context:
>> http://old.nabble.com/Way-to-prevent-further-validations-in-the-listener--tp27905462p27905462.html
>> Sent from the MyFaces - Users mailing list archive at Nabble.com.
>>
>>
> 
> 

-- 
View this message in context: 
http://old.nabble.com/Way-to-prevent-further-validations-in-the-listener--tp27905462p27907138.html
Sent from the MyFaces - Users mailing list archive at Nabble.com.

Reply via email to