FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Problem with zend anx ajax
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
Problem with zend anx ajax [message #171405] Sat, 01 January 2011 23:30 Go to next message
Sarah is currently offline  Sarah
Messages: 30
Registered: December 2010
Karma: 0
Member
Hi! I've a view with a grid and a year value

in my view

<script type="text/javascript">

$(function() {


$("button, input:submit, a",
".divSearch").button();
$("button, input:submit, a",
".divSearch").click(function() {

url = "../wssconsumi/recallws";
data = 'year=' + $("#ddlYear").val();

$.ajax({

type: "POST",
url: url,
data: data,
dataType: "html",
async: true,
success: function(resp) {

jQuery("#flex1").flexReload();
}

});
return false;
});
});

</script>

..


<td >Select year :
<select id="ddlYear" style="width:150px">

<?php

$current_year = (int)date('Y');

// for ($i=1990;$i<=$current_year;$i++)
for ($i=$current_year;$i>=1990;$i--){
echo '<option value="' . $i . '">' .
$i .'</option>';
}

?>
</select></td>

<td> <div class="divSearch"><button>Show records</
button></div> </td>
</tr>




in my controller


public function recallwsAction()
{
if ($this->getRequest()->isPost())
{

$data = $this->getRequest()->getPost();
$this->callws($data['year']);
exit;
}
}





But I think that app never goes in this action .... where is it my
error?
Re: Problem with zend anx ajax [message #171406 is a reply to message #171405] Sat, 01 January 2011 23:31 Go to previous messageGo to next message
Jerry Stuckle is currently offline  Jerry Stuckle
Messages: 2598
Registered: September 2010
Karma: 0
Senior Member
On 1/1/2011 6:30 PM, Sarah wrote:
> Hi! I've a view with a grid and a year value
>
> in my view
>
> <script type="text/javascript">
>
> $(function() {
>
>
> $("button, input:submit, a",
> ".divSearch").button();
> $("button, input:submit, a",
> ".divSearch").click(function() {
>
> url = "../wssconsumi/recallws";
> data = 'year=' + $("#ddlYear").val();
>
> $.ajax({
>
> type: "POST",
> url: url,
> data: data,
> dataType: "html",
> async: true,
> success: function(resp) {
>
> jQuery("#flex1").flexReload();
> }
>
> });
> return false;
> });
> });
>
> </script>
>
> ..
>
>
> <td>Select year :
> <select id="ddlYear" style="width:150px">
>
> <?php
>
> $current_year = (int)date('Y');
>
> // for ($i=1990;$i<=$current_year;$i++)
> for ($i=$current_year;$i>=1990;$i--){
> echo '<option value="' . $i . '">' .
> $i .'</option>';
> }
>
> ?>
> </select></td>
>
> <td> <div class="divSearch"><button>Show records</
> button></div> </td>
> </tr>
>
>
>
>
> in my controller
>
>
> public function recallwsAction()
> {
> if ($this->getRequest()->isPost())
> {
>
> $data = $this->getRequest()->getPost();
> $this->callws($data['year']);
> exit;
> }
> }
>
>
>
>
>
> But I think that app never goes in this action .... where is it my
> error?
>

Is your javascript working? That's the first place to start. Try
comp.lang.javascript (where AJAX questions are handled).

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex(at)attglobal(dot)net
==================
Re: Problem with zend anx ajax [message #171408 is a reply to message #171405] Sun, 02 January 2011 02:35 Go to previous message
Thomas 'PointedEars'  is currently offline  Thomas 'PointedEars'
Messages: 701
Registered: October 2010
Karma: 0
Senior Member
Sarah wrote:

> […]
> in my controller
>
> public function recallwsAction()
> {
> if ($this->getRequest()->isPost())
> {
>
> $data = $this->getRequest()->getPost();
> $this->callws($data['year']);
> exit;
> }
> }
>
> But I think that app never goes in this action ....

You *think* you know, or do you *actually* know? How about debugging your
code before posting?

> where is it my error?

You have not debugged, and you are not posting the URL that should cause it
to be called or tell anything of the surrounding circumstances that are
necessary to help you.

And I am sorry to say that based on your postings, here and in
comp.lang.javascript, and your ongoing blindly throwing in frameworks
without getting the basics right first, you are not quite ready for Zend
Framework and its rather complex, MVC-based approach.

Try building simpler things first, *a lot* simpler ones to be sure (and
don't start with frameworks, they keep you from learning how things work).
Rome wasn't built in a day.

Your code style, at least that on Usenet, is a god-awful mess, too. Please
get some tutorial on code style, or a better newsreader that does no include
all those extra spaces and newlines for a start. TIA from my eyes.


PointedEars
--
Danny Goodman's books are out of date and teach practices that are
positively harmful for cross-browser scripting.
-- Richard Cornford, cljs, <cife6q$253$1$8300dec7(at)news(dot)demon(dot)co(dot)uk> (2004)
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Google calendar and apps
Next Topic: PHP
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Tue Nov 26 23:35:36 GMT 2024

Total time taken to generate the page: 0.06581 seconds