You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Joshua Jackson <jo...@gmail.com> on 2007/10/19 04:18:38 UTC

T4: creating search form and search result on one page

Dear all,

Is it possible to create a search form and search result on one page
where the search result uses contrib:table? I tried to do this but it
didn't work, but if the search result is on (redirected to) another
page it works. Does anyone have a workaround/solution for this?

Thanks in advance

-- 
It's not just about coding, it's a matter of fulfilling your core being

YM!: thejavafreak
Blog: http://joshuajava.wordpress.com/

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: T4: creating search form and search result on one page

Posted by Andreas Andreou <an...@di.uoa.gr>.
Why dont you debug your

getService().search() 
method and see what arguments it gets and what it returns ?

It should help you find where and what the problem is...



Joshua Jackson wrote:
> It stilll doesn't work. Does anyone have a complete sample code for this?
>
>
> thanks in advance,
>
> On 10/19/07, Andreas Andreou <an...@gmail.com> wrote:
>   
>> remove
>> public Collection list;
>>
>> inside search(), just do
>> setList( getService().search(getClient()) );
>>     
>
>
>   

-- 
Andreas Andreou - andyhot@apache.org - http://blog.andyhot.gr
Tapestry / Tacos developer
Open Source / J2EE Consulting


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: T4: creating search form and search result on one page

Posted by Joshua Jackson <jo...@gmail.com>.
It stilll doesn't work. Does anyone have a complete sample code for this?


thanks in advance,

On 10/19/07, Andreas Andreou <an...@gmail.com> wrote:
> remove
> public Collection list;
>
> inside search(), just do
> setList( getService().search(getClient()) );


-- 
What you want today, may not exist tommorrow

Blog: http://joshuajava.wordpress.com/

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: T4: creating search form and search result on one page

Posted by Andreas Andreou <an...@gmail.com>.
remove
public Collection list;

inside search(), just do
setList( getService().search(getClient()) );

On 10/19/07, Joshua Jackson <jo...@gmail.com> wrote:
>
> Here is the html template of search form and search result underneath it:
>
> <span jwcid="@Layout">
>         <form jwcid="form@Form">
>         <table width="100%">
>                 <tr>
>                         <td width="35%"><span jwcid="@Insert"
> value="message:app.number" /></td>
>                         <td><input jwcid="appNumber@TextField"
> value="ognl:client.appNumber" /></td>
>                 </tr>
>                 <tr>
>                         <td><span jwcid="@Insert" value="message:
> payor.name" /></td>
>                         <td><input jwcid="payorName@TextField"
> value="ognl:client.payorName" /></td>
>                 </tr>
>                 <tr>
>                         <td>&nbsp;</td>
>                         <td>
>                                 <input type="submit" jwcid="search@Submit"
> action="listener:search" value="message:search"/>
>                         </td>
>                 </tr>
>         </table>
>         </form>
>
>         <table jwcid="@contrib:Table" source="ognl:list"
>                         columns="Client:appNumber">
>
>                 <tr>
>                     <td colspan="4" class="tablePages">
>                       <span jwcid="tablePages@contrib:TablePages"/>
>                     </td>
>                 </tr>
>         </table>
>
> </span>
>
> Here is the search listener:
>         public Collection list;
>
>         public abstract Collection getList();
>         public abstract void setList(Collection list);
>
>         public abstract Client getClient();
>         public abstract void setClient(Client client);
>
>         private Service service;
>
>     public void search()
>     {
>         list = getService().search(getClient());
>     }
>
>         public Service getService() {
>                 return service;
>         }
>
> And here is the page definition:
> <page-specification class="pages.Panel">
>         <inject property="service" object="spring:service"/>
> </page-specification>
>
> On 10/19/07, Jonathan Barker <jo...@gmail.com> wrote:
> > Post your code.  I've never had a problem.
>
> --
> What you want today, may not exist tommorrow
>
> Blog: http://joshuajava.wordpress.com/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


