PDA

View Full Version : [CLOSED] Component in RowExpander problem "is null or not an object"



trePjt
Sep 30, 2013, 10:08 AM
In my project, a gridpanel have a rowexpander like this


<ext:RowExpander ID="repGar" runat="server" SingleExpand="false">
<Component>
<ext:FormPanel ID="FormPanel3" runat="server" Header="false" Border="false" ButtonAlign="Center">
<Items>
<ext:TextField ID="txtGarStyle" Name="TMDSTYLE" runat="server" />
<ext:TextField ID="txtGarSeason" Name="TMDSEAON" runat="server" />
<ext:TextField ID="txtGarProgram" Name="TMDPROGRAM" runat="server" />
<ext:TextField ID="txtGarType" Name="TMDTYPE" runat="server" />
<ext:TextField ID="txtGarApp" Name="_TMDAPP" runat="server" />
<ext:ComboBox runat="server" ID="cboGarWashCare" Name="TMDWASHCARE" TriggerAction="All"
QueryMode="Local"
DisplayField="WASHCARE"
ValueField="WASHCARE">
<Store>
<ext:Store ID="Store2" runat="server">
<Model>
<ext:Model ID="Model4" runat="server">
<Fields>
<ext:ModelField Name="WASHCARE" ServerMapping="WASHCARE"/>
</Fields>
</ext:Model>
</Model>
</ext:Store>
</Store>
</ext:ComboBox>
<ext:NumberField ID="txtGarQty" Name="TMDQTY" runat="server">
<Listeners>
<Change Handler="var est= this.getValue() * #{txtGarYard}.getValue(); #{txtGarEst}.setValue(est);"></Change>
</Listeners>
</ext:NumberField>
<ext:NumberField ID="txtGarYard" Name="TMDYARD" runat="server">
<Listeners>
<Change Handler="var est= #{txtGarQty}.getValue() * #{txtGarYard}.getValue(); #{txtGarEst}.setValue(est);"></Change>
</Listeners>
</ext:NumberField>
<ext:NumberField ID="txtGarEst" Name="TMDEST" runat="server" />
<ext:TextField ID="txtGarRmk" Name="TMDRMK" runat="server" />
</Items>
</ext:FormPanel>
</Component>
</ext:RowExpander>

I added change listener in txtGarQty and txtGarYard to calculate value txtGarEst.
When this listener fire, it returns


'App.txtGarYard' is null or not an object


Then I change the listener to


<Change Handler="var est= this.getValue() * #{txtGarYard}.getValue(); #{txtGarEst}.setValue(est);"></Change>


"this.getValue()" is work find, but #{txtGarYard} and #{txtGarEst} still return that error.
How can I slove it?

trePjt
Sep 30, 2013, 10:46 AM
refer to the thread

http://forums.ext.net/showthread.php?21545-CLOSED-Component-inside-RowExpander-no-longer-has-Id-in-App-namespace

I set SingleExpand=true, solve me problem. Thank you.