I hope I selected a valid subject !

When I handle a VALUE_CHANGED event for a Select component. I receive the
current value for the Select component as an event handler method parameter.

I use this parameter to set a member variable in the page's class.

@OnEvent(component = "parameterType", value = EventConstants.VALUE_CHANGED)
> private Object pairParameterTypeChanged(ChariotTestTypePairParameterType
> selectedType) {
> this.parameterType = selectedType;
> System.out.println("Type1: " + this.parameterType);
> return this;
> }


In another part of the page, I use a Delegate to conditionally display a
block.

public Block getPairParameterInputBlock() {
> System.out.println("Type2: " + this.parameterType);
> if (this.parameterType == null) {
> return null;
> }
> switch (this.parameterType) {
> case TEXT:
> return this.textPairParameterInput;
> case NUMERIC:
> return this.numericPairParameterInput;
> default:
> return null;
> }
> }


What I'm facing there is that *this.parameterType* is always null and never
sees the value set to it in the Select component's event handler method !

I understand there could be other ways to achieve the same behavior but why
isn't this behaving as I expect ?

*---------------------*
*Muhammad Gelbana*
http://www.linkedin.com/in/mgelbana

Reply via email to