Jsf 2 将属性集合作为映射传递给复合组件属性
我想将一组属性传递给复合组件(JSF2.2,Mojarra 2.2.4-jbossorg-1,运行在WildFly 8 CR1上)。属性的数量是随机的,所以我决定在bean中使用一个引用来映射。我还需要一个复合组件的验证器。此验证器将获得这些属性以实现验证 这是复合组件实现的一部分:Jsf 2 将属性集合作为映射传递给复合组件属性,jsf-2,map,attributes,validation,composite-component,Jsf 2,Map,Attributes,Validation,Composite Component,我想将一组属性传递给复合组件(JSF2.2,Mojarra 2.2.4-jbossorg-1,运行在WildFly 8 CR1上)。属性的数量是随机的,所以我决定在bean中使用一个引用来映射。我还需要一个复合组件的验证器。此验证器将获得这些属性以实现验证 这是复合组件实现的一部分: <h:inputText id="in" value="#{cc.attrs.value}" styleClass="form-control" binding="#{cc
<h:inputText id="in" value="#{cc.attrs.value}" styleClass="form-control"
binding="#{cc.attrs.inputBinding}" required="#{cc.attrs.required}"
requiredMessage="#{cc.attrs.requiredMessage}">
<c:if test="#{not empty cc.attrs.placeholder}">
<f:passThroughAttribute name="placeholder" value="#{cc.attrs.placeholder}"/>
</c:if>
<c:if test="#{not empty cc.attrs.validatorId}">
<f:validator validatorId="#{cc.attrs.validatorId}"/>
<c:forEach var="attr" items="#{cc.attrs.validatorAttributes}">
<f:attribute name="#{attr.key}" value="#{attr.value}"/>
</c:forEach>
</c:if>
</h:inputText>
我试过使用地图,比如:
<String, String> and <String, Object>
由于某种原因,似乎没有添加属性。如果我在h:inputText之外使用c:forEach,我可以使用h:outputText打印映射键和值
validatorAttributes="#{bean.referenceNumberAttributeMap}"
<String, String> and <String, Object>
component.getAttributes().get("someKey")