This article applies to technological LookUp-form and describes how to transfer their own parameters in a LookUp-form with JavaSript API.

LookUp-form

When implementing your own LookUp form, you may need to pass several parameters and parse them when the form loads. This article will be reviewed by an example of transmission parameters when using the technological LookUp.

statement of the problem

Given the edit form with lucapa ctrlLookUp1, lookup “looks” to the form LookUpForm.cs generated along with the application. Want to add to the edit form button, when clicked on the LookUp form is added to the transferred message.

solution Algorithm

  1. Create a button and register for her click method, which will be the transfer of additional parameters.
  2. “Catch” on the LookUp form, the arrival of additional parameters and add the desired message (if necessary).

creating a button and passing parameters

  • Create button:
 <button id="addMessageButton">Добавить сообщение на LookUp-форму</button> 
  • To create a handler for the clicking:
$('#addMessageButton').click(function () {
    $('#<%=ctrlLookUp1.ClientID%>').icsMasterEditorAjaxLookup('updateOptions', { formParams: 'ShowMessage=true&TheMessage=Сообщение' });
    return false;
});

Processing parameters on the LookUp form

On the technological LookUp-the default form method added

 protected override void ApplyWolvSettings() 

Add the following code:

bool showMessage = Request["ShowMessage"] != null && Request["ShowMessage"] == "true";

if (showMessage)
{
    string message = Request["TheMessage"];
    // Add the message. 
}
Переведено сервисом «Яндекс.Переводчик» http://translate.yandex.ru