Jan 06, 2022, 11:59 AM
[CLOSED] getting data from DisplayField in FormPanel
Hi,
I have a Formpanel containing DisplayFields. Data are initially loaded through a JsonPProxy and adjusted while using the webapplication.
In the back I want to use the content of the DisplayFields. Unfortunately the values that are retreived are the initial Text, which I set on "0".
When I use a TextField than the loaded content is passed as a value.
Any idea why TextField.Text returns the latest data and DisplayField not? And is there a way to get the data directly from de DisplayField?
I have a Formpanel containing DisplayFields. Data are initially loaded through a JsonPProxy and adjusted while using the webapplication.
In the back I want to use the content of the DisplayFields. Unfortunately the values that are retreived are the initial Text, which I set on "0".
When I use a TextField than the loaded content is passed as a value.
Any idea why TextField.Text returns the latest data and DisplayField not? And is there a way to get the data directly from de DisplayField?
<ext:FormPanel
ID="FormPanelCntAllocation"
runat="server"
AutoDataBind="true">
<Items>
<ext:TextField ID="txtBruto" runat="server" Text="0" DataIndex="bruto"></ext:TextField>
<ext:DisplayField ID="dfBruto" runat="server" Text="0" FieldLabel="Bruto:" DataIndex="bruto" >
</ext:DisplayField>
</Items>
</ext:FormPanel>
And in C#:int iBrutoFromDF = Convert.ToInt32(dfBruto.Text); // result: 0 conform Text="0"
int iBrutoFromTF = Convert.ToInt32(txtBruto.Text); // result: 8560 conform data
Hans Wapenaar
Last edited by fabricio.murta; Jan 07, 2022 at 5:31 PM.