|
Member
|
TC
-
10/23/2008 3:23:04 AM
Editable Text web part not saving changes
Hi,
I have added the editabletext web part to my own web part but any changes made are not saved. The editabletext web part is set as a HTML Editor. I am currently using the trial version.
This is my web part code:
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="5050Box.ascx.cs" Inherits="CMSWebParts_BPHub_5050Box" %> <%@ Register src="~/CMSWebParts/Text/editabletext.ascx" tagname="editabletext" tagprefix="uc1" %> <div class="box-row"> <asp:Panel ID="leftBoxContainer" runat="server"> <div class="left-box"> <div class="box-header-<%=BoxColorLeft %>"><a href="#" class="box-header">Header</a></div> <div class="box"> <div class="box-content"> <div class="box-image"></div> <div class="box-text"> <uc1:editabletext ID="editabletext1" runat="server" RegionType="HtmlEditor" HtmlAreaToolbarLocation="Out:FCKToolbar" RegionTitle="Edit Box Content" /> </div> </div> </div> </div> </asp:Panel> <asp:Panel ID="rightBoxContainer" runat="server"> <div class="right-box"> <div class="box-header-<%=BoxColorRight %>"><a href="#" class="box-header">Header</a></div> <div class="box"> <div class="box-content"> <div class="box-image"></div> <div class="box-text"></div> </div> </div> </div> </asp:Panel> </div>
Do you have any idea what might be causing this problem?
Thanks TC
|
|
|
Member
|
trinh.chuong-yestelco
-
10/24/2008 5:20:23 AM
RE:Editable Text web part not saving changes
I can see what the ptoblem is now. I have two of these web parts on the same page. I didn't set any content for the second web part so the first one was being blanked out because the web parts appear to be sharing the same content.
So then, this leads me to another problem. How can I have more than one of the same web part on a page but each one have its own separate content?
Thanks TC
|
|
|
Kentico Support
|
kentico_zdenekc
-
10/24/2008 8:36:54 AM
RE:Editable Text web part not saving changes
Hi,
from a brief review of your webpart code, the problem could be caused by the fact that the inner editable text control's Load- and SaveContent methods are not being called on Load/Save events.
In your webpart's code-behind, you could inherit from 'CMSAbstractEditableWebPart' and override the methods LoadContent and SaveContent, and in these methods, explicitly call LoadContent and SaveContent for the inner EditableText control. Does this make sense?
Otherwise, you could build a new WebPart using the instructions at http://devnet.kentico.com/docs/devguide/modifying_the_design_of_standa.htm
Best Regards, Zdenek Cetkovsky
|
|
|
Member
|
jonathanchauncey-fdle.state.fl
-
10/28/2008 10:51:28 AM
RE:Editable Text web part not saving changes
We are having this issue as well and it becoming increasingly difficult to convert our site because we are losing pages during the middle of conversion.
A fix for this is needed asap.
|
|
|
Member
|
jonathanchauncey-fdle.state.fl
-
10/28/2008 10:52:49 AM
RE:Editable Text web part not saving changes
let me mention that we are using Portal style development and have 2 editable text webparts on our main page template (which is a page menu item doc type).
|
|
|
Member
|
TC
-
10/28/2008 11:26:44 AM
RE:Editable Text web part not saving changes
I have temporarily gotten around this by having a static number of editabletext controls within my own web part, each of which is given a different ID. This obviously is not the best solution as it means my web parts have limited re-usability.
Another problem I have found is that if you use the same web part in multiple pages that are all based on the same page template, the properties of the web parts are applied globally. I have had to create new templates for each of my pages, which cancels out the benefits of having templates in the first place!
The problem in all cases seems to be the way content is stored in the database according to the web part ID, i.e. its not fully identifying the specific web part and its context/containing control(s).
I briefly looked into overriding the LoadContent/SaveContent methods, but ran into a problem in that I couldn't identify which web part content to Load/Save since all of them had the same ID within the same page!
This really needs fixing as it means a lot of the so called benefits of Kentico are lost.
|
|
|
Member
|
jonathanchauncey-fdle.state.fl
-
10/28/2008 11:46:21 AM
RE:Editable Text web part not saving changes
have you noticed that this only happens when you are inserting a big section of text in your webpart?
|
|
|
Member
|
trinh.chuong-yestelco
-
10/28/2008 6:51:46 PM
RE:Editable Text web part not saving changes
This happens regardless of the amount of text being entered. I don't think it is a problem with the data type/length. It also happens with the editable image web part too!
|
|
|
Kentico Developer
|
kentico_zbysekn
-
10/29/2008 4:08:18 AM
RE:Editable Text web part not saving changes
Hello, Could you please send us code files of your webpart? Both ascx and ascx.cs files. We will try to inspect them and find solution to your problem. And we will also publish possible solution to this forum.
Best Regards, Zbysek Nemec
|
|
|
Member
|
trinh.chuong-yestelco
-
10/29/2008 4:32:47 AM
RE:Editable Text web part not saving changes
Hi,
I have sent my code files to your support@kentico.com email address.
Thanks
|
|
|
Kentico Developer
|
kentico_martind
-
10/29/2008 8:51:48 AM
RE:Editable Text web part not saving changes
Hi,
Thank you for your files. Please note that content is stored in according to ID of editable region and even if you put several your custom web parts on the page the IDs of editable regions within are always the same so the content is stored under same ID. To solve this problem you can add ID of your custom web part to ID of your editable regions. Please find sample code bellow (you should paste it into OnContentLoaded method of your custom web part):
editabletext1.ID += this.GetValue("WebPartControlID").ToString(); editabletext2.ID += this.GetValue("WebPartControlID").ToString();
|
|
|
Member
|
TC
-
10/30/2008 4:34:02 AM
RE:Editable Text web part not saving changes
Hi,
Many many thanks Kentico for this solution. After a quick test this solution does appear to work (I'll let you know of any probs after I get a chance to get back into this). So multiple instances of the same web part on a page now maintain its own content.
On the other problem of web part properties being applied globally, the solution/intended usage to prevent this is:
- To have web part properties applied globally across your pages: use the same Page TEMPLATE to create your page
- To have web part properties only apply to the single instance: use Page LAYOUT to create your new page
Many thanks Kentico!
|
|
|
Member
|
jonathanchauncey-fdle.state.fl
-
10/30/2008 8:12:41 AM
RE:Editable Text web part not saving changes
this is a fix for someone who has written their own webparts. However, I am using the portal template and I am having the same issue. Is there a way to resolve this?
|
|
|
Kentico Support
|
kentico_jurajo
-
10/30/2008 8:47:44 AM
RE:Editable Text web part not saving changes
Hi, I am sorry for bothering you, but here were discussed several problems - could you please describe us which issue you have exactly?
Thank you.
Best Regards, Juraj Ondrus
|
|
|
Member
|
jonathanchauncey-fdle.state.fl
-
10/30/2008 10:39:01 AM
RE:Editable Text web part not saving changes
I have 2 webparts (editable text regions) on the same page template. Sometimes after I hit the save button, after the page reloads the content is gone. It completely erases everything I have worked on.
|
|
|
Kentico Consulting
|
kentico_borisp
-
10/31/2008 8:07:39 AM
RE:Editable Text web part not saving changes
Hello,
After I consulted this issue with our developer we will try to prevent it from happening in the next version. We would recommend you in the mean time to use another browser or wait until the content is loaded, because this issue seems to be IE7 specific.
Best Regards, Boris Pocatko
|
|