jahlxx Posted April 6, 2016 Share Posted April 6, 2016 Hi. Tunidbedit onchange event doen't raise. Why? Thanks. Quote Link to comment Share on other sites More sharing options...
bugra Posted April 6, 2016 Share Posted April 6, 2016 Hi, What is your code written in there? Quote Link to comment Share on other sites More sharing options...
jahlxx Posted April 6, 2016 Author Share Posted April 6, 2016 execute a query. I put a breakpoint to trace the execution, but never do it. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted April 6, 2016 Share Posted April 6, 2016 Tunidbedit onchange event doen't raise. Hi, Can you clarify your issue ?! Sorry, for example this works: procedure TMainForm.UniDBEdit1Change(Sender: TObject); begin // end; Best regards. Quote Link to comment Share on other sites More sharing options...
jahlxx Posted April 6, 2016 Author Share Posted April 6, 2016 this code is in onchange event of the unidbedit, but never execute. procedure Tfalbaranesv.xalbaChange(Sender: TObject);begin try qlin.close; qlin.sql.clear; qlin.sql.add('select a.albaran, a.linea, a.facturado, a.cod_articulo, b.alias, a.cantidad, a.precio, a.descuento, a.cod_moneda, a.importe, c.des_um, a.lote, a.nlote, a.nsublote, a.iorg_id, a.cod_almacen, a.cod_ubicacion,'); qlin.sql.add('a.iorg_id2, a.cod_almacen2, a.cod_ubicacion2, a.descripcion, a.acidez, a.facturable, a.mdep'); qlin.sql.add('from lalbaranesv_t a, articulos_t b, unidades_t c'); qlin.sql.add('where a.albaran = :c1'); qlin.sql.add('and a.org_id = :c2'); qlin.sql.add('and a.cod_articulo = b.cod_articulo'); qlin.sql.add('and a.cod_um = c.cod_um'); qlin.sql.add('order by a.albaran, a.linea'); qlin.parambyname('c1').asstring := qcab.FieldByName('albaran').asstring; qlin.parambyname('c2').asinteger := qcab.FieldByName('org_id').asinteger; qlin.open; qlin.first; except on E : Exception do begin showmessage(E.Message); end; end; end;end; Quote Link to comment Share on other sites More sharing options...
bugra Posted April 6, 2016 Share Posted April 6, 2016 Could you look at event connected this procedure in object inspector. Maybe somehow it was deleted. if it's connected. could you write a different code. show a message maybe. and is this effective write a query in change effect? I mean it's work everytime changed. every letter this code goes server, executed, goes back. Quote Link to comment Share on other sites More sharing options...
bugra Posted April 6, 2016 Share Posted April 6, 2016 I notice your sql's some part goes incorrect. for example when you add from part there is no space. so it will added after sql like "a.iorg_id2, a.cod_almacen2, a.cod_ubicacion2, a.descripcion, a.acidez, a.facturable, a.mdepfrom lalbaranesv_t a, articulos_t b, unidades_t c" try add a space before add sql like qlin.sql.add(' from lalbaranesv_t a, articulos_t b, unidades_t c'); Quote Link to comment Share on other sites More sharing options...
jahlxx Posted April 6, 2016 Author Share Posted April 6, 2016 the onchange event of the unidbedit, doesn't raise. If I put a unibutton, that manually do the same that the event of the unidbedit, the button click works. but the onchange event, not. Quote Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted April 7, 2016 Administrators Share Posted April 7, 2016 It is not clear from your code. Please post a complete project in bug reports Let me state that OnChange event is fired only when user changes a value in DBEdit. Quote Link to comment Share on other sites More sharing options...
jahlxx Posted April 7, 2016 Author Share Posted April 7, 2016 ok. the onchange event raise, when the user change the valur, not when the value changes. in a dataset.next, the dbedit gets the new value of the field, but not raise the onchange event. this not occurs in a normal vcl application. any workaround? Quote Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted April 7, 2016 Administrators Share Posted April 7, 2016 Yes, uniGUI works differently. Event happens only when user changes data. Quote Link to comment Share on other sites More sharing options...
rgreat Posted April 7, 2016 Share Posted April 7, 2016 any workaround? Work with TDataSet or TDataSource events. Quote Link to comment Share on other sites More sharing options...
jahlxx Posted April 7, 2016 Author Share Posted April 7, 2016 ok. I've inserted the code of the onchange event if the dbedit, in the afterscroll of the dataset, and now I've that I want. This is for 2 grids, master detail, and charge the detail after every change in master. Thanks. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.