Hi Marc,
I started working on my third task which is applying ajax behavior for "Insert for a table in Database structure" option. I will update you soon with the progress. Thank you.
Regards, Thilanka.
Thilanka Kaushalya a écrit :
Hi Marc,
I started working on my third task which is applying ajax behavior for "Insert for a table in Database structure" option. I will update you soon with the progress. Thank you.
Regards, Thilanka.
Thilanka, what will be your strategy on this (about avoiding code duplication)?
Hi Marc,
what will be your strategy on this (about avoiding code duplication)?
I was able to do the first part of ajaxify the insert option in the
db->structure. I basically used db_structure.php and db_structure.js files for this modification.
In db_structure.js file I have used the two action to handle this.
1. $("td.insert_table a.ajax").live('click',function(event){}) 2. $("#insertForm .insertRowTable input[value=Go], #buttonYes ").live('click', function(event) {})
In first event I used to pop up a dialog which carries the "insert table" form and I don't think it need any modification. Then the second event handles the action after clicking the "Go" buttons at the "InsertRowTable" tables and the "Go" button at the "actions_panel". Currently I'm using the same action logic for both button clicks because I cannot clearly identify the importance of options in the "actions_panel" at this pop up dialog box. Please clarify me on this issue.
Currently after inserting to a table using this ajax form, the "Rows" column in the "tablesForm" does not get update. I tried to a get a similar approach in my last task for that by collecting the echos of "tablesForm" in the db_structure.php to a variable and then send it via PMA_ajaxResponse() method. But since db_structure.php uses PMA_TableHeader() method to echo the headers of the table it is difficult to do that. So what do you prefer in this situation.
Please help me on these issues. Thank you.
Regards, Thilanka.
Thilanka Kaushalya a écrit :
Hi Marc,
what will be your strategy on this (about avoiding code duplication)?
I was able to do the first part of ajaxify the insert option in the db->structure. I basically used db_structure.php and db_structure.js files for this modification.
In db_structure.js file I have used the two action to handle this.
- $("td.insert_table a.ajax").live('click',function(event){})
- $("#insertForm .insertRowTable input[value=Go], #buttonYes ").live('click', function(event) {})
In first event I used to pop up a dialog which carries the "insert table" form and I don't think it need any modification. Then the second event handles the action after clicking the "Go" buttons at the "InsertRowTable" tables and the "Go" button at the "actions_panel". Currently I'm using the same action logic for both button clicks because I cannot clearly identify the importance of options in the "actions_panel" at this pop up dialog box. Please clarify me on this issue.
In actions_panel (when called in this Ajax context), the possibility of inserting more than one row (insert another new row) is the most interesting option.
Is this a problem to leave all the options? for example, a space problem in the popup?
Currently after inserting to a table using this ajax form, the "Rows" column in the "tablesForm" does not get update. I tried to a get a similar approach in my last task for that by collecting the echos of "tablesForm" in the db_structure.php to a variable and then send it via PMA_ajaxResponse() method. But since db_structure.php uses PMA_TableHeader() method to echo the headers of the table it is difficult to do that. So what do you prefer in this situation.
Many things can happen in an insert: it may fail, or maybe the user inserted more than one row. So we cannot just increment the number of rows by one, using the previous number.
It would be acceptable to count again the number of rows with PMA_Table::countRecords().
Please help me on these issues. Thank you.
Regards, Thilanka.
It would be easier to test your actual code; please push it.
Hi Marc,
I pushed my changes to the repository. Please check that. Thank you.
Regards, Thilanka.
Le 2011-06-10 22:41, Thilanka Kaushalya a écrit :
Hi Marc,
I pushed my changes to the repository. Please check that. Thank you.
Regards, Thilanka.
Thilanka, tested under Vista + Firefox 4.0.1.
1. After clicking Insert, Firebug reports a JS error "Node cannot be inserted at the specified point in the hierarchy".
2. I have to wait up to 5 seconds before the insert panel appear, do you see the same wait time?
3. Insert is done correctly but the row count is not updated.
4. Continue insertion does not work (not sure it's necessary to show this dialog in this situation, however).
5. "Show insert query" does not show the query.
Hi Marc,
- After clicking Insert, Firebug reports a JS error
"Node cannot be inserted at the specified point in the hierarchy".
I does not get such an error. Please can you clarify me the scenario.
- I have to wait up to 5 seconds before the insert panel appear, do you
see the same wait time?
Yes same problem here. I see there are lot of get() queries on firebug
during the insert dialog pop up. My be it make slow the system. What can I do for this kind of issue. Please clarify me on this.
- Insert is done correctly but the row count is not updated.
Still I could not finished it. I'll update you tomorrow on this.
4. Continue insertion does not work (not sure it's necessary to show
this dialog in this situation, however).
I used the "*currrent_insert_table.trigger('click');"* option to trigger
back the insert table dialog for this option. It works correctly once and after that it get failed. I cannot find any issue with that. Please can you check that.
- "Show insert query" does not show the query.
Now it works.
I pushed my changes to the repo. Please check that. Thank you.
Regards, Thilanka.
Thilanka Kaushalya a écrit :
Hi Marc,
1. After clicking Insert, Firebug reports a JS error "Node cannot be inserted at the specified point in the hierarchy".
I does not get such an error. Please can you clarify me the scenario.
I saw this at home under Vista. Now at work and I cannot see it. The scenario is just to open the sakila database and click Insert for one of the tables.
2. I have to wait up to 5 seconds before the insert panel appear, do you see the same wait time?
Yes same problem here. I see there are lot of get() queries on firebug during the insert dialog pop up. My be it make slow the system. What can I do for this kind of issue. Please clarify me on this.
Firebug / network panel shows a stall on js/update-location.js.
3. Insert is done correctly but the row count is not updated.
Still I could not finished it. I'll update you tomorrow on this.
OK.
4. Continue insertion does not work (not sure it's necessary to show this dialog in this situation, however).
I used the "*/currrent_insert_table.trigger('click');"/* option to trigger back the insert table dialog for this option. It works correctly once and after that it get failed. I cannot find any issue with that. Please can you check that.
Now it seems to work everytime!
5. "Show insert query" does not show the query.
Now it works.
Great.
Hi Marc,
I saw this at home under Vista. Now at work and I cannot see it. The
scenario is just to open the sakila database and click Insert for one of the tables.
Firebug / network panel shows a stall on js/update-location.js.
I'll check these two issues.
4. Continue insertion does not work (not sure it's necessary to show
this dialog in this situation, however).
I used the "*/currrent_insert_table.trigger('click');"/* option to trigger back the insert table dialog for this option. It works correctly once and after that it get failed. I cannot find any issue with that. Please can you check that.
Now it seems to work everytime!
Is it working? In my machine it is not working properly.
Regards, Thilanka.
Thilanka Kaushalya a écrit :
Hi Marc,
I saw this at home under Vista. Now at work and I cannot see it. The scenario is just to open the sakila database and click Insert for one of the tables. Firebug / network panel shows a stall on js/update-location.js.
I'll check these two issues.
> 4. Continue insertion does not work (not sure it's necessary to show > this dialog in this situation, however). > > I used the "*/currrent_insert_table.trigger('click');"/* option to > trigger back the insert table dialog for this option. It works correctly > once and after that it get failed. I cannot find any issue with that. > Please can you check that. Now it seems to work everytime!
Is it working? In my machine it is not working properly.
Still works for me. Tested with Windows XP / Firefox 4.0.1 and the sakila.actor table. Increasing from 2 to 5 rows to insert, works fine the first time and the other times too. Maybe we are not testing the same thing or with the same browser.
Hi Marc,
2. I have to wait up to 5 seconds before the insert panel appear, do
you
see the same wait time?
Yes same problem here. I see there are lot of get() queries on firebug during the insert dialog pop up. My be it make slow the system. What can I do for this kind of issue. Please clarify me on this.
Firebug / network panel shows a stall on js/update-location.js.
Yes I also see delays at update-location.js and phpmyadmin.css.php on firebug but I'm not aware of how to fix this kind of problems. Should I need to refactor the code at those file. Please let me know what are the possible actions. Thank you.
Regards, Thilanka.
Le 2011-06-14 12:58, Thilanka Kaushalya a écrit :
Hi Marc,
2. I have to wait up to 5 seconds before the insert panel appear, do
you
see the same wait time?
Yes same problem here. I see there are lot of get() queries on firebug during the insert dialog pop up. My be it make slow the system. What can I do for this kind of issue. Please clarify me on this.
Firebug / network panel shows a stall on js/update-location.js.
Yes I also see delays at update-location.js and phpmyadmin.css.php on firebug but I'm not aware of how to fix this kind of problems. Should I need to refactor the code at those file. Please let me know what are the possible actions. Thank you.
Thilanka, Here is a clue. In Firebug (network panel), compare the GET command that is sent when everything is alright, with the other GET command where there are delays. The parameters of the GET command where delays happen, are weird (I see an underscore as one of the parameters).
As a result, when all is fine, most GET commands are replied with a "304 not modified" and served by the cache, whereas the weird parameter causes a not cacheable request (replied by "200 OK").
Try to find where this underscore as a GET parameter comes from.
Hi Marc,
Here is a clue. In Firebug (network panel), compare the GET command that
is sent when everything is alright, with the other GET command where there are delays. The parameters of the GET command where delays happen, are weird (I see an underscore as one of the parameters).
As a result, when all is fine, most GET commands are replied with a "304 not modified" and served by the cache, whereas the weird parameter causes a not cacheable request (replied by "200 OK").
Try to find where this underscore as a GET parameter comes from.
I fixed the issue and committed to the repo. I think now this feature works correctly and sorry for the delay. I'll start working with my 4th task tomorrow. Thank you.
Regards, Thilanka.
Thilanka Kaushalya a écrit :
Hi Marc,
Here is a clue. In Firebug (network panel), compare the GET command that is sent when everything is alright, with the other GET command where there are delays. The parameters of the GET command where delays happen, are weird (I see an underscore as one of the parameters). As a result, when all is fine, most GET commands are replied with a "304 not modified" and served by the cache, whereas the weird parameter causes a not cacheable request (replied by "200 OK"). Try to find where this underscore as a GET parameter comes from.
I fixed the issue and committed to the repo. I think now this feature works correctly and sorry for the delay. I'll start working with my 4th task tomorrow. Thank you.
Thilanka, new feature now merged, thanks.
Hi Marc,
- Insert is done correctly but the row count is not updated.
I fixed this issue by using "*$().load()" *method and pushed to the repo. I tried to do it with *"PMA_Table::countRecords()" * but could not find a way to call that php function via js. So I used the above method. Please can you check that out.
Regards, Thilanka. * *
Thilanka Kaushalya a écrit :
Hi Marc,
3. Insert is done correctly but the row count is not updated.
I fixed this issue by using "/$().load()" /method and pushed to the repo. I tried to do it with /"PMA_Table::countRecords()" / but could not find a way to call that php function via js. So I used the above method. Please can you check that out.
Thilanka, this is not done in an Ajax way as you are reloading the whole db_structure.php.
When tbl_replace.php is called, the ajax_request parameter is set to true so the script knows it's running in an Ajax context. So after it does its job of inserting the row, would be a good time to count the rows.
Hi Marc,
I blogged on my third weekly report [1]. Thank you.
[1] - http://coders-view.blogspot.com/2011/06/ajaxify-phpmyadmin-interface-gsoc-20...
Regards, Thilanka.
Hi Marc,
this is not done in an Ajax way as you are reloading the whole
db_structure.php.
I'm not reloading the whole page. I just reload the "#tabelsForm" by using
this. $("#tableslistcontainer").load(db_structure_url+ " #tablesForm", function(){});
When tbl_replace.php is called, the ajax_request parameter is set to true so the script knows it's running in an Ajax context. So after it does its job of inserting the row, would be a good time to count the rows.
Okay thanks for the information and I'll try that out.
Regards, Thilanka.
Thilanka Kaushalya a écrit :
Hi Marc,
this is not done in an Ajax way as you are reloading the whole db_structure.php.
I'm not reloading the whole page. I just reload the "#tabelsForm" by using this. $("#tableslistcontainer").load(db_structure_url+ " #tablesForm", function(){});
Agreed, but reloading this big form just to update a row count is not efficient, IMO.
When tbl_replace.php is called, the ajax_request parameter is set to true so the script knows it's running in an Ajax context. So after it does its job of inserting the row, would be a good time to count the rows.
Okay thanks for the information and I'll try that out.
Regards, Thilanka.
Hi Marc,
Agreed, but reloading this big form just to update a row count is not
efficient, IMO.
Yes I got your idea. I'll try the other way.
Regards, Thilanka.
Hi Marc,
3. Insert is done correctly but the row count is not updated.
I fixed this issue by adding "*PMA_Table::countRecords()*" function to tbl_replace.php and then updated the value in tableForm. I pushed my changes to the repo. Please check that.
Regards, Thilanka.
Le 2011-06-14 12:38, Thilanka Kaushalya a écrit :
Hi Marc,
- Insert is done correctly but the row count is not updated.
I fixed this issue by adding "*PMA_Table::countRecords()*" function to tbl_replace.php and then updated the value in tableForm. I pushed my changes to the repo. Please check that.
Thilanka, this is correct.