Andres Rormoser
|
Posted: 11/17/2005, 7:35 AM |
|
Primero queria felicitar a CodeCharge por abrir este foro en español. Y luego hacerles una
consulta con respecto a un problema que estoy teniendo. Cree un Editable Grid y agregue
campos fuera de la Begin/End Row Section. Estoy tratando de acceder a los valores de esos
campos desde el BeforeSubmit Event pero siempre me devuelve vacio. Alguien sabe que estoy
haciendo mal?
Function ComprobanteVentaDetalle_BeforeSubmit(Sender)
'Custom Code @84-73254650
' -------------------------
....
....
cve_bonificacion = EditableGridForm.fieldoutsiderowsection.value
....
....
' -------------------------
'End Custom Code
Si de la misma forma accedo a campos dentro del Begin/End Row Section los accede sin
problemas.
Thanks, AR
|
|
 |
lvalverdeb
Posts: 299
|
Posted: 11/17/2005, 12:42 PM |
|
Dos preguntas. Cual versión de codecharge usas? Cuando dices fuera del editable grid te refieres fuera del ultimo <table> pero aun dentro del formulario?
Yo tuve un problema similar con CCS 3 cuando supuestamente había agregado un campo, el cual en la vista de diseño parecía estar dentro del <form> pero cuando revisé en la Vista HTML aparecía justo abajo del </form>. Se solucionó el problema simplemente al mover el campo dentro del form.
En mi formulario la vista HTML era:
<!-- BEGIN EditableGrid Nombre -->
<form name="{HTMLFormName}" action="{Action}" method="post">
<input type="hidden" value="{FormState}" name="FormState">{FormScript}
<table cellspacing="0" cellpadding="0" width="100%" border="0">
.
.
.
.
</table>
</form>
<input type="hidden" etc etc etc>
<!-- END EditableGrid Nombre -->
Una vez que moví el control dentro del formulario se arregló el problema:
</table>
<input type="hidden" etc etc etc>
</form>
<!-- END EditableGrid ficha_pacientes_citas_fis -->
Saludos
Luis
_________________
lvalverdeb
CR, GMT-6
XAMPP/Ubuntu/CCS3.2/4 |
 |
 |
lvalverdeb
Posts: 299
|
Posted: 11/17/2005, 1:56 PM |
|
_________________
lvalverdeb
CR, GMT-6
XAMPP/Ubuntu/CCS3.2/4 |
 |
 |
