PDA

View Full Version : [CLOSED] show hide components in table layout



John_Writers
May 22, 2013, 8:49 AM
Hi,
I have a problem when I show/hide a component, such as a combobox in a fieldset with table layout.

The issue is with the Select handler of the combobox.

The master combobox "cboSensorTypePosition" display o hide the second combobox.

In the select handler the getValue function works good, but on the field set I don't see the slave combobox.

I think that I have to redraw the form, or something like this.

Thank you for your help.

Here above the piece of code:


<ext:FieldSet ID="fsSensorPosition" runat="server" ColumnWidth="0.4" Title="test"
MarginSpec="0 0 0 10" ButtonAlign="Right" Layout="TableLayout"
>
<LayoutConfig>
<ext:TableLayoutConfig Columns="2" />
</LayoutConfig>
<Defaults>
<ext:Parameter Name="Width" Value="300" />
<ext:Parameter Name="LabelWidth" Value="150" />
</Defaults>
<Items>

<ext:ComboBox ID="cboSensorTypePosition" StoreID="st_SensorTypePosition" runat="server" Name="ID_SENSOR_TYPE_POSITION" AutoSelect="true"
FieldLabel="sensor type position" ValueField="ID_SENSOR_TYPE_POSITION"
DisplayField="Name">
<Listeners>
<Select Handler="
#{cboMainTank}.setVisible(#{cboSensorTypePosition} .getValue() == 1);
#{cboLine}.setVisible(#{cboSensorTypePosition}.get Value() == 2);
#{cboRoom}.setVisible(#{cboSensorTypePosition}.get Value() == 3);
#{cboTank}.setVisible(#{cboSensorTypePosition}.get Value() == 4);
">
</Select>
</Listeners>
</ext:ComboBox>
<ext:Button ID="Button5" runat="server" Width="20" Height="20" Icon="Help"><Listeners><Click Handler="
showHelp(#{wndHelp},#{txtHelp},'Sensors_HelpOnFiel d_ID_SENSOR_TYPE_POSITION');" /></Listeners></ext:Button>

<ext:ComboBox ID="cboMainTank" Hidden="true" StoreID="st_MainTanks" runat="server" Name="ON_ID_MAIN_TANK" AutoSelect="true"
FieldLabel="<%$ Resources:Global, Sensors_SensorsList_OnMainTank %>" ValueField="ID_MAIN_TANK"
DisplayField="Name">
</ext:ComboBox>
<ext:Button ID="btnHelpON_ID_MAIN_TANK" runat="server" Width="20" Height="20" Icon="Help"><Listeners><Click Handler="
showHelp(#{wndHelp},#{txtHelp},'Sensors_HelpOnFiel d_ON_ID_MAIN_TANK');" /></Listeners></ext:Button>

<ext:ComboBox ID="cboLine" Hidden="true" StoreID="st_Lines" runat="server" Name="ON_ID_LINE" AutoSelect="true"
FieldLabel="<%$ Resources:Global, Sensors_SensorsList_OnLine %>" ValueField="ID_LINE"
DisplayField="Name">
</ext:ComboBox>
<ext:Button ID="btnHelpON_ID_LINE" runat="server" Width="20" Height="20" Icon="Help"><Listeners><Click Handler="
showHelp(#{wndHelp},#{txtHelp},'Sensors_HelpOnFiel d_ON_ID_LINE');" /></Listeners></ext:Button>

<ext:ComboBox ID="cboRoom" Hidden="true" StoreID="st_Rooms" runat="server" Name="ON_ID_ROOM" AutoSelect="true"
FieldLabel="<%$ Resources:Global, Sensors_SensorsList_OnRoom %>" ValueField="ID_ROOM"
DisplayField="Name">
</ext:ComboBox>
<ext:Button ID="btnHelpON_ID_ROOM" runat="server" Width="20" Height="20" Icon="Help"><Listeners><Click Handler="
showHelp(#{wndHelp},#{txtHelp},'Sensors_HelpOnFiel d_ON_ID_ROOM');" /></Listeners></ext:Button>
<ext:ComboBox ID="cboTank" Hidden="true" StoreID="st_Tanks" runat="server" Name="ON_ID_TANK" AutoSelect="true"
FieldLabel="<%$ Resources:Global, Sensors_SensorsList_OnTank %>" ValueField="ID_TANK"
DisplayField="Name">
</ext:ComboBox>
<ext:Button ID="btnHelpON_ID_TANK" runat="server" Width="20" Height="20" Icon="Help"><Listeners><Click Handler="
showHelp(#{wndHelp},#{txtHelp},'Sensors_HelpOnFiel d_ON_ID_TANK');" /></Listeners></ext:Button>
</Items>
</ext:FieldSet>

Daniil
May 22, 2013, 10:22 AM
Hi John,

Please call

App.fsSensorPosition.doLayout();
after showing a ComboBox.

John_Writers
May 22, 2013, 11:27 AM
Hi,
now it works!

Thank you!