Question: I want to change the name of the form field from Page[body] to body lets say. Following is the code for WYSIWYG editor.

```
<?php echo $form->field($model, 'body')->widget(
                    \yii\imperavi\Widget::className(),
                    [
                        'plugins' => ['fontcolor', 'video'],
                        'options'=>[
                            'minHeight'=>400,
                            'maxHeight'=>400,
                            'buttonSource'=>true,
                            //'imageUpload'=>Yii::$app->urlManager->createUrl(['/file-storage/upload-imperavi'])
                        ]
                    ]
                ) ?>

```

I don't want to change my model just the name of the form field submitted as the filed is submitted to remote API.

For normal fields i do `<?php echo $form->field($model, 'name')->textInput(['name' => 'name']) ?>`

Answer: 
You are clearing the items in each time.You need to move clear out of the loop 

```
lstAvailableTrains.Items.Clear();
foreach (string line in lines)
{
  if (line.Contains(stringToSearch))
  {     
     lstAvailableTrains.Items.Add(line);
  }
}

```
Use LINQ, and set the ListBox's `ItemsSource` property:

```
using System.Linq;
...

lstAvailableTrains.ItemsSource =
    File.ReadAllLines("pathway").Where(line => line.Contains(stringToSearch));

```