myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Leonardo Uribe <lu4...@gmail.com>
Subject Re: Missing/changed methods after migrating to MyFaces 1.2.8
Date Tue, 06 Apr 2010 20:34:37 GMT
Hi

All tag class hierarchy was changed from 1.1 to 1.2, with the inclusion of
jsp EL expressions.

Right now, all tag hierarchy are generated by myfaces builder plugin. But
anyway, in tomahawk we have cases like this one:

http://svn.apache.org/repos/asf/myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/tree/taglib/AbstractTreeTag.java
http://svn.apache.org/repos/asf/myfaces/tomahawk/trunk/core12/src/main/java/org/apache/myfaces/custom/tree/taglib/AbstractTreeTag.java

You can create a custom jsf tag class with all properties from your base
component, and override/add the additional properties you need.

regards,

Leonardo Uribe

2010/4/6 Mike Kienenberger <mkienenb@gmail.com>

> 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
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message