views:

185

answers:

2

I'm creating a "big" form with a lot of input fields. To make things easier I tried to create a facelet componente which encapsulates the code for creating a table with two columsn where the first col contains the label and the second one the input field.

The tag which includes the component looks like this:

<ft:textInput cid="city" label="City:" 
       value="#{registrationBean.deal.city> }" />

The textInput component's source (simplified):

  <param name="inputField" value="#{value}" />
    <ice:inputText id="#{cid}" value="#{inputField}"                             
                required="true">        
    </ice:inputText>

While the form looks quiet nice I have the problem that the user's value is not written back into the bean. I think the reason is that #{registrationBean.deal.city} is only evaluated once but not when the form is submitted. I guess I have some serious error in reasoning here but I can't find good document about that.

Thanks for any hints.

A: 

I'm not sure why this is the case, since I don't use the f:param tag very often, but you can set

<ice:inputText id="#{cid}" value="#{value}" required="true"/>

directly. That's what I do and it works great.

Drew
that means you're doing it the same way like me (with custom facelet) but just without the param? I saw my way in the icesfaces tutorials...
hubertg
ok, I tried it out now and it works! thanks a lot!!!
hubertg
A: 

You may also think about using panelGrid and/or panelGroup tags instead defining your own html table. This helps for a better maintenance.

rainwebs
That's true but it does not solve the problem of repeating this code for each and every input field.
hubertg