ImportEnums with inner enum

Community Driven Extensions Project
Post Reply
cioccio
Posts: 6
Joined: 15 Apr 2015, 17:06

15 Apr 2015, 17:10

Is there any way to use the component pe:importEnum to access an inner enum?

<pe:importEnum type="enums.PaymentMethodEnums.EnumPaymentMethod" />
<h:outputText value="#{EnumPaymentMethod.ALL_VALUES}" />

tandraschko
PrimeFaces Core Developer
Posts: 3979
Joined: 03 Dec 2010, 14:11
Location: Bavaria, DE
Contact:

15 Apr 2015, 22:35

check the classForName docu but AFAIR: enums.PaymentMethodEnums$EnumPaymentMethod
Thomas Andraschko

PrimeFaces | PrimeFaces Extensions

Apache Member | OpenWebBeans, DeltaSpike, MyFaces, BVal, TomEE

Sponsor me: https://github.com/sponsors/tandraschko
Blog: http://tandraschko.blogspot.de/
Twitter: https://twitter.com/TAndraschko

cioccio
Posts: 6
Joined: 15 Apr 2015, 17:06

17 Apr 2015, 00:54

Thanks tandraschko ..... it worked!

Could you tell me if this component works with static methods?

tandraschko
PrimeFaces Core Developer
Posts: 3979
Joined: 03 Dec 2010, 14:11
Location: Bavaria, DE
Contact:

17 Apr 2015, 09:11

what do you mean with static methods? an example would be great ;)
Thomas Andraschko

PrimeFaces | PrimeFaces Extensions

Apache Member | OpenWebBeans, DeltaSpike, MyFaces, BVal, TomEE

Sponsor me: https://github.com/sponsors/tandraschko
Blog: http://tandraschko.blogspot.de/
Twitter: https://twitter.com/TAndraschko

cioccio
Posts: 6
Joined: 15 Apr 2015, 17:06

17 Apr 2015, 20:04

The class CommonMethods has an static method isEmpty ...... i would like to call that function, method, in my view.

Note that de CommonMethods is not a @ManagedBean.

public class CommonMethods {

/**
* Verifica se uma lista esta vazia ou nula.
* @param list Lista.
* @return True caso seja nula ou vazia, false caso contrario.
*/
public static boolean isEmpty(Collection<?> list) {
if (list == null || list.isEmpty()) {
return true;
}

return false;
}

}

tandraschko
PrimeFaces Core Developer
Posts: 3979
Joined: 03 Dec 2010, 14:11
Location: Bavaria, DE
Contact:

17 Apr 2015, 21:11

it just imports an enum, it has nothing todo with methods. So NO.
Thomas Andraschko

PrimeFaces | PrimeFaces Extensions

Apache Member | OpenWebBeans, DeltaSpike, MyFaces, BVal, TomEE

Sponsor me: https://github.com/sponsors/tandraschko
Blog: http://tandraschko.blogspot.de/
Twitter: https://twitter.com/TAndraschko

Post Reply

Return to “Extensions”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 18 guests