[CLOSED] show hide components in table layout

  1. #1

    [CLOSED] show hide components in table layout

    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}.getValue() == 2);
                                                            #{cboRoom}.setVisible(#{cboSensorTypePosition}.getValue() == 3);
                                                            #{cboTank}.setVisible(#{cboSensorTypePosition}.getValue() == 4);
                                        ">
                                        </Select>
                                    </Listeners>
                                </ext:ComboBox>
                                <ext:Button ID="Button5" runat="server" Width="20" Height="20"  Icon="Help"><Listeners><Click Handler="
                                showHelp(#{wndHelp},#{txtHelp},'Sensors_HelpOnField_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_HelpOnField_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_HelpOnField_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_HelpOnField_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_HelpOnField_ON_ID_TANK');" /></Listeners></ext:Button>
                            </Items>
                        </ext:FieldSet>
    Last edited by Daniil; May 22, 2013 at 11:58 AM. Reason: [CLOSED]
  2. #2
    Hi John,

    Please call
    App.fsSensorPosition.doLayout();
    after showing a ComboBox.
  3. #3
    Hi,
    now it works!

    Thank you!

Similar Threads

  1. [CLOSED] How to set table layout in MVC panel
    By MTSI in forum 2.x Legacy Premium Help
    Replies: 1
    Last Post: Mar 05, 2013, 10:18 PM
  2. Table cannot be handled by layout
    By Bubu in forum 2.x Help
    Replies: 9
    Last Post: Nov 27, 2012, 4:33 AM
  3. Replies: 0
    Last Post: Jul 10, 2012, 9:33 AM
  4. [CLOSED] Table Layout, 100% width Table
    By sisa in forum 1.x Legacy Premium Help
    Replies: 5
    Last Post: May 20, 2011, 6:40 AM
  5. Replies: 5
    Last Post: May 05, 2011, 7:05 PM

Posting Permissions