Hi, I am playing arround with the WebNumericEdit Control. See below for the configuration:
<igtxt:WebNumericEdit ID="WebNumericEdit1" runat="server" ReadOnly="true" BackColor="transparent" BorderStyle="None" Font-Size="Large" HorizontalAlign="Center" ForeColor="#404040" AutoPostBack="true"><SpinButtons Display="OnRight" SpinOnReadOnly="true" Width="20" /></igtxt:WebNumericEdit>
I would like to perform an AutoPostBack when the value has been changed by the SpinButtons. But it doesn't seem to work. I even set the AutoPostBack to True and I have the following code on the server side:
Protected Sub WebNumericEdit1_ValueChange(ByVal sender As Object, ByVal e As Infragistics.WebUI.WebDataInput.ValueChangeEventArgs) Handles WebNumericEdit1.ValueChange ' ... Code ... 'End Sub
What am I missing here?Note that I set the WebNumericEdit to Read-Only and that I would like to use the SpinButtons to count one value up or down, and every time I count one value up or down, I would like to have a postback.
Thanks.
Hi,
Thank you for report. That appears like a bug and that will be fixed in hot fixes. In this situation there is no lost focus and therefore no ValueChange which triggers postback.
For now, the only solution I can suggest, is to process ClientSideEvents.Spin and trigger postback from there.
To trigger postback the oEvent.needPostBack=true; can be used. However, since Spin event is raised before value is updated, the "spin" action should be explicit. It is also possible to delay postback and call doPost (internal function). Below those 2 examples:
<script type="text/javascript">function WebNumericEdit1_Spin(oEdit, delta, oEvent){ oEdit.spin(delta); oEvent.needPostBack = true;}</script>
or
<script type="text/javascript">function WebNumericEdit1_Spin(oEdit, delta, oEvent){ window.setTimeout('igedit_getById("' + oEdit.ID + '").doPost(3)', 1);}</script>
When is the hotfix scheduled? In the second example, please show the code to hook up the spin event. Thanks.
Thanks. This ClientSidEvent works perfect. I am using the second javascript because the first will show a incrementation of 2 for a brief moment.