I hadn't thought about that aspect. It can still be done, but now
it's a bit more painful to implement as you'd need to generate the
values for actionFor. Maybe what you've got is a better way to do it
in this case -- after all, you already have it working.
<h:form>
<!-- Input text field with a select item picker popup
link. The form
can have 1 to n of these -->
<sandbox:subForm id="subform1">
<h:inputText required="true">
<sandbox:submitOnEvent for="link1"
</h:inputText>
<h:commandLink id="link1"
actionListener="#{reportSelectionHandler.startSelectParameterValues}">
<h:graphicImage url="foo.gif"/>
<t:updateActionListener
property="#{reportSelection.reportParameterName}"
value="foo"/>
</h:commandLink>
</sandbox:subForm>
<sandbox:subForm id="subform2">
<h:inputText required="false">
<sandbox:submitOnEvent for="link2"
</h:inputText>
<h:commandLink id="link2"
actionListener="#{reportSelectionHandler.startSelectParameterValues}">
<h:graphicImage url="foo.gif"/>
<t:updateActionListener
property="#{reportSelection.reportParameterName}"
value="bar"/>
</h:commandLink>
</sandbox:subForm>
[...]
<sandbox:subForm id="subformN">
<h:inputText required="false">
<sandbox:submitOnEvent for="linkN"
</h:inputText>
<h:commandLink id="linkN"
actionListener="#{reportSelectionHandler.startSelectParameterValues}">
<h:graphicImage url="foo.gif"/>
<t:updateActionListener
property="#{reportSelection.reportParameterName}"
value="bar"/>
</h:commandLink>
</sandbox:subForm>
<t:commandButton value="get report"
actionFor="form1,form2,...formN"
actionListener="#{reportSelectionHandler.fetchReport}"/>
</h:form>
On 4/11/07, Marko Asplund <[EMAIL PROTECTED]> wrote:
Mike,
I haven't used subForm before and I'm not sure if i understand how to
use it for implementing the validation logic here. If i put each
h:inputText in its own subForm wouldn't that make each field
independent from the others? How would i submit all of the fields at
once, convert their values but skip required validation (per request
basis) and update model?
Here's what kind of behavior the user should see:
- When the user asks the system to show a list of available values for
a field, all of the other non-empty, syntactically correct (i.e.
conversion goes fine) field values should also be updated to the
model. Any of the other field values can potentially affect the list
of items shown in the picker popup.
- When the user asks the system to produce a report, all field values
should be updated to the model. Normal conversion and validation
(including checking required component values) should take place
The form currently looks something like this:
<h:form>
<!-- Input text field with a select item picker popup link. The form
can have 1 to n of these -->
<h:inputText required="true"/>
<h:commandLink
actionListener="#{reportSelectionHandler.startSelectParameterValues}">
<h:graphicImage url="foo.gif"/>
<t:updateActionListener
property="#{reportSelection.reportParameterName}" value="foo"/>
</h:commandLink>
<h:inputText required="false"/>
<h:commandLink
actionListener="#{reportSelectionHandler.startSelectParameterValues}">
<h:graphicImage url="foo.gif"/>
<t:updateActionListener
property="#{reportSelection.reportParameterName}" value="bar"/>
</h:commandLink>
<h:commandButton value="get report"
actionListener="#{reportSelectionHandler.fetchReport}"/>
</h:form>
marko
Mike Kienenberger wrote:
> It sounds like you could dump the special request value and just use a
> subForm around your text field and select item picker icon, couldn't
> you? This should get you back to "mainstream" JSF validation
> processing.
>
> Is the required map only used for getting around the icon picking
> issue? If so, you should be able to dump it as well.