The status form should be submitted using AJAX, while still calling the _validate and _submit functions. The AJAX should submit the form and then re-load the status so it can be displayed properly below the textfield.

I have no idea how to do this apart from using the JavaScript Tools module, and I don't want to add the dependency. If anyone knows how to do this, please explain or roll a patch.

Comments

icecreamyou’s picture

Version: » 6.x-1.x-dev

Switching to 6.x-1.x-dev because 5.x-0.x-dev is hopefully being deleted. Drupal 6.x also has much better support for AJAX, so it should be easier to implement.

This is still planned for 5.x, but will be backported after the 6.x code is complete.

mariusooms’s picture

Component: Code » Code - Functionality

I'm not aware either how...but I happen to use the Friend module for Drupal 6 which uses a "corkboard" for messaging with Ajax support. Maybe it could help gather some ideas on how to implement this by looking at their code?

Kind regards,

Marius

icecreamyou’s picture

I mean, I know the theory, and I've looked through a few modules that do this. The problem isn't the PHP; it's the JavaScript, of which I know next to nothing. Last week I tried to integrate facebook_status with the AJAX Submit module from JSTools but couldn't figure out the JavaScript required to replace any statuses that were already displayed on the page.

...will take a look though when I have time. Which is less and less frequently these days.

icecreamyou’s picture

Status: Active » Closed (fixed)

This isn't going to happen until at least late summer 2009 if I'm the only one responsible for coding it. Closing, in the interest of keeping the issue queue clean.

igorik’s picture

Status: Closed (fixed) » Active

Hi

please look at this module Ajax submit, probably you will be not to need to learn ajax javascript techniques.

thanks for your promising module, with ajax it will be really useable.
Igorik
http://www.somvprahe.sk

icecreamyou’s picture

Status: Active » Postponed

I've looked at that module, as well as its previous iterations. It doesn't work well enough because it doesn't update the status link thing.

michelle’s picture

Just wanted to add a note that the ctools module merlinofchaos is working on will probably help with this. It's not ready, yet, but you may want to have a look when it is.

Michelle

icecreamyou’s picture

I would prefer to have a solution that applies to both 5.x and 6.x, but yes, it's possible that ctools could be useful.

The problem has nothing to do with refreshing the form though, it has to do with identifying everywhere on the page that a status is already displayed and changing it. This is particularly problematic with things like users' recent history, but the most important place is the text that you click on to show/hide the status form, and I don't even know how to do that without making it part of the form itself.

michelle’s picture

Ah, I see. I misunderstood and thought it was the ajax part you were having trouble with. I can't do ajax, myself, and am looking forward to cTools to assist.

Michelle

icecreamyou’s picture

Well, it *is* the AJAX that's the problem... but there are already tools out there that take care of the actual form submission. The problem is that there's more complexity than simply submitting the form.

PGiro’s picture

Have you looked at the popups module ? They seem to do it generically, maybe you can get an idea from there ?Or you can just have your module use that and not worry anymore about all of this... http://drupal.org/project/popups

icecreamyou’s picture

As I've said already, it's more involved than that because there are a number of things on each page that need to be considered. Anyway, it shouldn't be particularly complicated--I just hardly know any JavaScript right now.

Scott Reynolds’s picture

Popups module will actually work. As it submits the form in the popup and you can tell it to RELOAD the page. You can also specify a callback function, which can then add the relevant changes to the page. It is very doable and not nearly as intimating as it is at first glance.

And its fun...

icecreamyou’s picture

There are also two JavaScript-submit modules, neither of which is quite complete enough be completely dependable... plus there's a little more involved than just refreshing the form as it is at this point because the text that you click to reveal the form is handled separately right now. I haven't decided which route to take at this point but I'm thinking about either making everything part of the form or else refreshing the entire block like block_refresh.module. I have very little idea how to do either really but if no one writes a patch I'll look into it when 2.x comes around.

icecreamyou’s picture

Version: 6.x-1.x-dev » 6.x-2.x-dev
Assigned: Unassigned » icecreamyou
Status: Postponed » Active

We're officially on 6.x-2.x now, so I'm re-opening this one. It's one of the few remaining things I need to complete before I will create an official release. Fortunately, Drupal 6 now handles almost everything involved through the #ahah form parameter, so it shouldn't be too difficult.

icecreamyou’s picture

Status: Active » Fixed

Marking as fixed because the basic functionality is there. There are a few bugs but that can be addressed in a different issue.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.