Page-Models in Panel (field select)

Perhaps I have overlooked it, but maybe someone can help me:

For a template I created a model with additional functions (site/models/mytemplate.php):

class mytemplatepage extends page {
  ...
  public function PageTitle() {
    return $this->calculated_value;
  }
  ...
}

Access to this function within templates/snippets works fine - except for access inside the Panel:

fields:
  somefield:
    label: Somefield
    type: select
    options: query
    query:
      page: /
      fetch: pages
      template: mytemplate
      value: '{{uid}}'
      text: '{{PageTitle}}'

Nothing/Empty list is returned. Changing the text, for example, to {{title}} works fine.

Are the models not used within the Panel?

No, models aren’t loaded in the Panel to prevent them from messing with the form data.

Excuse me, but I do not understand. Why should the models can affect the form data?

If it’s not possible, it would be a good idea to change the documentation for Panel-Field Select:

text {{title}} A string to be used for the displayed option text. You can use {{varname}} for any object method from the passed object (page or file)

Let’s say your model overwrites the title method (which is valid and useful). The result would be that the dynamic value from the model would be loaded into the form and then saved as the actual value. There are ways around that (using the content() method), but models have not yet been integrated into the Panel, so they are not currently supported.

I have opened a feature request issue on GitHub about this.

The documentation is correct. You can use any page or file method, but only the built-in ones, not the ones from the models.