woensdag 26 januari 2011

Date acception

Seems like that the date accepted is fixed by now. The next thing I want to try to sort out now is the edit match. Since there are still a few issues wrong with that page. Let me try to explain this part.

The game selection is an ajax call. And when selecting a game, it sends out a request to fetch the information for that game. While creating a match this seems to be working properly since I am more or less "manually" triggering that ajax call to take place (since it happends when i select a game)

However, when requesting the same page back (after pressing save for instance) this manual process is not there at that time. So, my assumption at this point is that the ajax call does not take place, thus it can not fill in all the bits and pieces like Mode, Map etc since the game is just not there yet.

So thats the next thing I need to fix here and there just to make the edit process a bit more 'logical' and understandable what is really happening at that point.

Edit1:
Well, my first assumption seems to be correct. After the form submit take place the ajaxcall is not being triggered. The cool thing though is that the whole result of the ajaxpage is just a part of a form. So... if I can just include that part of the form when I am editing it, I should be halfway there.

Edit2:
So yeah, that should sort it. I am including the same form as the ajax call but now as a PHP Include file. This leads me with a new issue (which I just sorted). Since an ajaxcall is nothing but a new php page request. So it does not have any database connection etc.

While this is all being included from one configuration file, and this config file has one perticular function that only exists in this config file for setting up the database connection, i am simply using 'function_exists' to test if this page is used for an Ajax call, or just being included directly inside the form itself

Now, the thing I do know by now is that a form submit has a post array, while the ajax call does not. With that in mind I am able to tell the difference between if its an form include or an ajax call...

You still follow me? I hope not...

Edit3:
So now i need to grab the values for those parts which are being handled through the ajax part. Which are in this case:

- map1
- map2
- map3

So that should sum up that part i think. Lets implement this one while we are at it.

Edit4 (last one for now I think):
I also changed the same thing with the Dates and Times. Since those never received a default value which was entered by the user. This should be fixed by now

Geen opmerkingen:

Een reactie posten