Doubt about implementing Ajax request
9 answers - 1509 bytes -

Guys, please help me, if possible.
I have a page with a search form, and those form fields are used as
parameteres for a search query (SQL).
There are two content holders, that are div tags with specified ids, to hold
the ajax return of the search and ajax return of the search details.
Those content holders are placed bellow the search form, on the same page.
What is the search result and what is the search detail?
Well, the search result is a 6 columns table sqlmodel component (from
contrib library) where the first column is the pk of the database entry that
is displayed and the last column is a button to invoke the display of the
details.
The search detail is a table that displays less relevant informations about
one row of the search.
so lets suppose that
1 - I have the form page with the submit button
2 - I have a tapestry tabel component that returns the search result
3 - I have a class that returns a string containing the html code of that
detail table associated with a primary key.
4 - I have a button on the result table, for each row, that passes the id of
the row as atttribute or parameter
5 - I have the place holders identified (two div tags)
How shoul I implement the ajax call for the search and the detail? Please,
step by step explanatuion if possble.
My big problem is how to do this call, i tried some approaches to solve
this, but none was sucessful.
Thanks everyone.
No.1 | | 1863 bytes |
| 
you should look at the excellent Tacos framework to help you on this. It
makes Ajax with Tapestry a breeze, thanks to some great work done.
http://tacos.sourceforge.net/
in addition, if need be, you can look at Dojo and DWR to help you with Ajax.
9/21/06, Daniel Castro <dfcastro (AT) gmail (DOT) comwrote:
Guys, please help me, if possible.
I have a page with a search form, and those form fields are used as
parameteres for a search query (SQL).
There are two content holders, that are div tags with specified ids, to
hold
the ajax return of the search and ajax return of the search details.
Those content holders are placed bellow the search form, on the same page.
What is the search result and what is the search detail?
Well, the search result is a 6 columns table sqlmodel component (from
contrib library) where the first column is the pk of the database entry
that
is displayed and the last column is a button to invoke the display of the
details.
The search detail is a table that displays less relevant informations
about
one row of the search.
so lets suppose that
1 - I have the form page with the submit button
2 - I have a tapestry tabel component that returns the search result
3 - I have a class that returns a string containing the html code of that
detail table associated with a primary key.
4 - I have a button on the result table, for each row, that passes the id
of
the row as atttribute or parameter
5 - I have the place holders identified (two div tags)
How shoul I implement the ajax call for the search and the detail? Please,
step by step explanatuion if possble.
My big problem is how to do this call, i tried some approaches to solve
this, but none was sucessful.
Thanks everyone.
No.2 | | 2077 bytes |
| 
Thanks :) I will look :)
But I thought tapestry 4.1 would have some features for ajax submit already
implemented.
9/20/06, Karthik N <karthik.nar (AT) gmail (DOT) comwrote:
you should look at the excellent Tacos framework to help you on this. It
makes Ajax with Tapestry a breeze, thanks to some great work done.
http://tacos.sourceforge.net/
in addition, if need be, you can look at Dojo and DWR to help you with
Ajax.
9/21/06, Daniel Castro <dfcastro (AT) gmail (DOT) comwrote:
Guys, please help me, if possible.
I have a page with a search form, and those form fields are used as
parameteres for a search query (SQL).
There are two content holders, that are div tags with specified ids, to
hold
the ajax return of the search and ajax return of the search details.
Those content holders are placed bellow the search form, on the same
page.
What is the search result and what is the search detail?
Well, the search result is a 6 columns table sqlmodel component (from
contrib library) where the first column is the pk of the database entry
that
is displayed and the last column is a button to invoke the display of
the
details.
The search detail is a table that displays less relevant informations
about
one row of the search.
so lets suppose that
1 - I have the form page with the submit button
2 - I have a tapestry tabel component that returns the search result
3 - I have a class that returns a string containing the html code of
that
detail table associated with a primary key.
4 - I have a button on the result table, for each row, that passes the
id
of
the row as atttribute or parameter
5 - I have the place holders identified (two div tags)
How shoul I implement the ajax call for the search and the detail?
Please,
step by step explanatuion if possble.
My big problem is how to do this call, i tried some approaches to solve
this, but none was sucessful.
Thanks everyone.
No.3 | | 2608 bytes |
| 
Yes it does. Your post looked complicated enough that I figured you already
knew that and ran into other issuesIt's fairly trivial to do what you
want with all of the built in components if you read the documentation
provided for them.
Just don't go trying to modify a table. No matter how great our ajax stuff
is it can't make IE not suck. (though the new FilteringTable will help when
it lands soon)
9/21/06, Daniel Castro <dfcastro (AT) gmail (DOT) comwrote:
Thanks :) I will look :)
But I thought tapestry 4.1 would have some features for ajax submit
already
implemented.
9/20/06, Karthik N <karthik.nar (AT) gmail (DOT) comwrote:
you should look at the excellent Tacos framework to help you on this.
It
makes Ajax with Tapestry a breeze, thanks to some great work done.
http://tacos.sourceforge.net/
in addition, if need be, you can look at Dojo and DWR to help you with
Ajax.
9/21/06, Daniel Castro <dfcastro (AT) gmail (DOT) comwrote:
Guys, please help me, if possible.
I have a page with a search form, and those form fields are used as
parameteres for a search query (SQL).
There are two content holders, that are div tags with specified ids,
to
hold
the ajax return of the search and ajax return of the search details.
Those content holders are placed bellow the search form, on the same
page.
What is the search result and what is the search detail?
Well, the search result is a 6 columns table sqlmodel component (from
contrib library) where the first column is the pk of the database
entry
that
is displayed and the last column is a button to invoke the display of
the
details.
The search detail is a table that displays less relevant informations
about
one row of the search.
so lets suppose that
1 - I have the form page with the submit button
2 - I have a tapestry tabel component that returns the search result
3 - I have a class that returns a string containing the html code of
that
detail table associated with a primary key.
4 - I have a button on the result table, for each row, that passes the
id
of
the row as atttribute or parameter
5 - I have the place holders identified (two div tags)
How shoul I implement the ajax call for the search and the detail?
Please,
step by step explanatuion if possble.
My big problem is how to do this call, i tried some approaches to
solve
this, but none was sucessful.
Thanks everyone.
No.4 | | 2978 bytes |
| 
The problem is that the documentation was not clear, for me, and I dont know
what Tapestry API to use to make an Ajax callto invoke a method of a
class of mine and receive the response. and also how to make the binding
between my button and the class method to call
9/21/06, Jesse Kuhnert <jkuhnert (AT) gmail (DOT) comwrote:
Yes it does. Your post looked complicated enough that I figured you
already
knew that and ran into other issuesIt's fairly trivial to do what you
want with all of the built in components if you read the documentation
provided for them.
Just don't go trying to modify a table. No matter how great our ajax stuff
is it can't make IE not suck. (though the new FilteringTable will help
when
it lands soon)
9/21/06, Daniel Castro <dfcastro (AT) gmail (DOT) comwrote:
Thanks :) I will look :)
But I thought tapestry 4.1 would have some features for ajax submit
already
implemented.
9/20/06, Karthik N <karthik.nar (AT) gmail (DOT) comwrote:
you should look at the excellent Tacos framework to help you on this.
It
makes Ajax with Tapestry a breeze, thanks to some great work done.
http://tacos.sourceforge.net/
in addition, if need be, you can look at Dojo and DWR to help you with
Ajax.
9/21/06, Daniel Castro <dfcastro (AT) gmail (DOT) comwrote:
Guys, please help me, if possible.
I have a page with a search form, and those form fields are used as
parameteres for a search query (SQL).
There are two content holders, that are div tags with specified ids,
to
hold
the ajax return of the search and ajax return of the search details.
Those content holders are placed bellow the search form, on the same
page.
What is the search result and what is the search detail?
Well, the search result is a 6 columns table sqlmodel component
(from
contrib library) where the first column is the pk of the database
entry
that
is displayed and the last column is a button to invoke the display
of
the
details.
The search detail is a table that displays less relevant
informations
about
one row of the search.
so lets suppose that
1 - I have the form page with the submit button
2 - I have a tapestry tabel component that returns the search result
3 - I have a class that returns a string containing the html code of
that
detail table associated with a primary key.
4 - I have a button on the result table, for each row, that passes
the
id
of
the row as atttribute or parameter
5 - I have the place holders identified (two div tags)
How shoul I implement the ajax call for the search and the detail?
Please,
step by step explanatuion if possble.
My big problem is how to do this call, i tried some approaches to
solve
this, but none was sucessful.
Thanks everyone.
No.5 | | 3272 bytes |
| 
Anyone?
I am using Ajax 4.1. Need to do an ajax request to a class method so this
method will do a search on database and return the result to the page. How
to do it?
9/21/06, Daniel Castro <dfcastro (AT) gmail (DOT) comwrote:
The problem is that the documentation was not clear, for me, and I dont
know what Tapestry API to use to make an Ajax callto invoke a method of a
class of mine and receive the response. and also how to make the binding
between my button and the class method to call
--
9/21/06, Jesse Kuhnert <jkuhnert (AT) gmail (DOT) comwrote:
Yes it does. Your post looked complicated enough that I figured you
already
knew that and ran into other issuesIt's fairly trivial to do what
you
want with all of the built in components if you read the documentation
provided for them.
Just don't go trying to modify a table. No matter how great our ajax
stuff
is it can't make IE not suck. (though the new FilteringTable will help
when
it lands soon)
9/21/06, Daniel Castro < dfcastro (AT) gmail (DOT) comwrote:
Thanks :) I will look :)
But I thought tapestry 4.1 would have some features for ajax submit
already
implemented.
9/20/06, Karthik N <karthik.nar (AT) gmail (DOT) comwrote:
you should look at the excellent Tacos framework to help you on
this.
It
makes Ajax with Tapestry a breeze, thanks to some great work done.
http://tacos.sourceforge.net/
in addition, if need be, you can look at Dojo and DWR to help you
with
Ajax.
9/21/06, Daniel Castro <dfcastro (AT) gmail (DOT) comwrote:
Guys, please help me, if possible.
I have a page with a search form, and those form fields are used
as
parameteres for a search query (SQL).
There are two content holders, that are div tags with specified
ids,
to
hold
the ajax return of the search and ajax return of the search
details.
Those content holders are placed bellow the search form, on the
same
page.
What is the search result and what is the search detail?
Well, the search result is a 6 columns table sqlmodel component
(from
contrib library) where the first column is the pk of the database
entry
that
is displayed and the last column is a button to invoke the display
of
the
details.
The search detail is a table that displays less relevant
informations
about
one row of the search.
so lets suppose that
1 - I have the form page with the submit button
2 - I have a tapestry tabel component that returns the search
result
3 - I have a class that returns a string containing the html code
of
that
detail table associated with a primary key.
4 - I have a button on the result table, for each row, that passes
the
id
of
the row as atttribute or parameter
5 - I have the place holders identified (two div tags)
How shoul I implement the ajax call for the search and the detail?
Please,
step by step explanatuion if possble.
My big problem is how to do this call, i tried some approaches to
solve
this, but none was sucessful.
Thanks everyone.
No.6 | | 3501 bytes |
| 
Look for the parameters "updateComponents/async" in most of the Submit/Link
/ Form type components in the 4.1 documentation.
9/21/06, Daniel Castro <dfcastro (AT) gmail (DOT) comwrote:
Anyone?
I am using Ajax 4.1. Need to do an ajax request to a class method so this
method will do a search on database and return the result to the
page. How
to do it?
9/21/06, Daniel Castro <dfcastro (AT) gmail (DOT) comwrote:
The problem is that the documentation was not clear, for me, and I dont
know what Tapestry API to use to make an Ajax callto invoke a method
of a
class of mine and receive the response. and also how to make the binding
between my button and the class method to call
--
9/21/06, Jesse Kuhnert <jkuhnert (AT) gmail (DOT) comwrote:
Yes it does. Your post looked complicated enough that I figured you
already
knew that and ran into other issuesIt's fairly trivial to do what
you
want with all of the built in components if you read the documentation
provided for them.
Just don't go trying to modify a table. No matter how great our ajax
stuff
is it can't make IE not suck. (though the new FilteringTable will help
when
it lands soon)
9/21/06, Daniel Castro < dfcastro (AT) gmail (DOT) comwrote:
Thanks :) I will look :)
But I thought tapestry 4.1 would have some features for ajax submit
already
implemented.
9/20/06, Karthik N <karthik.nar (AT) gmail (DOT) comwrote:
you should look at the excellent Tacos framework to help you on
this.
It
makes Ajax with Tapestry a breeze, thanks to some great work done.
http://tacos.sourceforge.net/
in addition, if need be, you can look at Dojo and DWR to help you
with
Ajax.
9/21/06, Daniel Castro <dfcastro (AT) gmail (DOT) comwrote:
Guys, please help me, if possible.
I have a page with a search form, and those form fields are used
as
parameteres for a search query (SQL).
There are two content holders, that are div tags with specified
ids,
to
hold
the ajax return of the search and ajax return of the search
details.
Those content holders are placed bellow the search form, on the
same
page.
What is the search result and what is the search detail?
Well, the search result is a 6 columns table sqlmodel component
(from
contrib library) where the first column is the pk of the
database
entry
that
is displayed and the last column is a button to invoke the
display
of
the
details.
The search detail is a table that displays less relevant
informations
about
one row of the search.
so lets suppose that
1 - I have the form page with the submit button
2 - I have a tapestry tabel component that returns the search
result
3 - I have a class that returns a string containing the html
code
of
that
detail table associated with a primary key.
4 - I have a button on the result table, for each row, that
passes
the
id
of
the row as atttribute or parameter
5 - I have the place holders identified (two div tags)
How shoul I implement the ajax call for the search and the
detail?
Please,
step by step explanatuion if possble.
My big problem is how to do this call, i tried some approaches
to
solve
this, but none was sucessful.
Thanks everyone.
No.7 | | 5213 bytes |
| 
I am still working with my Ajax issues, and made some progress.
I am using the upateComponents attribute, but nothing happens.
Well, let me explain how is organized the page that uses ajax.
I have a page with a form to search and a submit button. When I submit the
search a resultgrid is displayed. This resultGrid is a component that
extends from BaseComponent ad has a DirectLink to show the details. This
DirectLink is shown below.
<a jwcid="@DirectLink" parameters="ognl:elemento.produto.catalogo"
listener="listener:doSomething" async="ognl:true"
updateComponents="ognl:{'detalhe'}">
public void doSomething(String id){
CmdSelectProdutoDetalhe cmd = new CmdSelectProdutoDetalhe(id);
detalhe = cmd.executar();
System.out.println(detalhe.getDimensoes().toString ());
System.out.println(detalhe.getPreco().toString());
DetalheGrid detalhegrid =
(DetalheGrid)this.getPage().getComponent("detalhe");
detalhegrid.setElemento(detalhe);
}
My page has a component called 'detalhe'
<table jwcid="detalhe" cssClass="resultadoBuscaDetalhe"
componentId="detalhe">
But everytime I click on the direct link i receive a message 'WARNING:
20:32:19: No ajax-response elements recieved.'
How to use an ajax request from a page component to update another page
component?
- Page P has the components A and B
- A displays a link and when I click on that link I execute doSomething
method and populate B and display it.
How to do it?
9/21/06, Jesse Kuhnert <jkuhnert (AT) gmail (DOT) comwrote:
Look for the parameters "updateComponents/async" in most of the
Submit/Link
/ Form type components in the 4.1 documentation.
9/21/06, Daniel Castro <dfcastro (AT) gmail (DOT) comwrote:
Anyone?
I am using Ajax 4.1. Need to do an ajax request to a class method so
this
method will do a search on database and return the result to the
page. How
to do it?
9/21/06, Daniel Castro <dfcastro (AT) gmail (DOT) comwrote:
The problem is that the documentation was not clear, for me, and I
dont
know what Tapestry API to use to make an Ajax callto invoke a
method
of a
class of mine and receive the response. and also how to make the
binding
between my button and the class method to call
--
9/21/06, Jesse Kuhnert <jkuhnert (AT) gmail (DOT) comwrote:
Yes it does. Your post looked complicated enough that I figured you
already
knew that and ran into other issuesIt's fairly trivial to do
what
you
want with all of the built in components if you read the
documentation
provided for them.
Just don't go trying to modify a table. No matter how great our ajax
stuff
is it can't make IE not suck. (though the new FilteringTable will
help
when
it lands soon)
9/21/06, Daniel Castro < dfcastro (AT) gmail (DOT) comwrote:
Thanks :) I will look :)
But I thought tapestry 4.1 would have some features for ajax
submit
already
implemented.
9/20/06, Karthik N <karthik.nar (AT) gmail (DOT) comwrote:
you should look at the excellent Tacos framework to help you on
this.
It
makes Ajax with Tapestry a breeze, thanks to some great work
done.
http://tacos.sourceforge.net/
in addition, if need be, you can look at Dojo and DWR to help
you
with
Ajax.
9/21/06, Daniel Castro <dfcastro (AT) gmail (DOT) comwrote:
Guys, please help me, if possible.
I have a page with a search form, and those form fields are
used
as
parameteres for a search query (SQL).
There are two content holders, that are div tags with
specified
ids,
to
hold
the ajax return of the search and ajax return of the search
details.
Those content holders are placed bellow the search form, on
the
same
page.
What is the search result and what is the search detail?
Well, the search result is a 6 columns table sqlmodel
component
(from
contrib library) where the first column is the pk of the
database
entry
that
is displayed and the last column is a button to invoke the
display
of
the
details.
The search detail is a table that displays less relevant
informations
about
one row of the search.
so lets suppose that
1 - I have the form page with the submit button
2 - I have a tapestry tabel component that returns the search
result
3 - I have a class that returns a string containing the html
code
of
that
detail table associated with a primary key.
4 - I have a button on the result table, for each row, that
passes
the
id
of
the row as atttribute or parameter
5 - I have the place holders identified (two div tags)
How shoul I implement the ajax call for the search and the
detail?
Please,
step by step explanatuion if possble.
My big problem is how to do this call, i tried some approaches
to
solve
this, but none was sucessful.
Thanks everyone.
No.8 | | 6112 bytes |
| 
HmmmIt sounds like you have a lot going on here. The example given is
hard to follow for me but I can give you some hints?
When you specify updateComponents="" or call
(String
id) what will happen is that your components
IComponent.renderComponent(IMarkupWriter
writer, IRequestCycle cycle) method will be called. Whatever content you
write to that writer ~will~ be sent back out to the response.
Perhaps you should start with something simpler to find the source of your
problem? Ie just have a page with a DirectLink that updates a normal Table
and see if you can get that to workWhen you get past that you can slowly
start to incorporate what you did there into your custom component to find
the source of the problem.
9/24/06, Daniel Castro <dfcastro (AT) gmail (DOT) comwrote:
I am still working with my Ajax issues, and made some progress.
I am using the upateComponents attribute, but nothing happens.
Well, let me explain how is organized the page that uses ajax.
I have a page with a form to search and a submit button. When I submit
the
search a resultgrid is displayed. This resultGrid is a component that
extends from BaseComponent ad has a DirectLink to show the details. This
DirectLink is shown below.
<a jwcid="@DirectLink" parameters="ognl:elemento.produto.catalogo"
listener="listener:doSomething" async="ognl:true"
updateComponents="ognl:{'detalhe'}">
public void doSomething(String id){
CmdSelectProdutoDetalhe cmd = new CmdSelectProdutoDetalhe(id);
detalhe = cmd.executar();
System.out.println(detalhe.getDimensoes().toString ());
System.out.println(detalhe.getPreco().toString());
DetalheGrid detalhegrid =
(DetalheGrid)this.getPage().getComponent("detalhe");
detalhegrid.setElemento(detalhe);
}
My page has a component called 'detalhe'
<table jwcid="detalhe" cssClass="resultadoBuscaDetalhe"
componentId="detalhe">
But everytime I click on the direct link i receive a message 'WARNING:
20:32:19: No ajax-response elements recieved.'
How to use an ajax request from a page component to update another page
component?
- Page P has the components A and B
- A displays a link and when I click on that link I execute doSomething
method and populate B and display it.
How to do it?
>
>
>
9/21/06, Jesse Kuhnert <jkuhnert (AT) gmail (DOT) comwrote:
Look for the parameters "updateComponents/async" in most of the
Submit/Link
/ Form type components in the 4.1 documentation.
9/21/06, Daniel Castro <dfcastro (AT) gmail (DOT) comwrote:
Anyone?
I am using Ajax 4.1. Need to do an ajax request to a class method so
this
method will do a search on database and return the result to the
page. How
to do it?
9/21/06, Daniel Castro <dfcastro (AT) gmail (DOT) comwrote:
The problem is that the documentation was not clear, for me, and I
dont
know what Tapestry API to use to make an Ajax callto invoke a
method
of a
class of mine and receive the response. and also how to make the
binding
between my button and the class method to call
--
9/21/06, Jesse Kuhnert <jkuhnert (AT) gmail (DOT) comwrote:
Yes it does. Your post looked complicated enough that I figured
you
already
knew that and ran into other issuesIt's fairly trivial to do
what
you
want with all of the built in components if you read the
documentation
provided for them.
Just don't go trying to modify a table. No matter how great our
ajax
stuff
is it can't make IE not suck. (though the new FilteringTable will
help
when
it lands soon)
9/21/06, Daniel Castro < dfcastro (AT) gmail (DOT) comwrote:
Thanks :) I will look :)
But I thought tapestry 4.1 would have some features for ajax
submit
already
implemented.
9/20/06, Karthik N <karthik.nar (AT) gmail (DOT) comwrote:
you should look at the excellent Tacos framework to help you
on
this.
It
makes Ajax with Tapestry a breeze, thanks to some great work
done.
http://tacos.sourceforge.net/
in addition, if need be, you can look at Dojo and DWR to help
you
with
Ajax.
9/21/06, Daniel Castro <dfcastro (AT) gmail (DOT) comwrote:
Guys, please help me, if possible.
I have a page with a search form, and those form fields are
used
as
parameteres for a search query (SQL).
There are two content holders, that are div tags with
specified
ids,
to
hold
the ajax return of the search and ajax return of the search
details.
Those content holders are placed bellow the search form, on
the
same
page.
What is the search result and what is the search detail?
Well, the search result is a 6 columns table sqlmodel
component
(from
contrib library) where the first column is the pk of the
database
entry
that
is displayed and the last column is a button to invoke the
display
of
the
details.
The search detail is a table that displays less relevant
informations
about
one row of the search.
so lets suppose that
1 - I have the form page with the submit button
2 - I have a tapestry tabel component that returns the
search
result
3 - I have a class that returns a string containing the html
code
of
that
detail table associated with a primary key.
4 - I have a button on the result table, for each row, that
passes
the
id
of
the row as atttribute or parameter
5 - I have the place holders identified (two div tags)
How shoul I implement the ajax call for the search and the
detail?
Please,
step by step explanatuion if possble.
My big problem is how to do this call, i tried some
approaches
to
solve
this, but none was sucessful.
Thanks everyone.
No.9 | | 617 bytes |
| 
I solved the problem.
now instead of having two components that intereact each other, I have a
single component. Muche easier :D Thanks everyone for the help.
We shall go on to the end.
We shall fight in France
We shall fightover the seas and oceans.
We shall fight with growing confidence and growing strength in the air.
We shall defend our island whatever the cost may be
We shall fight on beaches, we shall fight on the landing grounds,
We shall fight in the fields and in the streets,
We shall fight on the hills.
We shall never surrender.
Winston Churchill