You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by bugxiaoya <bu...@gmail.com> on 2010/08/20 06:43:55 UTC

tapestry grid problem,when sorting,redirected to Start page

I am using Tapestry 5.1 Grid Component for data display.
the problem is: 
when click the sort icon in the table head,it is just redirected to the
Start page.
set the SymbolConstants.SUPPRESS_REDIRECT_FROM_ACTION_REQUESTS  to be "true"
in AppModule.contributeApplicationDefaults() can resolve this problem,but is
there any other way?

P.S:the same problem when click the paging label of grid component.

the source code is as follows:
	<t:grid source="users" row="user" add="delete" rowsPerPage="2"
		pagerPosition="bottom" exclude="id">
		<p:nameCell>
			<t:pagelink page="edit" context="user.id">${user.name}
			</t:pagelink>
		</p:nameCell>
		<p:deleteCell>
			<t:actionlink t:id="delete" context="user.id">${message:delete-label}
			</t:actionlink>
		</p:deleteCell>
	</t:grid>

http://tapestry.1045711.n5.nabble.com/file/n2641788/%E6%90%9C%E7%8B%97%E6%88%AA%E5%9B%BE_2010-08-20_12-41-38.bmp 

-- 
View this message in context: http://tapestry.1045711.n5.nabble.com/tapestry-grid-problem-when-sorting-redirected-to-Start-page-tp2641788p2641788.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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


Re: tapestry grid problem,when sorting,redirected to Start page

Posted by Alexander Muthmann <am...@dev-eth0.de>.
  Great, thanks for the feedback!

Have a lot of fun with tapestry ;)

On 20.08.2010 18:27, bugxiaoya wrote:
> thanks,it works.
>
> 2010/8/20 Alexander Muthmann [via Tapestry]<
> ml-node+2641993-90986904-102484@n5.nabble.com<ml...@n5.nabble.com>
>>    Hi bugxiaoya,
>>
>> I think you can solve this problem by setting the inPlace parameter of
>> your grid. This causes your grid to act like a ajax component and
>> prevents reloading the whole site.
>>
>>
>> http://tapestry.apache.org/tapestry5.1/tapestry-core/ref/org/apache/tapestry5/corelib/components/Grid.html
>>
>> <t:grid ... t:inplace:"true"...>...</t:grid>
>>
>> greeting
>>
>> On 20.08.2010 06:43, bugxiaoya wrote:
>>
>>> I am using Tapestry 5.1 Grid Component for data display.
>>> the problem is:
>>> when click the sort icon in the table head,it is just redirected to the
>>> Start page.
>>> set the SymbolConstants.SUPPRESS_REDIRECT_FROM_ACTION_REQUESTS  to be
>> "true"
>>> in AppModule.contributeApplicationDefaults() can resolve this problem,but
>> is
>>> there any other way?
>>>
>>> P.S:the same problem when click the paging label of grid component.
>>>
>>> the source code is as follows:
>>> <t:grid source="users" row="user" add="delete" rowsPerPage="2"
>>> pagerPosition="bottom" exclude="id">
>>> <p:nameCell>
>>> <t:pagelink page="edit" context="user.id">${user.name}
>>> </t:pagelink>
>>> </p:nameCell>
>>> <p:deleteCell>
>>> <t:actionlink t:id="delete" context="user.id">${message:delete-label}
>>> </t:actionlink>
>>> </p:deleteCell>
>>> </t:grid>
>>>
>>>
>> http://tapestry.1045711.n5.nabble.com/file/n2641788/%E6%90%9C%E7%8B%97%E6%88%AA%E5%9B%BE_2010-08-20_12-41-38.bmp<http://tapestry.1045711.n5.nabble.com/file/n2641788/%E6%90%9C%E7%8B%97%E6%88%AA%E5%9B%BE_2010-08-20_12-41-38.bmp?by-user=t&by-user=t>
>>
>> *smime.p7s* (6K) Download Attachment<http://attachment/2641993/0/smime.p7s>
>>
>>
>> ------------------------------
>>   View message @
>> http://tapestry.1045711.n5.nabble.com/tapestry-grid-problem-when-sorting-redirected-to-Start-page-tp2641788p2641993.html
>> To unsubscribe from tapestry grid problem,when sorting,redirected to Start
>> page, click here<http://tapestry.1045711.n5.nabble.com/template/NodeServlet.jtp?tpl=unsubscribe_by_code&node=2641788&code=YnVneGlhb3lhQGdtYWlsLmNvbXwyNjQxNzg4fC0xNjY4NjgyNzY4>.
>>
>>
>>


