UIcomponent rendered in loop

Hi,

I'm creating a form based on a DB query. So the number of inputfields is dynamic. Displaying and submitting the form is no problem, but now I want to add a validator or converter to some fields with a linked message. For this I need to give a name to the component and use that name as reference for the message tag (h:message for="<the name here>"). JSF does not seem to cope with automatically generated uicomponent names

Is there a solution for this?

thx

[493 byte] By [kdevoska] at [2007-11-27 4:31:03]
# 1
no one? :-)tried creating uicomponent with dynamic id but does not work
kdevoska at 2007-7-12 9:40:28 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2

One can generate UIComponent at runtime by adding componet by supplying id to these components.

and ur right that in case of validator u need the component id to add message with validator.

I and unable to understand what is ur real proble,

u r saying that ur components are generated according to Database base, there there must be some ID for each component after getting record for each component

please Clearly specify what is ur real problem.

Thanks

Praveen

PRohillaa at 2007-7-12 9:40:28 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3

can u tell me how u r creating ur component. U r supplying component Id ur self or not.

If u r supplying ur self then i think there will be no problem.

if not then id is mandatory for adding

<h:message>

and u have to supply id externally for <h:message>

<h:message > can't take ID by itself.

PRohillaa at 2007-7-12 9:40:28 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4
If it suits your requirements, you could the <h:messages> tag without a for attribute instead.
RaymondDeCampoa at 2007-7-12 9:40:28 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 5

OK it seems I was not really clear

I have a uicomponent with a variable name or id:

<h:inputText name="#{bean.variableName}" value="#{bean.variableValue}"/>

but I cannot add a h:message tag to get the message to the dynamic component

<h:message for="#{bean.variableName}" />

kdevoska at 2007-7-12 9:40:28 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 6

follow up

I created my own message tag with allows a dynamic for parameter, but the message tags needs the id

thus I create a proxy tag which holds a child --> the inputtext

<proxyId proxyId="#{bean.name}"

><h:inputtext value="..." name="..."/>

</proxyId>

<h:message for="#{bean.name}" />

In that proxyid renderer (encodeBegin method) I get my child component (inputext) and call setId with the value passed in the proxyid param

everything seems to work --> id is put correctly only the textfield is not submitted when sumitting the form.

does anyone has an idea why the field is no longer submitted after changing the ID

kdevoska at 2007-7-12 9:40:28 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...