Andres Rormoser
|
Posted: 11/18/2005, 6:53 AM |
|
Ya logre resolverlo. Aca explico como:
+ Add an Editable Grid for the Detail Table
+ Add Master Fields outside Begin/End Row Section
+ Change the properties of the Editable Grid:
Custom Insert Type: Table
Custom Insert: All the fields from the Detail table and the field with reference to the
master table get it from a session variable (x ej cve_id)
+ Add a BeforeShow Event to read the data of the Master Table from the database an
populate it to textboxes in the form
'Custom Code @85-73254650
' -------------------------
' declaro variables
dim cve_id, cve_fechaingreso, cve_cli_id, cve_bonificacion, cve_vco_id, cve_ven_id,
cve_vli_id, cve_vai_id, cve_mon_id, cve_vct_id
Dim SQL
Dim RecordSet
Dim UserId
Dim UserName
Dim WorkPhone
cve_id = CCGetParam("cve_id",0)
if cve_id<>0 then
' it's an update
' save id into session variable
Session("cve_id") = cve_id
' get data from database
SQL = "SELECT * FROM ComprobanteVenta WHERE cve_id="&cve_id
' Open the recordset
Set RecordSet = DBConnection1.Execute(SQL)
If DBConnection1.Errors.Count = 0 Then
If NOT RecordSet.EOF then
ComprobanteVentaDetalle.cve_fechaingreso.value = CCGetValue(RecordSet,
"cve_fechaingreso")
ComprobanteVentaDetalle.cve_cli_id.value = CCGetValue(RecordSet, "cve_cli_id")
ComprobanteVentaDetalle.cve_bonificacion.value = CCGetValue(RecordSet,
"cve_bonificacion")
ComprobanteVentaDetalle.cve_vco_id.value = CCGetValue(RecordSet, "cve_vco_id")
ComprobanteVentaDetalle.cve_ven_id.value = CCGetValue(RecordSet, "cve_ven_id")
ComprobanteVentaDetalle.cve_vli_id.value = CCGetValue(RecordSet, "cve_vli_id")
ComprobanteVentaDetalle.cve_vai_id.value = CCGetValue(RecordSet, "cve_vai_id")
ComprobanteVentaDetalle.cve_mon_id.value = CCGetValue(RecordSet, "cve_mon_id")
ComprobanteVentaDetalle.cve_vct_id.value = CCGetValue(RecordSet, "cve_vct_id")
End if
' Close the recordset
RecordSet.Close
Set RecordSet = Nothing
Else
DBConnection1.Errors.Clear
End If
end if
' -------------------------
'End Custom Code
+ Add a BeforeSubmit Event to read the Textboxes of the Master Fields in the Form and
update/insert into the table Master an get the id inserted
Function ComprobanteVentaDetalle_BeforeSubmit(Sender)
'ComprobanteVentaDetalle_BeforeSubmit @20-FC746084
'Custom Code @84-73254650
' -------------------------
' declare variables
dim cve_id, cve_fechaingreso, cve_cli_id, cve_bonificacion, cve_vco_id, cve_ven_id,
cve_vli_id, cve_vai_id, cve_mon_id, cve_vct_id, cve_emp_id
' read textboxes of master table
cve_id = CCGetParam("cve_id",0)
cve_fechaingreso = chr(34) & CCGetParam("cve_fechaingreso", Empty) & chr(34)
cve_cli_id = CCGetParam("cve_cli_id", Empty)
cve_bonificacion = CCGetParam("cve_bonificacion", Empty)
' declare variables
Dim SQL, rsGroups
' execute procedure to update/insert Master Field
SQL = "EXEC cve_ins_upd " & cve_id & "," & cve_fechaingreso & "," & cve_cli_id & "," &
cve_bonificacion
Set rsGroups = DBConnection1.Execute(SQL)
if not rsGroups.EOF and cve_id=0 then
' if it's an insert put the id inserted into cve_id session variable
Session("cve_id") = rsGroups("cve_id")
SQL = CCDLookup(Session("cve_id"),"","",DBConnection1)
end if
' -------------------------
'End Custom Code
%>
"lvalverdeb" <lvalverdeb@forum.codecharge> wrote in message
news:30437ceb3de20e7@news.codecharge.com...
Dos preguntas. Cual versión de codecharge usas? Cuando dices fuera del editable
grid te refieres fuera del ultimo <table> pero aun dentro del formulario?
Yo tuve un problema similar con CCS 3 cuando supuestamente había agregado un
campo, el cual en la vista de diseño parecía estar dentro del <form> pero
cuando revisé en la Vista HTML aparecía justo abajo del </form>. Se solucionó
el problema simplemente al mover el campo dentro del form.
En mi formulario la vista HTML era:
<!-- BEGIN EditableGrid Nombre -->
<form name="{HTMLFormName}" action="{Action}" method="post">
<input type="hidden" value="{FormState}" name="FormState">{FormScript}
<table cellspacing="0" cellpadding="0" width="100%" border="0">
.
.
.
.
</table>
</form>
<input type="hidden" etc etc etc>
<!-- END EditableGrid Nombre -->
Una vez que moví el control dentro del formulario se arregló el problema:
</table>
<input type="hidden" etc etc etc>
</form>
<!-- END EditableGrid ficha_pacientes_citas_fis -->
Saludos
Luis
---------------------------------------
Sent from YesSoftware forum http://forums.codecharge.com/
|
|
 |
|