Insert / Update with the RTE editor
Contents | ||
Prev | Update |
Ok, lets say I have already got my users setup in my database but they haven't updated their "content" fields (except me), I want to let each user update his or her own content field, lets start by building a master/detail page set.
Here is what my master page looks like:
Quite a simple recordset with a repeat region and a goto detail page behaviours attached:
The go to detail page passes each users ID number from the master page to the detail page, now lets build the detail page using the RTE editor.
Insert the RTE editor onto a page and apply any restrictions and add any fields required as specified in the previous steps.
I want to update three fields, "Forename", "Surname", and "content".
First I create a filtered recordset, which means only display one record filtered by the URL parameter ID, which I am passing from my "master" page:
Notice the filter.
Now Lets bind all three fields to where they should be:
Lets drag Forename to the forename field
We do the same with surname, and then we drag "content" to the multiline box:
Step by Step.
There, all we need to do now is apply an update server behaviour:
The wysiwyg textfield is called text so that updates our content field.
Whew, thats the major part done, now lets test in the browser, lets start with the master page:
Notice the address is the detail page (with the filtered recordset) being passed the URL parameter ID equal to the ID of the person we clicked on the master page.
Phew, the forename and surname boxes are displaying the correct forename and surname, go back to the master page and try clicking on a few names to see if the detail page displays the correct names.
The reason to test a few names is simple, I always forget to put the filter on my detail page recordset because I am an idiot, if you forget the filter, the recordset will pull up the first record in the database, which is me, so looking at the detail page above everything looks rosy, but if I go back to the master and click another name and the detail page displays my name AGAIN!, then I know I have forgotten the filter (I forgot the filter AGAIN whilst writing this tutorial thats what reminded me) .
Here is the content that was in the database for my "content" field I'm gonna update some of the text in the wysiwyg area and "save" the page to see if the database is updated correctly.
I save and then check the database to see if all went well:
Hooray, I test updating some of the other users content and see if that works too.
Thats it, time for a cig, hope you enjoyed it and that all went well
Contents | ||
Prev | Update |
.
Bill Chalmers
Started doing sites in Frontpage about 3 years ago, progressed to ASP, Linux/Mysql, and PHP/MYSQL, currently learning LDAP, XML, XHTML, ASP.net, learning more about css, worked in Hammersmith Hospital for 8 years, Developed
www.hammersmithresearch.com
www.cafenetix.com
www.hammersmithcafe.org
Also developed the Trusts Intranet site with lots of php/asp applications built in, content management, enjoy getting paid for mucking about with stuff I do as a hobby.
Comments
Thank You !
Nice job Bill, thank you! How about another one? Mybe in combination with file upload.
Dot
RE: Thank You !
Question about other fields
RE: Question about other fields
You must me logged in to write a comment.