PDA

View Full Version : [CLOSED] FormPanel Submit Values with Disabled and Selectable



osef
Aug 06, 2014, 7:52 AM
Hi, I need to get the value from TextField, It has the property Selectable = "false", but, when I send the values, the value for this control is not sending, How Can I Do to send this value in the same list the data (getValues()) of FormPanel?, because if I have many textfields is very tired one by one.



<ext:FormPanel
ID="FormPanel1"
runat="server"
ButtonAlign="Right"
Height="185"
Padding="5"
Title="Title"
Width="300">
<Items>
<ext:TextField
ID="TextField1"
runat="server"
AnchorHorizontal="100%"
FieldLabel="Label">
<Listeners>
<Change Handler="App.TextField2.setValue(App.TextField1.getValue()) ;" />
</Listeners>
</ext:TextField>
<ext:TextField
ID="TextField2"
runat="server"
AnchorHorizontal="100%"
FieldLabel="Label"
Selectable="false">
</ext:TextField>
</Items>
<Buttons>
<ext:Button ID="Button1" runat="server" Icon="Disk" Text="Submit">
<DirectEvents>
<Click OnEvent="Button1_Click">
<EventMask ShowMask="true" Msg="Registrando informaci?n..." />
<ExtraParams>
<ext:Parameter Name="registro" Value="Ext.encode(this.up('form').getForm().getValues(fal se, false, false, true))" Mode="Raw" />
</ExtraParams>
</Click>
</DirectEvents>
</ext:Button>
</Buttons>
</ext:FormPanel>




protected void Button1_Click(object sender, DirectEventArgs e)
{
string strRegistro = e.ExtraParams["registro"];
Dictionary<string, string> dRegistro = JSON.Deserialize<Dictionary<string, string>>(strRegistro);
}


http://forums.ext.net/attachment.php?attachmentid=13991&stc=1

Daniil
Aug 07, 2014, 7:51 AM
Hi @osef,

Yes, the problem is the fact that Selectable="false" disables a field and .getValues() doesn't deal with disabled fields.

Instead of Selectable="false" I can suggest to try this (a CustomConfig option, not an existing property):

InputCls="x-unselectable"

osef
Aug 07, 2014, 2:18 PM
Hi Daniil Can you to give me a complete example please?

Regards

Daniil
Aug 08, 2014, 5:14 AM
Here you are.

<ext:TextField runat="server">
<CustomConfig>
<ext:ConfigItem Name="inputCls" Value="x-unselectable" Mode="Raw" />
</CustomConfig>
</ext:TextField>