English 中文(简体)
自定义的面向表单的组件,用于输入字段。
原标题:custom facelet component for input field

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.

包含组件的标记看起来像这样:

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

textInput组件的源代码(简化版):

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

虽然表格看着静.,但我有问题,即用户的价值没有被写回来。 我认为,之所以如此,是因为只有一次而不是在提交表格时才能对编号Bean.deal.city}进行评价。 我猜测我这里的推理存在一些严重错误,但我无法找到这方面的好文件。

谢谢任何提示。

最佳回答

我不确定为什么会这样,因为我并不经常使用f:param标签,但你可以设置。

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

直接地。这就是我所做的,而且效果很好。

问题回答

您还可以考虑使用panelGrid和/或panelGroup标签,而不是定义自己的HTML表格。这有助于更好的维护。





相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签