Re: tapestry grid problem,when sorting,redirected to Start page

Posted by bugxiaoya <bu...@gmail.com>.
thanks,it works.

2010/8/20 Alexander Muthmann [via Tapestry] <
ml-node+2641993-90986904-102484@n5.nabble.com<ml...@n5.nabble.com>
>

>   Hi bugxiaoya,
>
> I think you can solve this problem by setting the inPlace parameter of
> your grid. This causes your grid to act like a ajax component and
> prevents reloading the whole site.
>
>
> http://tapestry.apache.org/tapestry5.1/tapestry-core/ref/org/apache/tapestry5/corelib/components/Grid.html
>
> <t:grid ... t:inplace:"true"...>...</t:grid>
>
> greeting
>
> On 20.08.2010 06:43, bugxiaoya wrote:
>
> > I am using Tapestry 5.1 Grid Component for data display.
> > the problem is:
> > when click the sort icon in the table head,it is just redirected to the
> > Start page.
> > set the SymbolConstants.SUPPRESS_REDIRECT_FROM_ACTION_REQUESTS  to be
> "true"
> > in AppModule.contributeApplicationDefaults() can resolve this problem,but
> is
> > there any other way?
> >
> > P.S:the same problem when click the paging label of grid component.
> >
> > the source code is as follows:
> > <t:grid source="users" row="user" add="delete" rowsPerPage="2"
> > pagerPosition="bottom" exclude="id">
> > <p:nameCell>
> > <t:pagelink page="edit" context="user.id">${user.name}
> > </t:pagelink>
> > </p:nameCell>
> > <p:deleteCell>
> > <t:actionlink t:id="delete" context="user.id">${message:delete-label}
> > </t:actionlink>
> > </p:deleteCell>
> > </t:grid>
> >
> >
> http://tapestry.1045711.n5.nabble.com/file/n2641788/%E6%90%9C%E7%8B%97%E6%88%AA%E5%9B%BE_2010-08-20_12-41-38.bmp<http://tapestry.1045711.n5.nabble.com/file/n2641788/%E6%90%9C%E7%8B%97%E6%88%AA%E5%9B%BE_2010-08-20_12-41-38.bmp?by-user=t&by-user=t>
> >
>
>
> *smime.p7s* (6K) Download Attachment<http://attachment/2641993/0/smime.p7s>
>
>
> ------------------------------
>  View message @
> http://tapestry.1045711.n5.nabble.com/tapestry-grid-problem-when-sorting-redirected-to-Start-page-tp2641788p2641993.html
> To unsubscribe from tapestry grid problem,when sorting,redirected to Start
> page, click here<http://tapestry.1045711.n5.nabble.com/template/NodeServlet.jtp?tpl=unsubscribe_by_code&node=2641788&code=YnVneGlhb3lhQGdtYWlsLmNvbXwyNjQxNzg4fC0xNjY4NjgyNzY4>.
>
>
>

-- 
View this message in context: http://tapestry.1045711.n5.nabble.com/tapestry-grid-problem-when-sorting-redirected-to-Start-page-tp2641788p2642432.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

Re: tapestry grid problem,when sorting,redirected to Start page

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
On Fri, 20 Aug 2010 14:09:43 -0300, bugxiaoya <bu...@gmail.com> wrote:

> Index.tml

Hi!

Index is the start page. ;)

-- 
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor
Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

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


Re: tapestry grid problem,when sorting,redirected to Start page

Posted by bugxiaoya <bu...@gmail.com>.
Index.tml

<t:layout xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd"
	xmlns:p="tapestry:parameter">
	<t:grid source="users" row="user" add="delete" rowsPerPage="2"
		pagerPosition="bottom" exclude="id">
		<p:nameCell>
			<t:pagelink page="edit" context="user.id">${user.name}
			</t:pagelink>
		</p:nameCell>
		<p:deleteCell>
			<t:actionlink t:id="delete" context="user.id">Delete
			</t:actionlink>
		</p:deleteCell>
	</t:grid>
</t:layout>



Index.java
public class Index {

	private UserDAO userDAO = new UserDAO();

	private User user;

	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	public List<User> getUsers() {
		return userDAO.findAllUsers();
	}

	void onActionFromDelete(long userId) {
		userDAO.delete(userId);
	}
}

http://tapestry.1045711.n5.nabble.com/file/n2642478/%E6%9C%AA%E5%91%BD%E5%90%8D.jpg 

