Hello,
In a php-driven website I am using DOJO as Ajax-toolkit.
First I'm gonna explain a little code on the howto:
what it says is, get the file jobform.php, and send its response to the DIV with the name "jobs"
In the file jobform.php I have my form defined, containing an FCK-editor Field:
now the actual problem:
first time i click the image wich loads the dojo function show_job_form, it displays the form, everything is fine.
Than i submit the form (again with a dojo function)
it says, take the form called "form_job_update" and send it to job_update.php to process it
job_update.php contains some standard code to put _POST values into the database using mysql.
So, like i wrote before, when i first time SAVE everything is fine, when i click the image wich calls show_job_form AGAIN; FCKEDITOR suddenly DOES NOT HAVE A TOOLBARSET anymore,...
does anyone have a suggestion how to solve this problem?
In a php-driven website I am using DOJO as Ajax-toolkit.
First I'm gonna explain a little code on the howto:
function show_job_form(jobid, type) { dojo.xhrGet( { preventCache:true, url: "jobs/input/actions/jobform.php?jobid=" + escape(jobid) + "&type=" + escape(type), handleAs: "text", timeout: 5000, load: function(response, ioArgs) { dojo.byId("jobs").innerHTML = response ; return response; }, }); }
what it says is, get the file jobform.php, and send its response to the DIV with the name "jobs"
In the file jobform.php I have my form defined, containing an FCK-editor Field:
<? $oFCKeditor = new FCKeditor('FCKeditor1'); $oFCKeditor->BasePath = 'properties/FCKeditor/'; $oFCKeditor->Width = '100%' ; $oFCKeditor->Height = '545' ; $oFCKeditor->ToolbarSet = 'Default' ; $oFCKeditor->Value = $row['jobDescription']; $oFCKeditor->Create(); ?>
now the actual problem:
first time i click the image wich loads the dojo function show_job_form, it displays the form, everything is fine.
Than i submit the form (again with a dojo function)
function update_job() { dojo.xhrPost ({ url: "jobs/input/actions/job_update.php", handleAs: "text", // Name of the Form we want to submit form: 'form_job_update', }); }
it says, take the form called "form_job_update" and send it to job_update.php to process it
job_update.php contains some standard code to put _POST values into the database using mysql.
So, like i wrote before, when i first time SAVE everything is fine, when i click the image wich calls show_job_form AGAIN; FCKEDITOR suddenly DOES NOT HAVE A TOOLBARSET anymore,...
does anyone have a suggestion how to solve this problem?
Re: Loading the FCK editor with DOJO causes troubles,...
google brought me to the "ajax" property of the FCK object
so i added $oFCKeditor->ajax = true; to my php code, but the problem remains,...
anyone?
Re: Loading the FCK editor with DOJO causes troubles,...
Check error messages in Firefox (Tools > Error Console, make sure Error or All is selected). If you don't see any, check your HTTP logs for errors (look for any 4xx and 5xx errors).
Re: Loading the FCK editor with DOJO causes troubles,...
thanks for the suggestion A.M. , yet again i found something,... tough i don't have a solution yet.
in the Firebug console i read the error "FCKTools is not defined" referring to fckeditorcode_gecko_2.js
googeling on that brought me to the next topic (seems like somebody has the same problem like i do,...)
viewtopic.php?f=6&t=6894&start=0&st=0&sk=t&sd=a&view=print
what they suggest is changing my line
$oFCKeditor->BasePath = 'properties/FCKeditor/';
to
$oFCKeditor->BasePath = './properties/FCKeditor/';
did it,... problem remains,...
Re: Loading the FCK editor with DOJO causes troubles,...
Re: Loading the FCK editor with DOJO causes troubles,...
hmmm
I'm affraid either of them,...
the source file location => shouldn't be the problem since 1 time it does work, the other time it doesn't,...
if this is the problem, why should it suddenly start looking from another location (since that can be the only reason why it wouldn't find it the 2nd time,...)
global thingy => isn't possible in my situation since i'm working with ajax, and the form I load has its own instance of the editor (see the php snippet in my first post in this topic,...)
or do I understand wrong what you mean?
Anywayz, it's cool to see somebody is thinking together with me
the way i get to my FCK editor is the next:
all my pages include the file "properties/functions/index.php"
and that file contains a whole lot of includes: my database class, my content translation class, my date time class, the phpmailer class,... and next to all those it also includes properties/FCKeditor/fckeditor.php
in fckeditor.php the constructor is like this:
Re: Loading the FCK editor with DOJO causes troubles,...
Check if you have something along these lines:
Re: Loading the FCK editor with DOJO causes troubles,...
if you download the latest package you ll see a file named fckeditor.php wich will lead you to fckeditor_php5.php (since i m using php 5)
the way i build my editor is the one i refered to earlier (the one in the very first post, 2nd snippet)
Re: Loading the FCK editor with DOJO causes troubles,...
There's no such "ajax" property.
Re: Loading the FCK editor with DOJO causes troubles,...
wich explains why adding that propertie didn't work
i don't remember where, but i found a snippet somewhere suggesting that there is,... I'll post the link if I find it again,...
anywayz, i also noticed that it doesn't exist when i took a closer look @ the class earlier today (added that propertie last friday, should have looked into the class then,... )
Re: Loading the FCK editor with DOJO causes troubles,...
First of all, what i did to solve the toolbar problem:
I'm not using the phpclass anymore to create the editor, I use javascript now to do it.
Now my new problem (and I don't know if that also happened before I left the phpclass for what it was):
The data from the editor field doesn't get posted anymore :s
When I load the form I put data in it wich comes from my database. When I edit, and click the forms save button, the data that gets posted is NOT the modified data, but the ORIGINAL data that is in the form when I load it. The editted data gets lost somewhere, and I have totaly NO IDEA in what part of my code I should look to solve this problem,...
Can anyone help me forward in debugging this? (NB: still using AJAX)
thanks in advance