Forums

how do you set save data to save the updated fields?

indesweb 17 Feb, 2018
Hello everyone,
I have my list of records, and I have an "edit" buttonWhen you click open the form that I have put, where I load the values of each field that were stored in the database.
And in theory, you can change the data and giving it to save are updated.But when I give him to save,
1) not written does not save me, only the dropdown option
2) When I enter and I do not modify some fields, or all, these I deleted them. I do not touch it and it erases it.I
made the form, and before that I kept the "value =" customer record "" and it appeared in the "customer record" list so I have removed it.
Reading in the forum, in several post, I understood, that you have to put in the form a "concept" "input" and call the record saved with the model name + the column.I copy a bit of my form in case someone sees my error.

Thanks
 <div class="inline three fields" id="area_fields_2">
<input type="hidden" name="trafico[id]" />
<div class="field inline " ><label for="NServicio" >Nº Servicio</label>
<input data-events="[]" placeholder="" name="NServicio" id="NServicio" value="{var:leer_registro_trafico.registrotrafico.aid}" type="text" readonly="readonly" /></div>

<!-- <div class="field inline hidden" ><label for="creado" >Fecha creado</label>
<input data-events="[]" data-firstday="1" data-startmode="day" data-type="date" data-dformat="DD/MM/YYYY" data-sformat="YYYY-MM-DD HH:mm:ss" data-mindate="" data-maxdate="" data-startcalendar="" data-endcalendar="" data-popuppos="top center" placeholder="" name="trafico[creado]" id="creado" value="" type="text" data-calendar="1" /></div>
-->
<div class="field inline " ><label for="servicio" >Estado del Servicio</label>

<select data-validationrules='{"identifier":"servicio-main","rules":[{"type":"required","prompt":"Estado del Servicio"}]}' data-validate="servicio-main" data-events="[]" name="trafico[servicio]" id="servicio" data-mincharacters="0" type="select" class="ui dropdown" >
<option value="" >{var:leer_registro_trafico.registrotrafico.servicio}</option>
<option value="Pendiente" >Pendiente</option>
<option value="En transito" >En transito</option>
<option value="Contenedor recogido" >Contenedor recogido</option>
<option value="En destino" >En destino</option>
<option value="Salida de fabrica" >Salida de fabrica</option>
<option value="Cola de terminal" >Cola de terminal</option>
<option value="Fin de trabajo" >Fin de trabajo</option></select></div>

<div class="field inline" style="text-align:right" >
<input type='button' onclick='history.back();' class="ui button yellow" value='Atras' />
<input type='button' onclick='window.print();' class="ui button blue" value='Imprimir' />
<input type='submit' class="ui button red" value='Guardar' /></div>

</div>

<div class="ui three column grid"><div class="column column1"><div class="field inline " ><label for="cliente" >Cliente</label>

<select data-events='[{"sign":"change","action":["reload"],"value":"","identifier":["tarifa"]}]' name="trafico[cliente]" id="cliente" data-mincharacters="0" type="select" class="ui dropdown" >
<option value="" >{var:leer_registro_trafico.registrotrafico.cliente}</option>
<option value="Boluda" >Boluda</option>
<option value="WEC" >WEC</option>
<option value="Geodis Wilson Spain S.L.U." >Geodis Wilson Spain S.L.U.</option>
<option value="TIBA SPAIN, S.A.U." >TIBA SPAIN, S.A.U.</option></select></div><div class="field inline " ><label for="linea" >Linea</label>
indesweb 19 Feb, 2018
Hello everyoneI

already work almost everything!

I would not know very well explain what I did, so I copy a bit of code, taking into account the post, and I have created a readdata for edit as it comes in FAQ.

<div class = "field inline"> <label for = "Port"> Port </ label>
<select data-events = "[]" name = "traffic [Port]" id = "Port" data-mincharacters = "0" type = "select" class = "ui dropdown">
<option value = "{var:leer_registro_trafico.registrotrafico.Puerto}"> </ option>
<option value = "Tenerife"> Tenerife </ option>
<option value = "Las Palmas"> Las Palmas </ option>
<option value = "Sines"> Sines </ option>
<option value = "Rotterdam Dde"> Rotterdam Dde </ option> </ select> </ div>

<div class = "field inline"> <label for = "Country"> Country </ label><select data-events = "[]" name = "traffic [Country]" id = "Country" data-mincharacters = "0" type = "select" class = "ui dropdown">
<option value = "{var:leer_registro_trafico.registrotrafico.Pais}"> </ option>
<option value = "Spain"> Spain </ option>
<option value = "France"> France </ option>
<option value = "Portugal"> Portugal </ option>
<option value = "Others"> Others </ option> </ select> </ div>

I explain:TrafficData my first read datatraffic
- modelname of TrafficData, from here I charge the main tablebetween []
- the column of my db tablesecond read data for the edit
- leer_registro_traficomodel.name
- registrotraficofollowed by the "." the columb of my bd

** in both read data I have put call to the same database

When I put "value = {var: 2_read_data.modelfiel.columna} I charge the values that I have saved In functions I have a save date called "update", with the model name "traffic" and in data provider llamoa {data: traffic} and in update conditions
I have "" aid: {data: traffic_aid} "" to compare the numbers and allow the change.and in write action I have "Update"

** I hope this helps someone who gets lost as I lost myself. It was hard for me to understand how to put everything, and I still have some doubts.

Why are not the TEXTAREA kept? they save me the imput and the dropbox and the calendar but the textarea does not save me.I leave here the code for if someone is able to see my error or if you know that it is put in another way.

<div class = "field inline"> <label for = "Observations Download"> Obs. Download </ label><textarea rows = "2" name = "traffic [ObservationsDownload]" id =
"ObservationsDownload" value = "{var:leer_registro_trafico.registrotrafico.Observations.Download}" placeholder = "" type = "textarea" data-rows = "2"> </ textarea> </ div> </ div>

** I hope everything is understood, since the translator sometimes changes the words to some that is not.

If someone knows how to tell me the mystery of textareal I will be very grateful, I am impatient or know why this is not saved like the
others.


Greetings to everything!
This topic is locked and no more replies can be posted.