PDA

View Full Version : [CLOSED] slider in a formpanel



HansWapenaar
Nov 30, 2012, 9:24 PM
Hi,

I had taken the demo of a slider and got it working in a panel.
Then I wanted to have the slider together with other controls in a formpanel.

I get an error because there is no value (runtime error javascript: if(value.length<1||(value===me.emptyText&&me.valueContainsPlaceholder)){return errors;})

When I add a Value I get another error:
a parser error: Can not create object of type System.Object based on the string representation for the Value property. (translated)

I am using Ext.net version 2.1, VS2010; IE10




<ext:FormPanel ID="formPnlThemeConstruction" runat="server" Header="false" >
<Items>
<ext:FieldContainer ID="FieldContainerTransparency"
runat="server"
FieldLabel="Transparantie"
AnchorHorizontal="100%"
Layout="HBoxLayout"
<Defaults>
<ext:Parameter Name="margins" Value="0 5 0 0" Mode="Value" />
</Defaults>
<Items>
<ext:Slider
ID="sliderTransparency"
runat="server"
Single="true"
Number="40"
MinValue="0"
MaxValue="100"
Width="240" Value="40" >
<Listeners>
<Change Fn="updateTransparency" />
</Listeners>
</ext:Slider>
<ext:TextField ID="txtSliderTransparency" runat="server" Text="0" Width="30"/>
</Items>
</ext:FieldContainer>
</Items>
</ext:FormPanel>


What could be the problem?

Hans

Baidaly
Dec 01, 2012, 12:43 AM
Hello!

It seems to be a bug, we are investigating. For now please use overriding from the following example:



<%@ Page Language="C#" %>

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<!DOCTYPE html>
<html>
<head runat="server">
<title>Custom GridPanel UI - Ext.NET Examples</title>
<script>
var linkClick = function (index) {
alert("Company: " + App.Store1.getAt(index).get("company"));
};

var linkRenderer = function (value, meta, record, index) {
return Ext.String.format("<a class='company-link' href='#' onclick='linkClick({1});'>{0}</a>", value, index);
};
</script>
</head>
<body>
<ext:ResourceManager runat="server" ScriptMode="Debug" SourceFormatting="True" />
<h1>
Custom GridPanel UI</h1>
<script>
Ext.form.field.Base.override({
getRawValue: function () {
var me = this,
v = me.inputEl ? me.inputEl.getValue() : Ext.value(me.rawValue || me.value, '');
me.rawValue = v;
v = v == null && me.hiddenField ? me.hiddenField.getValue() : v;
return v;
}
});
</script>
<ext:FormPanel ID="formPnlThemeConstruction" runat="server" Header="false">
<Items>
<ext:FieldContainer ID="FieldContainerTransparency" runat="server" FieldLabel="Transparantie"
AnchorHorizontal="100%" Layout="HBoxLayout">
<Defaults>
<ext:Parameter Name="margins" Value="0 5 0 0" Mode="Value" />
</Defaults>
<Items>
<ext:Slider ID="sliderTransparency" runat="server" Single="true" Number="40" MinValue="0"
MaxValue="100" Width="240">
<Listeners>
<Change Handler="#{txtSliderTransparency}.setValue(this.getValue()) ;" />
</Listeners>
</ext:Slider>
<ext:TextField ID="txtSliderTransparency" runat="server" Text="0" Width="30">
<Listeners>
<AfterRender Handler="this.setValue(#{sliderTransparency}.getValue());" />
<Change Handler="#{sliderTransparency}.setValue(this.getValue());" />
</Listeners>
</ext:TextField>
</Items>
</ext:FieldContainer>
</Items>
</ext:FormPanel>
</body>
</html>

HansWapenaar
Dec 01, 2012, 5:11 AM
Thanks, workaround is working!

Daniil
Dec 04, 2012, 8:51 AM
This has been fixed in SVN. Please update.

Thank you again for the report.