isis-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vladimir Nišević <vnise...@gmail.com>
Subject Specifying cssClass in runfime?
Date Sat, 19 Aug 2017 16:58:03 GMT
Hi, I have a requirement to present the background of specific property
based on its value or depending on other object properties. Currently I can
define cssClass as described
https://isis.apache.org/guides/ugfun/ugfun.html#_ugfun_ui-hints_action-icons-and-css
at development time.

It would be great if I could define a kind of specification class similar
to
https://isis.apache.org/guides/rgant/rgant.html#_rgant-Property_mustSatisfy
which returns cssClass in runtime.

It could look like this

public class Customer {
    @Property(cssSpecification=MyCssClass.class)
    public String getFirstName() { ... }
    ...
}



public class MyCssClass implements CssSpecification {
    public String cssClass(Object obj) {
        if (((Customer) getFirstName())==null)
          return "x-test";
        return "x-firstName-not-empty";
    }
}


Make this requirement sense, and if so, any hints how I could implement
this?

Regards,Vladimir

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message