Not that Heath's answer didn't work...just that I'd like to explore an easier
that the
spec seems cover (I posted this to sun's jsf forums too).
Reading the JSF Specification section 5.1.4 Set Value Semantics I quote:
When the setValue() method on a ValueBinding is called, the syntax of the
value binding restriction is restricted as described above. The implementation
must
perform the following processing to evaluate an expression of the form �#{expra.
value-b}� or �#{expr-a[value-b]}�:
Evaluate expr-a into value-a.
{cases with null, lists, maps snipped}
Otherwise (value-a is a JavaBean object):
Coerce value-b to String.
If value-b is a writeable property of value-a (as per the JavaBeans
Specification), call the setter method (passing new-value); throwing
ReferenceSyntaxException if an exception is thrown.
Otherwise, throw PropertyNotFoundException.
Hence,
<h:inputHidden value="#{searchBean.created}"/>
should evaluate to an instance of the managed-bean SearchBean.setCreated(String
s).
The thing I'm missing is 'new-value'. Since value= is the value binding
attribute
where do I put 'new-value'?
--
Rob
@objectsource.org
---------- Original Message -----------
From: Heath Borders <[EMAIL PROTECTED]>
To: MyFaces Discussion <[email protected]>
Sent: Wed, 13 Apr 2005 15:30:57 -0500
Subject: Re: predefined form values
> Ok, then you write a single quickSearch(ActionEvent) method and inside it
> you check for the quickSearch parameter(s). And use those to search.
>
> On 4/13/05, Rob Decker <[EMAIL PROTECTED]> wrote:
> >
> >
> > I don't want to write a java method for every quick search I want. I'd
> > like to be able
> > to just add a new quick search to a jsp. Say I have 3 quick searches:
> >
> > Look for things from: Today, Yesterday, Last Week
> >
> > Then next month the boss says 'I want a quick search for tomorrow!'. It
> > would be
> > easier for someone to add it to the jsp page than to have to write a new
> > java method
> > in the bean. It's a presentation detail.
> >
> > --
> > Rob
> >
> > @objectsource.org <http://objectsource.org>
> >
> > ---------- Original Message -----------
> > From: Enrique Medina <[EMAIL PROTECTED]>
> > To: MyFaces Discussion <[email protected]>
> > Sent: Wed, 13 Apr 2005 21:05:03 +0200
> > Subject: Re: predefined form values
> >
> > > Why not simply call another method from the commandLink (say
> > > searchQuick) where those values are set in code, and then call the
> > > search method?
> > >
> > > On 4/13/05, Rob Decker <[EMAIL PROTECTED]> wrote:
> > > >
> > > > Say I have a form to do a search and a backing bean called SearchBean:
> > > >
> > > > <h:form>
> > > > <h:inputText value="#{searchBean.searchValue}"/>
> > > > <x:inputCalendar value="#{searchBean.lastModified}"/>
> > > > <h:commandButton type="submit" action="#{search.search}"/>
> > > > </h:form>
> > > >
> > > > Now say I want to have simple links with predefined values for the
> > search
> > parameters,
> > > > a quick search link:
> > > >
> > > > <h:form
> > > > <h:commandLink action="#{search.search}">
> > > > <h:outputText value="Quick Search"/>
> > > > <h:inputHidden value="*"/>
> > > > <h:inputHidden value="04/05/2005"/>
> > > > </h:commandLink>
> > > > </h:form>
> > > >
> > > > How do I associate the hidden input values with the search bean
> > methods that holds
> > > > their values? It seems like in this case I have to id all the
> > components, get the
> > > > request, and populate the search bean myself or I have to create the
> > search bean so
> > > > it binds components instead of values. Is there a simple way to do
> > this that I'm
> > > > missing?
> > > >
> > > > --
> > > > Rob
> > > >
> > > > @objectsource.org <http://objectsource.org>
> > > >
> > > >
> > ------- End of Original Message -------
> >
> >
>
> --
> -Heath Borders-Wing
> [EMAIL PROTECTED]
------- End of Original Message -------