Re: modify search form on result page?
Re: modify search form on result page?
- Subject: Re: modify search form on result page?
- From: Michael Engelhart <email@hidden>
- Date: Sat, 7 Aug 2004 22:02:11 -0500
Thanks Arturo -
I don't know why I wasn't doing that originally since I already was
using a SearchCriteria object to store the results was setting those
values by method calls using the instance variables. must have
forgotten about key/value coding in the wod file.. :-)
Now though I have a new problem.
I have two pages in my situation;
1) InitialSearch
and
2) SearchResults
On SearchResults I have on the sidebar the search criteria in a WOForm
that I want the user to be able to modify their query and resubmit
without having to back to the original page. My question is how to
use the existing validation logic that I've already written in
InitialSearch. It doesn't appear that I can cause the
validateATTRIBUTE() methods to be called from another page. Is there
any way to use my existing code in InitialSearch to validate the modify
search form's data and if there is a problem redisplay InitialSearch
with it's corresponding validation error messages?
What I've tried and isn't working is in my SearchResults page to bind
the form values to the SearchCriteria object's attributes and then call
a modifySearch() action that sets the required searchCriteria object
needed for the form like this:
public WOComponent modifySearch() {
InitialSearch nextPage = (InitialSearch)
pageWithName("InitialSearch");
//searchCriteria is an instance variable of SearchResults
nextPage.setSearchCriteria(searchCriteria);
return nextPage.goSearchForStuff();
}
but this isn't working because the NSValidation methods aren't being
fired (I'm guessing they're tied to the submit action in some way).
Is there a way to do this? I'm probably going about this the wrong way.
THanks
Mike
On Aug 6, 2004, at 5:52 AM, Arturo Pirez wrote:
>
> On Aug 5, 2004, at 10:16 PM, Michael Engelhart wrote:
>
>> Hi -
>>
>> I have a set of pages that are rendered after doing a legacy system
>> query. The results are displayed and in a sidebar I want the user
>> to be able to modify their search (with all their current selections
>> pre-populated) which I'm guessing would just call the action on
>> another component. Any advice on how best to do this.
>
> Conceptually, rather than have a boatload of instance variables, is to
> have a query object that you can pass back and forth. A
> WODisplayGroup might even do it for you but you might just be better
> off rolling your own.
>
> Alternatively, you can use the same component and render it with CSS
> (or XML/XSL) rather than using straight html. You'll need a
> relatively recent browser to do that successfully though.
>
>> ----
> WO in philadelphia - wanna cheesesteak with that?
> Please visit webobjects.meetup.com.
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.