Hi, Your helper class seems fine. To use it in inline bindings, you specify the function after a pipe like this : "$personAttribute|displayName"
I tried this but I decided I prefer to add the methods in the entity class
(Person) for these reasons:
- The html editor can validate the method
- You may want this getter for email or message construction.
- The function after the | is hard to read
Samuel
Le 2013-06-12 à 10:50, Theodore Petrosky <[email protected]> a écrit :
> I am reading
> http://wiki.wocommunity.org/display/documentation/WOOGNL+Helper+Functions
>
> and I thought I would spend some time learning this. I created my helper
> class:
>
> package com.as.Helpers;
>
> import com.as.Model.Person;
>
> public class PersonHelper {
>
> public static String displayName(Person person) {
> return person.firstName() + " " + person.lastName();
> }
>
> public static String displayShortName(Person person) {
> return person.firstName().substring(0,1) + ". " + person.lastName();
> }
> }
>
> and I finally got it. At least how to access these helper methods in my
> inline bindings and in the WOD.
>
> But I was thinking that some of the other methods that I would normally put
> in my EO belong in this helper class.
>
> Can I access the helper methods in my java? Or maybe Can I access these
> methods in my java. For instance I pass the current user to my Jasper report
> and I want to pass the helper displayName.
>
> Ted
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Webobjects-dev mailing list ([email protected])
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/webobjects-dev/samuel%40samkar.com
>
> This email sent to [email protected]
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list ([email protected]) Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to [email protected]
