Hi Felix,
Thank you for your inputs. My part of my action currently looks like
this:
public function executeRead(AgaviWebRequestDataHolder $rd)
{
if($rd->getParameter('q')==null) return 'Input';
$searchService =
$this->context->getModel('SearchService','Search')-
>connect();
$ids = $searchService->findByName($rd->getParameter('q'),0,100);
$this->setAttribute('id',$ids);
return 'Success';
}
In this case, I cannot make the action simple. If q is not null, I
would like to validate. My goal is to create a search page which by
default just has a text box and submit. Once submitted, the textbox
and submit appears on the top of the results. I think this is similar
to google.com. I am concerned above the overhead of slotting the same
action within itself in order to get another view.
Is there a way that I can embed the content of the input view without
having to slot the complete action?
Peace,
Shoan.
On 26-Aug-09, at 2:03 PM, Felix Gilcher wrote:
> Hi Shoan,
>
> the purpose of slots is to create reusable components. They can have
> their own logic, but this is in no way required. If you're worried
> about the overhead of an action execution with validation etc. you can
> mark an action as "simple" by defining the method as follows:
>
> class FooAction
> {
> ....
> public function isSimple()
> {
> return true;
> }
> ....
> }
>
> This will skip all validation and action execution and will pass
> control to the view returned from the actions 'getDefaultView' method.
>
> It's a design decision to have a single mechanism for providing
> reusable components instead of having slots, partials, etc that all do
> something similar. This was you can enhance your component later on
> without changing the way it is used.
>
> So yes, slots are the way to go.
>
> cheers
>
> felix
>
>
> On Aug 26, 2009, at 5:02 AM, Shoan Motwani wrote:
>
>> Hi,
>>
>> How do I embed one view into another view of the same action? I am
>> building a search engine and by default would like to display only
>> the
>> search box. But after searching, would like to see the search box on
>> top of the table of results. Currently the search box is the 'Input'
>> view and the tabular results is the 'ListView'. I looked at slots,
>> but
>> it felt like the purpose of slots was to embed one action into an
>> another.
>>
>> Is there a cleaner way to do this other than using slots?
>>
>> Peace,
>> Shoan.
>>
>>
>>
>> _______________________________________________
>> users mailing list
>> [email protected]
>> http://lists.agavi.org/mailman/listinfo/users
>>
>
> --
> Felix Gilcher
>
> Bitextender GmbH
> Paul-Heyse-Str. 6
> D-80336 München
>
> T: +49 89 57 08 15 16
> F: +49 89 57 08 15 17
> M: +49 172 840 88 28
>
> [email protected]
> http://bitextender.com/
>
> Amtsgericht München, HRB 174280
> Geschäftsführer: David Zülke, Florian Clever
>
>
> _______________________________________________
> users mailing list
> [email protected]
> http://lists.agavi.org/mailman/listinfo/users
_______________________________________________
users mailing list
[email protected]
http://lists.agavi.org/mailman/listinfo/users