isis-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dan Haywood <...@haywood-associates.co.uk>
Subject Re: Specifying cssClass in runfime?
Date Sat, 19 Aug 2017 17:13:02 GMT
Hi Vladimir,
>From memory, take a look at CssClassFacet and implement and register your
own facet factory implementation.
Can provide more details if nec (tomorrow).
Cheers,
Dan.

On Sat, 19 Aug 2017, 17:58 Vladimir Nišević <vnisevic@gmail.com> wrote:

> 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