myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mike Kienenberger <mkien...@gmail.com>
Subject Re: Missing/changed methods after migrating to MyFaces 1.2.8
Date Tue, 06 Apr 2010 20:21:06 GMT
Not sure about

1. setStringProperty.

But for

2. create a ValueExpression containing "#{true}" or "#{false}"

I haven't tested this, but....

You could either ask JSF to create it for you:

import javax.el.ValueExpression;

FacesContext context = FacesContext.getCurrentInstance();
ValueExpression vex = context.getApplication().
getExpressionFactory().createValueExpression(context.getELContext(),
"#{false}", Boolean.class);

Or you could implement your own, something along the lines
of this:

		new ValueExpression() {
		
			@Override
			public boolean isLiteralText() {
				return false;
			}
		
			@Override
			public int hashCode() {
				return 0;
			}
		
			@Override
			public String getExpressionString() {
				return "#{false}";
			}
		
			@Override
			public boolean equals(Object obj) {
				return obj == this;
			}
		
			@Override
			public void setValue(ELContext context, Object value) {
				// TODO Auto-generated method stub
			}
		
			@Override
			public boolean isReadOnly(ELContext context) {
				return true;
			}
		
			@Override
			public Object getValue(ELContext context) {
				return Boolean.FALSE;
			}
		
			@Override
			public Class<?> getType(ELContext context) {
				return Boolean.class;
			}
		
			@Override
			public Class<?> getExpectedType() {
				return Boolean.class;
			}
		};
		

On Tue, Apr 6, 2010 at 7:19 AM, Seema Mani <Seema.Richard@ust-global.com> wrote:
>
> hi,
>
> I'm facing a few issues after migrating to MyFaces 1.2.8 from MyFaces 1.1.7
>
> 1. In my custom tag handler class, extending HtmlMessageTag, there were
> calls to setStringProperty method in the superclass. But these methods are
> not existing now
> 2. In my custom tag handler class, extending HtmlCommandButtonTag, there
> were calls to the setDisabled method, which had String argument. This method
> now takes ValueExpression as the argument. But the values to be passed are
> static like "true" and "false"
>
> Please advise on how these can be resolved.
>
> Thanks,
> Seema
> --
> View this message in context: http://old.nabble.com/Missing-changed-methods-after-migrating-to-MyFaces-1.2.8-tp28150278p28150278.html
> Sent from the MyFaces - Users mailing list archive at Nabble.com.
>

Mime
View raw message