Hello,
How can I disable an update for some field when I have something condition?
Edit page ???
if ($this->verrifyt->CurrentValue == 1) {
??????
}
Hello,
How can I disable an update for some field when I have something condition?
Edit page ???
if ($this->verrifyt->CurrentValue == 1) {
??????
}
It doesn't work when I have a Return false
function Row_Updating($rsold, &$rsnew)
{
if (($rsold['verefy'] == 1) && (!empty($rsnew['malls_id']))) {
$this->setFailureMessage("error");
return false;
} else {
return true;
}
}
After this message, I have opportunity for the edition all fields.
And don't work when I have cascading selects.
function Page_Render()
{
if ($this->verefy->CurrentValue == 1) {
$this->city_id->ReadOnly = true; // One for steep I select city. And first step, I select mall
$this->malls_id->ReadOnly = true; // It doesn't work
$this->store_name->ReadOnly = true;
$this->phone->ReadOnly = true;
$this->address->ReadOnly = true;
}
}
How can I fix it?
btrade wrote:
After this message, I have opportunity for the edition all fields.
Did you mean if the system return false, then end-users are abel to edit all the fields that already set as ReadOnly in Page_Render server event of Edit page?
btrade wrote:
And don't work when I have cascading selects.
Did you mean Cascading Selects is equal to Dynamic Selection List?
mobhar wrote:
Did you mean if the system return false, then end-users are abel to edit all the fields that already set as ReadOnly in Page_Render server event of Edit page?
Yes, I meant it.
mobhar wrote:
Did you mean Cascading Selects is equal to Dynamic Selection List?
Yes, I meant it. Do I have 2 fields like country and city. Readonly settings are not applied to the city.
When you return false in Row_Updating server event, then you may use a session variable by assigning it a certain flag value to allow edit, for example:
function Row_Updating($rsold, &$rsnew)
{
if (($rsold['verefy'] == 1) && (!empty($rsnew['malls_id']))) {
$_SESSION["allow_edit"] = "1"; // <-- when error happened, then allow edit
$this->setFailureMessage("error");
return false;
}
return true;
}
Your code in Page_Load server event:
// Page Load event
function Page_Load()
{
$_SESSION["allow_edit"] = "0"; // initial condition, do not allow edit
}
Last but not least, your code in Page_Render server event is:
// Page Render event
function Page_Render()
{
if ($this->verefy->CurrentValue == 1 && isset($_SESSION["allow_edit"]) && $_SESSION["allow_edit"] != "1") {
$this->city_id->ReadOnly = true;
$this->malls_id->ReadOnly = true;
$this->store_name->ReadOnly = true;
$this->phone->ReadOnly = true;
$this->address->ReadOnly = true;
}
}
it does`t work.
function Page_Render()
{
if ($this->verefy->CurrentValue == 1 && isset($_SESSION["allow_edit"]) && $_SESSION["allow_edit"] != "1") {
$this->city_id->ReadOnly = true;
$this->malls_id->ReadOnly = true;
$this->store_name->ReadOnly = true;
$this->phone->ReadOnly = true;
$this->address->ReadOnly = true;
}
}
it works very well. But if I have returned false, it doesn't work
function Page_Render()
{
if ($this->verefy->CurrentValue == 1) {
$this->city_id->ReadOnly = true;
$this->malls_id->ReadOnly = true;
$this->store_name->ReadOnly = true;
$this->phone->ReadOnly = true;
$this->address->ReadOnly = true;
}
}