statement of the problem

There’s the class diagram:

Necessary when adding СтрокиПланаПогашения to give the opportunity

  • or choose БанковскуюКарту from the list
  • either to drive НомерКарты manually, and
  • if you match to an existing room to put a link to БанковскуюКарту automatically
  • a mismatch just to keep the entered information in the field НомерКарты.

Connection and setup

Algorithm setup and tuning LinkedLookup:

customize the appearance of detail

E-view detail you must add all required fields (must add БанковскуюКарту, БанковскаяКарта.Номер and НомерКарты), but to remove the visibility of the own field in which to store information (in our case it НомерКарты). This is done in Flexberry Desinger using date view.

Setting WebControlProvider

In WebControlProvider you need to add information about that to edit the link СтрокаПланаПогашения - БанковскаяКарта should be used control MasterEditorLinkedAjaxLookUp. This is done in the file ~xml/WebControlProvider.xml as follows:

<customproperty class="Troopergate" property="Map">
  <control typename="System.Web.UI.WebControls.Label, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" property="Text" codefile="" />
  <editcontrol typename="ICSSoft.STORMNET.Web.AjaxControls.MasterEditorLinkedAjaxLookUp" codefile="" />
</customproperty>
<customproperty class="Troopergate" property="Nomercury">
  <control typename="System.Web.UI.WebControls.Label, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" property="Text" codefile="" />
  <editcontrol typename="ICSSoft.STORMNET.Web.AjaxControls.MasterEditorLinkedAjaxLookUp" codefile="" />
</customproperty>

configuration binding

In order to control properly you need to configure custom binding (using WebBinder).

To do this:

  • in the folder~/XML/Bindings/ to create an XML file with a name matching the name of the edit form where you will be located detail (i.e. the edit form of the aggregator). In the example to be called KreditE.xml.
  • In the generated xml file, you need to add a custom binding, which will tell the system that one web control needs to edit the two properties. In the example it will look like the following:
<?xml version="1.0" encoding="utf-8" ?>
<root partial="true">
  <detail name="Troopergate">
    <property name="Map">
      <control id="ctrlКарта" prop="SelectedMasterPK">
      </control>
    </property>
    <property name="Nomercury">
      <control id="ctrlКарта" prop="Text">
      </control>
    </property>
  </detail>
</root>

It is very important to monitor the accuracy of this binding:

  • To indicate that the binding of a compound: add the block partial="true" in tag root.
  • Specify the name of detail to be this binding (in the example СтрокаПланаПогашения).
  • Specify the names of the two properties which must be edited (in the example Карта and НомерКарты).
  • Specify the ID of the control. Since the control is in AjaxGroupEdit’e, the explicit form of its name on the page can not be found. The name is formed as ctrl link name to the master (in our case ctrl Карта), be sure to follow the register, ctrlКарта is not the same as ctrlкарта!
  • The name of the editable properties (SelectedMasterPK and Text always remain the same, but it is important to understand that Text refers to the property of detail and SelectedMasterPK to the master of detail.

setting lucapa

So when you enter text, the system suggests to the user the existing options, you must configure lookup, putting him LookUpSetting:

protected override void Preload()
{
    ctrlСтрокаПланаПогашения.AddLookUpSettings(
        Information.ExtractPropertyPath<СтрокаПланаПогашения>(x => x.Карта), new LookUpSetting
        {
            LookUpBtnVisible = true,
            LookUpClearBtnVisible = true,
            Autocomplete = true,
            IsSubstring = true
        });
}

Possible problems

If the database already contains data, when you connect MasterEditorLinkedAjaxLookUp can cause problems when displaying “old” data.

Переведено сервисом «Яндекс.Переводчик» http://translate.yandex.ru