You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Mike Kienenberger <mk...@gmail.com> on 2007/03/15 22:10:20 UTC

UIData (t:dataTable), sandbox subForm, and UIInput required=true

I want to provide a form for each row in my dataTable.
For each row, I want to have an input field and a commandButton.
I'd like to make the input field required if the commandButton is used.

My issue is that when I click the button, every row's input is checked
for required rather than just the row containing the button.

Is this a limitation of subForm?   Or can subForm be made intelligent
enough to understand  when it's used in a flyweight pattern?

For now, I'm checking the required condition in my action java code.

  <t:column>
	 <f:facet
		 name="header">
		 Input
	 </f:facet>
	<sandbox:subForm id="inputForm">
		<h:inputText id="input"
			size="4"
			value="#{bean.value}">
			<sandbox:submitOnEvent event="blur" for="execute" />
		</h:inputText>
		<h:commandButton id="execute"
			action="#{bean.execute}"
			value="Change">
		</h:commandButton>
	</sandbox:subForm>
  </t:column>