// en funcio del tipus(varchar,select,...) del Tipus construim el formulari
Iterator<?> iter = c.iterator();
while (iter.hasNext())
{
Caracteristiques cc = (Caracteristiques) iter.next();
if (cc.getTtpcontrol().getTipus().compareTo("ITXT") == 0)
{
// construim outputText
containerControlsDinamics.getChildren().add(HtmlDinamic.buildOutputText(
Cadenes.primeraLletraMajuscula(cc.getNom())
,(ValueExpression) Utils.resolveExpression(cc.getNom() + " " + cc.getCaracteristicaKey())));
// construim inputText
HtmlInputText inputText = new HtmlInputText();
ValueExpression v = (ValueExpression) Utils.resolveExpression("#{inmobleForm.valorsCaracts[" + cc.getCaracteristicaKey() + "]}");
Utils.processProperty(inputText, v, "value");
containerControlsDinamics.getChildren().add(HtmlDinamic.buildInputText(
"controlsdinamics_" + cc.getNom().toLowerCase() ,
v,
"width:" + (10*cc.getTamanyControl()) + "px",
cc.getTamanyControl(),
"Campo requerido", // requiredMessage
cc.getTtpbasic().getBdtype().compareTo("INT") == 0 ? "valor numérico" : "valor incorrecto",
cc.getTtpbasic().getBdtype(),
cc.getObligatori(),
true, // transient !!!!!!!!!!!!
0,
cc.getTamanyControl())
);
// misatge d'error
containerControlsDinamics.getChildren().add(HtmlDinamic.buildMessageRich(
"inputText_controlsdinamics_" + cc.getNom().toLowerCase(),
"color:red;font-weight:bold",
true)); // transient, true pq no dupliqui ID
// construim checkbox
ValueExpression v2 = (ValueExpression) Utils.resolveExpression("#{inmobleForm.columnesVisibles[" + cc.getCaracteristicaKey() + "]}");
containerControlsDinamics.getChildren().add(HtmlDinamic.buildCheckbox(
cc.getCaracteristicaKey(), // idCaracteristica
v2,
new ArrayList<String>(){/**
*
*/
private static final long serialVersionUID = 1L;