1. Erik Segerdell
  2. Valentina Studio
  3. Четверг, Март 28 2019, 11:07 PM
  4.  Подписаться через email
Is there a way to automatically refresh views of related records in a form, after a new related record has been added? For example in Screen Shot 1, the "Strains" table at the upper right is a View of records related to the current Individual Experiment ("testexp1";). We can add a new record using the import mechanism, and the new row can seen in the same table in Screen Shot 2. However, this view does not refresh right after adding the record. The new row does not appear unless you click the ">" button to go to the next Individual Experiment, then click "<" to go back to testexp1 (or unless you close and re-open the form). We've tried to add a button with the action "View --> Reload records" but this does not work.

Thanks!
Вложения
Комментарий
There are no comments made yet.
Sergey Pashkov Ответ принят
Hello Erik,

Please specify - how do you add a new record? Using the form for a related table with "Add" data mode?
Комментарий
There are no comments made yet.
Erik Segerdell Ответ принят
That's correct.
Комментарий
There are no comments made yet.
Erik Segerdell Ответ принят
I should add that this is also the case when the view isn't mapped -- e.g., here is a new screen shot that is similar to the previous ones, except that the view underneath "All Compounds" contains all records rather than related ones. When a new Compound is added, the view does not refresh unless the form is closed and re-opened.
Вложения
Комментарий
There are no comments made yet.
Sergey Pashkov Ответ принят
Is "All Compounds" TableView based on a table, and not on a view or query?
Also, what database is used?
Комментарий
There are no comments made yet.
Erik Segerdell Ответ принят
The "All Compounds" TableView is based explicitly on a view, not on a table. Here is the query used to create the view:


SELECT all_compounds_table.comp_id AS "Compound ID",
all_compounds_table.comp_name AS "Compound",
all_compounds_table.comp_abbr AS "Abbreviation",
compound_controls_table.control_name AS "Control"
FROM (all_compounds_table
LEFT JOIN compound_controls_table ON ((all_compounds_table.control_id = compound_controls_table.control_id)))
ORDER BY all_compounds_table.comp_id;


We are using a PostgreSQL database.
Комментарий
There are no comments made yet.
Sergey Pashkov Ответ принят
Thank you,
to update the TableView based on a View you can use the following method:
this.TableViewName.reload()
Комментарий
There are no comments made yet.
  • Страница :
  • 1


There are no replies made for this post yet.
However, you are not allowed to reply to this post.

Categories

Announcements & News
  1. 0 subcategories
Valentina Studio
  1. 2 subcategories
Valentina Server
  1. 4 subcategories
Valentina Database ADK
  1. 0 subcategories
Valentina Reports ADK
  1. 0 subcategories
Other Discussions
  1. 0 subcategories
BETA Testing
  1. 0 subcategories
Education & Research
  1. 0 subcategories
Omegabundle
  1. 0 subcategories