p.s. when click the delete link in the pic above,it also forwards to the
Start page. I am really confused about that.
-- 
View this message in context: http://tapestry.1045711.n5.nabble.com/tapestry-grid-problem-when-sorting-redirected-to-Start-page-tp2641788p2642478.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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


Re: tapestry grid problem,when sorting,redirected to Start page

Posted by "Joost Schouten (mailing lists)" <jo...@jsportal.com>.
Hi,

Though using ajax might solve it, there is a root cause of this
problem that needs to be addressed.

It almost sounds like  you have a method that catches all events fired
by the grid and forward to the start page. Probably unintentionally by
specifying your component in an event method and not the value (event
name).

Please share with us the full *.tml and *.java of your page with the grid.

Cheers,
Joost

On Fri, Aug 20, 2010 at 2:24 PM, Joost Schouten (ml)
<jo...@jsportal.com> wrote:
> Hi,
>
> Though using ajax might solve it, there is a root cause of this problem that
> needs to be addressed.
>
> It almost sounds like  you have a method that catches all events fired by
> the grid and forward to the start page. Probably unintentionally by
> specifying your component in an event method and not the value (event name).
>
> Please share with us the full *.tml and *.java of your page with the grid.
>
> Cheers,
> Joost
>
> Alexander Muthmann wrote:
>
>  Hi bugxiaoya,
>
> I think you can solve this problem by setting the inPlace parameter of your
> grid. This causes your grid to act like a ajax component and prevents
> reloading the whole site.
>
> http://tapestry.apache.org/tapestry5.1/tapestry-core/ref/org/apache/tapestry5/corelib/components/Grid.html
>
> <t:grid ... t:inplace:"true"...>...</t:grid>
>
> greeting
>
> On 20.08.2010 06:43, bugxiaoya wrote:
>
> I am using Tapestry 5.1 Grid Component for data display.
> the problem is:
> when click the sort icon in the table head,it is just redirected to the
> Start page.
> set the SymbolConstants.SUPPRESS_REDIRECT_FROM_ACTION_REQUESTS  to be "true"
> in AppModule.contributeApplicationDefaults() can resolve this problem,but is
> there any other way?
>
> P.S:the same problem when click the paging label of grid component.
>
> the source code is as follows:
>     <t:grid source="users" row="user" add="delete" rowsPerPage="2"
>         pagerPosition="bottom" exclude="id">
>         <p:nameCell>
>             <t:pagelink page="edit" context="user.id">${user.name}
>             </t:pagelink>
>         </p:nameCell>
>         <p:deleteCell>
>             <t:actionlink t:id="delete"
> context="user.id">${message:delete-label}
>             </t:actionlink>
>         </p:deleteCell>
>     </t:grid>
>
> http://tapestry.1045711.n5.nabble.com/file/n2641788/%E6%90%9C%E7%8B%97%E6%88%AA%E5%9B%BE_2010-08-20_12-41-38.bmp
>
>
>
>

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


Re: tapestry grid problem,when sorting,redirected to Start page

Posted by Alexander Muthmann <am...@dev-eth0.de>.
  Hi bugxiaoya,

I think you can solve this problem by setting the inPlace parameter of 
your grid. This causes your grid to act like a ajax component and 
prevents reloading the whole site.

http://tapestry.apache.org/tapestry5.1/tapestry-core/ref/org/apache/tapestry5/corelib/components/Grid.html

<t:grid ... t:inplace:"true"...>...</t:grid>

greeting

On 20.08.2010 06:43, bugxiaoya wrote:
> I am using Tapestry 5.1 Grid Component for data display.
> the problem is:
> when click the sort icon in the table head,it is just redirected to the
> Start page.
> set the SymbolConstants.SUPPRESS_REDIRECT_FROM_ACTION_REQUESTS  to be "true"
> in AppModule.contributeApplicationDefaults() can resolve this problem,but is
> there any other way?
>
> P.S:the same problem when click the paging label of grid component.
>
> the source code is as follows:
> 	<t:grid source="users" row="user" add="delete" rowsPerPage="2"
> 		pagerPosition="bottom" exclude="id">
> 		<p:nameCell>
> 			<t:pagelink page="edit" context="user.id">${user.name}
> 			</t:pagelink>
> 		</p:nameCell>
> 		<p:deleteCell>
> 			<t:actionlink t:id="delete" context="user.id">${message:delete-label}
> 			</t:actionlink>
> 		</p:deleteCell>
> 	</t:grid>
>
> http://tapestry.1045711.n5.nabble.com/file/n2641788/%E6%90%9C%E7%8B%97%E6%88%AA%E5%9B%BE_2010-08-20_12-41-38.bmp
>