Dynamically Update a Component based on Another Component's Value Expression in JSF View

378 Views Asked by At

I have looked into the possibilities of facelet tag files, custom components, custom renderers, but couldn't figure this out. Highly appreciate if someone can direct me in a possible solution. Here's what I need to do

I have a lot of label, input, message sections in my views. So what what basically want to is to avoid adding 3 tags and achieve it by using 1 custom tag such as

<my:input value="#{customerBean.customer.name}"/>

I already know the label of the field from the customer entity field annotation like

@Field(label = "Customer Name")
private String name;

My question is, how can I get the entity value from the value expression customerBean.customer.name. So that I can find out the entity field annotation label via reflection. I cannot always depend on the literal name "customer" as it could also be "customerBean.record.name" or something similar

I also want to avoid passing the entity name as an attribute.

0

There are 0 best solutions below