Page 1 of 1

save submit

Posted: Tue May 14, 2019 10:57 pm
by guido

This is what I see when filling in a competition form on my PC (custom template).
First I fill in all names (modal dialog) and automatically an auto fill of membership card number and player number.
After this click submit and the competition can begin. All fields that have been filled in by this submit are stored in my Mysql file.
After the first match, the result can be entered, for example 1-1 = 2-0 home player won. (fields m1w1, m2w1, m3w1 = there must be 2 winning rounds).
So it can also be 1-2-1 = 2-1/m1w1=manche1 match 1,m2w1=manche 2 match 2 ...
For example, if the result was entered 1-1, I see that the following fields are adjusted on my custom template (field us1t=2 and field us1u=0 and field status1-> ew1 (end of match 1).
When I click on Submit, only fields m1w1, m2w1 and m3w1 are entered in my mysql file.
After completing the second match and after submitting , previous fields are in my mysql file.
But fields us2t, us2u, status2 of match 2 are not.
Is it possible in Row_rendered}
elseif ($ this-> M1W1-> CurrentValue == "1" and $ this-> M2W1-> CurrentValue == "1") { // open accolade
$ this-> US1T-> EditValue = '2';
$ this-> US1U-> EditValue = '0';
$ this-> UITSLAGT-> EditValue = $ this-> US1T-> EditValue;
$ this-> UITSLAGU-> EditValue = $ this-> US1U-> EditValue;
$ this-> STATUS1-> EditValue = 'ew1';

Is it possible to update these 5 fields in row_rendering in that if condition.
I very much appreciate your patience,thx


Re: save submit

Posted: Wed May 15, 2019 3:43 pm
by mobhar

Just try it by yourself first, and post your complete code for more discussion.


Re: save submit

Posted: Sat May 18, 2019 2:04 am
by guido

This is my row_render event.
function Row_Rendered() {
// To view properties of field class, use:
//var_dump($this-><FieldName>);
//1
if (empty($this->NAAM1T->CurrentValue) and (empty($this->NAAM2T->CurrentValue) and (empty($this->NAAM3T->CurrentValue)
and (empty($this->NAAM4T->CurrentValue) and (empty($this->NAAM5T->CurrentValue) and (empty($this->NAAM6T->CurrentValue)
and (empty($this->NAAM1U->CurrentValue) and (empty($this->NAAM2U->CurrentValue) and (empty($this->NAAM3U->CurrentValue)
and (empty($this->NAAM4U->CurrentValue) and (empty($this->NAAM5U->CurrentValue) and (empty($this->NAAM6U->CurrentValue))))))))))))){


											   //$this->setMessage("er staat niet overal een naam LINKS en RECHTS");	  
   $this->BEGINNENT->ReadOnly=TRUE;           
   $this->BEGINNENU->ReadOnly=TRUE;
}else{
											  //$this->setMessage("alle namen staan er,dus beginnent en beginnenu  readonly=false !!");
   $this->BEGINNENT->ReadOnly=FALSE;   
   $this->BEGINNENU->ReadOnly=FALSE;
}   

if ($this->STATUS1->CurrentValue=="ew1"){

	//$this->setMessage("Wedstrijd gedaan ");  // volgende elseifs moeten niet meer doorlopen worden
	$this->M1W1->ReadOnly=TRUE;
	$this->M2W1->ReadOnly=TRUE;
	$this->M3W1->ReadOnly=TRUE;
	$this->US1T->ReadOnly=TRUE;
	$this->US1U->ReadOnly=TRUE;
	$this->STATUS1->ReadOnly=TRUE;
		
}elseif ($this->M1W1->CurrentValue =="1" and $this->M2W1->CurrentValue=="1" ){   //open accolade
	$this->US1T->EditValue='2';
	$this->US1U->EditValue='0';
	$this->UITSLAGT->EditValue=$this->US1T->EditValue;
	$this->UITSLAGU->EditValue=$this->US1U->EditValue;
	$this->STATUS1->EditValue='ew1';  

	
	
	$this->M1W1->ReadOnly=TRUE;
	$this->M2W1->ReadOnly=TRUE;
	$this->M3W1->ReadOnly=TRUE;
	$this->US1T->ReadOnly=TRUE;
	$this->US1U->ReadOnly=TRUE;
	$this->STATUS1->ReadOnly=TRUE;
		

}elseif ($this->M1W1->CurrentValue =="1" and $this->M2W1->CurrentValue=="2" and $this->M3W1->CurrentValue=="1"){ // and $this->STATUS1->CurrentValue <>"ok"){
	$this->US1T->EditValue='2';
	$this->US1U->EditValue='1';
	$this->UITSLAGT->EditValue=$this->US1T->EditValue;
	$this->UITSLAGU->EditValue=$this->US1U->EditValue;
	$this->STATUS1->EditValue="ew1";

	$this->M1W1->ReadOnly=TRUE;
	$this->M2W1->ReadOnly=TRUE;
	$this->M3W1->ReadOnly=TRUE;
	$this->US1T->ReadOnly=TRUE;
	$this->US1U->ReadOnly=TRUE;
	$this->STATUS1->ReadOnly=TRUE;

We will do the same for the next five games.(M1W2,M2W2,M3W2 <->M1W6,M2W6,M3W6 number of manches that can be played
Should I use something else instead of EditValue?
thx


Re: save submit

Posted: Sun May 19, 2019 5:50 pm
by mobhar

guido wrote:
Should I use something else instead of EditValue?

It actually depends on the control that used by the fields. If the fields use TextBox control then you should use EditValue. If the fields use Select or Combobox or Dropdown control, then you should use CurrentValue.