Value does not get load in a Page Layout

May 31, 2011 at 4:22 PM

Hello,

First let me say that this is a great piece of software, well structured and easy to follow and understand.

I do have an issue though, I tried using this control in a page layout (in publishing site of course) and I came across an issue. When you edit a page and change the value of a filtered lookup field, it indeed changes its value, but if you save and edit the page again, the previous inserted value does not get loaded. This happens because (I think) the page does NOT get reloaded, so the SetValue method does not get called. If you change the properties of the page in a dialog box, this issue is not visible, because here, the page get loaded.

I tried to work around this and removed the test "if (!Page.IsPostBack)" from the OnLoad method (in both controls) and it started working. My question is, what fo you think are the implications of this?

   protected override void OnLoad(EventArgs e) {
      base.OnLoad(e);
      if (ControlMode != SPControlMode.Display) {
        /* if (!Page.IsPostBack) { */
          SetValue();
        /*}*/
      }
    }

 

Thanks in advance,

best regards,

João