Hi,
How i can to disable some fields in table Master (Master/Detail view page)? And i need for List Pages to save this fields.
Hi,
How i can to disable some fields in table Master (Master/Detail view page)? And i need for List Pages to save this fields.
Did you mean "disable" in "Master/Detail View" page is to hide the fields? If so, then you may simply use "Page_Load" or "Page_Render" server event that belong to the related master table's View Page, in order to hide the fields.
For example, in the demo project, you want to hide "CustomerID" field in "Master/Detail View" page of "orders" (master)/"orderdetails" (detail) tables, then simply put the following code in "Page_Load" server event that belongs to the View Page of "orders" table:
if ($this->getCurrentDetailTable() <> "") {
$this->CustomerID->Visible = FALSE;
}
btrade wrote:
Why $this->getCurrentDetailTable() be empty?
It will return an empty string if the current page does not contain its detail table.
mobhar wrote:
in "Page_Load" server event that belongs to the View Page of "orders" table:
Make sure you have already put that code in "Page_Load" server event that belongs to the "View Page" (as you mentioned in your first post above), and NOT in the "List Page".
I do it as you wrote, but i have an empty result.
I make now and it works as i need:
I Create in Custom View for order (master table) a field of @name as f1
In Row_Rendered() for order (master table)
if (CurrentPageID() == "list") {
$this->f1->ViewValue = '<h4>#'.$this->projects_id->CurrentValue.' / '.$this->title->ViewValue.' / ' .$this->status->ViewValue.'</h4>';
}
In (for order (master table) ) CustomTemplates -> Master Record Page -> CustomTemplate
<div {{{row_attrs}}}>
<div class="data">
<div>{{{value f1}}}</div>
</div>
</div>
Thanks you