-- 
Andreas Andreou - andyhot@apache.org - http://blog.andyhot.gr
Tapestry / Tacos developer
Open Source / JEE Consulting

Re: T4: creating search form and search result on one page

Posted by Joshua Jackson <jo...@gmail.com>.
Here is the html template of search form and search result underneath it:

<span jwcid="@Layout">		
	<form jwcid="form@Form">
	<table width="100%">
		<tr>
			<td width="35%"><span jwcid="@Insert" value="message:app.number" /></td>
			<td><input jwcid="appNumber@TextField" value="ognl:client.appNumber" /></td>
		</tr>
		<tr>
			<td><span jwcid="@Insert" value="message:payor.name" /></td>
			<td><input jwcid="payorName@TextField" value="ognl:client.payorName" /></td>
		</tr>
		<tr>
			<td>&nbsp;</td>
			<td>
				<input type="submit" jwcid="search@Submit"
action="listener:search" value="message:search"/>
			</td>
		</tr>
	</table>
	</form>
	
	<table jwcid="@contrib:Table" source="ognl:list"
			columns="Client:appNumber">

		<tr>
		    <td colspan="4" class="tablePages">
		      <span jwcid="tablePages@contrib:TablePages"/>
		    </td>
	  	</tr>
	</table>
	
</span>

Here is the search listener:
	public Collection list;
	
	public abstract Collection getList();
	public abstract void setList(Collection list);

	public abstract Client getClient();
	public abstract void setClient(Client client);

	private Service service;

    public void search()
    {    	
    	list = getService().search(getClient());
    }

	public Service getService() {
		return service;
	}

And here is the page definition:
<page-specification class="pages.Panel">
	<inject property="service" object="spring:service"/>
</page-specification>

On 10/19/07, Jonathan Barker <jo...@gmail.com> wrote:
> Post your code.  I've never had a problem.

-- 
What you want today, may not exist tommorrow

Blog: http://joshuajava.wordpress.com/

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


RE: T4: creating search form and search result on one page

Posted by Jonathan Barker <jo...@gmail.com>.
Post your code.  I've never had a problem.


> -----Original Message-----
> From: Joshua Jackson [mailto:joshua.java@gmail.com]
> Sent: Thursday, October 18, 2007 10:30 PM
> To: Tapestry users
> Subject: Re: T4: creating search form and search result on one page
> 
> On 10/19/07, andyhot <an...@di.uoa.gr> wrote:
> > Of course it's possible - I usually have an If component that either
> > shows the table
> > or an @Insert of "No results found"...
> >
> > What's the real problem you're having?
> 
> The problem is the search result is not displayed if it is on the same
> page with the search form.
> 
> --
> It's not just about coding, it's a matter of fulfilling your core being
> 
> YM!: thejavafreak
> Blog: http://joshuajava.wordpress.com/
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: T4: creating search form and search result on one page

Posted by Joshua Jackson <jo...@gmail.com>.
On 10/19/07, andyhot <an...@di.uoa.gr> wrote:
> Of course it's possible - I usually have an If component that either
> shows the table
> or an @Insert of "No results found"...
>
> What's the real problem you're having?

The problem is the search result is not displayed if it is on the same
page with the search form.

-- 
It's not just about coding, it's a matter of fulfilling your core being

YM!: thejavafreak
Blog: http://joshuajava.wordpress.com/

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: T4: creating search form and search result on one page

Posted by andyhot <an...@di.uoa.gr>.
Of course it's possible - I usually have an If component that either 
shows the table
or an @Insert of "No results found"...

What's the real problem you're having?

Joshua Jackson wrote:
> Dear all,
>
> Is it possible to create a search form and search result on one page
> where the search result uses contrib:table? I tried to do this but it
> didn't work, but if the search result is on (redirected to) another
> page it works. Does anyone have a workaround/solution for this?
>
> Thanks in advance
>
>   

-- 
Andreas Andreou - andyhot@apache.org - http://andyhot.di.uoa.gr
Tapestry / Tacos developer
Open Source / JEE Consulting


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org