Welcome Guest Search | Active Topics | Sign In | Register

AJAX update cross dialog not refreshing Options
Christiano
Posted: Wednesday, September 29, 2010 10:00:50 AM
Rank: Advanced Member
Groups: Member

Joined: 11/12/2008
Posts: 42
Hey there...

I have 2 dialogs on the page.
In one of them, there is a grid, on the other a simple HTML table with <span>'s.

When you select a grid row, it fires a JS Ajax function that retrieves data from a WS and fills the other dialog.

It works, however, the values are only displayed after clicking the table dialog.

I've tried calling the Control.focus() function after filling up the fields, but nothing happens...

any clue of what could it be?


Tks in advance.
Christiano.

JS Ajax functions:
Code: JavaScript
function BuscarVeiculo(viagem) {  // This function is call on the Grid_Selected()
            AJAX("AJAX.aspx?metodo=veiculo&viagem=" + viagem, procChange_Veic);
        }
        
        function AJAX(url, proc) {
            if (request == null)
                createRequest()

            request.open("GET", url, true);
            request.onreadystatechange = proc;
            request.send(null);    
        }
                
        function procChange_Veic() {
            if (request.readyState == 4) {
                if (request.status == 200) {
                    response = request.responseXML.documentElement;

                    try {
                        var Plac = response.getElementsByTagName('VeicPlac')[0].firstChild.data;
                        var Marc = response.getElementsByTagName('MarcDesc')[0].firstChild.data;
                        var Mode = response.getElementsByTagName('ModeDesc')[0].firstChild.data;
                        var TiVe = response.getElementsByTagName('TiVeDesc')[0].firstChild.data;
                        var AnoX = response.getElementsByTagName('VeicAnoX')[0].firstChild.data;

                        document.getElementById("lblTipo").innerHTML = TiVe;
                        document.getElementById("lblMarca").innerHTML = Marc;
                        document.getElementById("lblModelo").innerHTML = Mode;
                        document.getElementById("lblPlaca").innerHTML = Plac;
                        document.getElementById("lblAno").innerHTML = AnoX;
                    } catch (ex) {
                        alert (ex.description)
                    }   
                }
            }
        }


HTML table dialog:
Code: HTML/ASPX
<eo:Dialog ID="dlgVeiculo" runat="server" AllowResize="True" 
            BorderColor="#335C88" BorderStyle="Solid" BorderWidth="1px" 
            ControlSkinID="None" HeaderHtml="Veículo" 
            MinimizeButtonUrl="00070102" ResizeImageUrl="00020014" 
            RestoreButtonUrl="00070103" ShadowColor="LightGray" ShadowDepth="3" IsModal="False"
            Width="300px" AnchorElementID="divMain" InitialState="Visible" 
            SaveLocation="True">
            <HeaderStyleActive CssText="padding-right: 4px; padding-left: 4px; font-size: 11px; background-image: url(00070104); padding-bottom: 3px; padding-top: 3px; font-family: tahoma" />
            <FooterStyleActive CssText="background-color: #e5f1fd; padding-bottom: 8px;" />
            <ContentStyleActive CssText="border-top: #335c88 1px solid; background-color: #e5f1fd" />
           
            
            <ContentTemplate>
                <table>
                    <tr>
                        <td><strong>Tipo:</strong></td>
                        <td><span id="lblTipo"></span></td>
                    </tr>
                    <tr>
                        <td><strong>Marca:</strong></td>
                        <td><span id="lblMarca"></span></td>
                    </tr>
                    <tr>
                        <td><strong>Modelo:</strong></td>
                        <td><span id="lblModelo"></span></td>
                    </tr>                   
                    <tr>
                        <td><strong>Placa:</strong></td>
                        <td><span id="lblPlaca"></span></td>
                    </tr>
                    <tr>
                        <td><strong>Ano:</strong></td>
                        <td><span id="lblAno"></span></td>
                    </tr>                    
                </table>
            </ContentTemplate>
        </eo:Dialog>


Grid dialog:
Code: HTML/ASPX
<eo:Dialog ID="dlgGrid" runat="server" Height="250px" OffsetX="10" OffsetY="380"
            Width="1240px" AllowResize="True" ControlSkinID="None" HeaderHtml="Grid de Viagens" 
            InitialState="Visible" BorderColor="#335C88" BorderStyle="Solid" 
            BorderWidth="1px" MinimizeButtonUrl="00070102" ResizeImageUrl="00020014" 
            RestoreButtonUrl="00070103" ShadowColor="LightGray" ShadowDepth="3" 
            AnchorElementID="divMain" IsModal="False" MinHeight="150">
            <HeaderStyleActive CssText="padding-right: 4px; padding-left: 4px; font-size: 11px; background-image: url(00070104); padding-bottom: 3px; padding-top: 3px; font-family: tahoma" />
            <FooterStyleActive CssText="background-color: #e5f1fd; padding-bottom: 8px;" />
            <ContentStyleActive CssText="border-top: #335c88 1px solid; background-color: #e5f1fd" />
            
            <ContentTemplate>
                <eo:CallbackPanel ID="CallbackPanel2" runat="server"
                    Triggers="{ControlID:grdViagens;Parameter:}" AutoDisableContents="True" UpdateMode="Conditional">
                        <div id="divGrid" style="width:99%; height: 240px; overflow: auto; position:absolute;">
                            <eo:Grid ID="grdViagens" runat="server" Font-Bold="False" Font-Italic="False" Font-Overline="False"
                                Font-Strikeout="False" Font-Underline="False" Width="1150px" Height="240px" BorderColor="#828790" 
                                BorderWidth="1px" ColumnHeaderAscImage="00050204" ColumnHeaderDescImage="00050205" 
                                ColumnHeaderDividerImage="00050203" ColumnHeaderHeight="24" FixedColumnCount="1" Font-Names="Tahoma" 
                                Font-Size="8.75pt" GridLineColor="240, 240, 240" GridLines="Both" ItemHeight="19" 
                                ClientSideOnCellSelected="" ClientSideOnItemSelected="Grid1_CellSelected" 
                                ClientSideOnLoad="setTimeout('PopulateMap()',2000)">
                                <ItemStyles>
                                    <eo:GridItemStyleSet>
                                        <ItemStyle CssText="background-color: white" />
                                        <ItemHoverStyle CssText="background-image: url(00050206); background-repeat: repeat-x" />
                                        <SelectedStyle CssText="background-image: url(00050207); background-repeat: repeat-x" />
                                        <CellStyle CssText="padding-left:8px;padding-top:2px;white-space:nowrap;" />
                                    </eo:GridItemStyleSet>                                    
                                </ItemStyles>
                                <Columns>
                                    <eo:RowNumberColumn Width="30">
                                    </eo:RowNumberColumn>
                                    <eo:StaticColumn DataField="Statigni" DataFormat="&lt;center&gt;&lt;img src='imagens/{0}.gif'/&gt;&lt;/center&gt;"
                                        HeaderText="Ign." Width="30">
                                    </eo:StaticColumn>
                                    <eo:StaticColumn DataField="StatAtra" DataFormat="&lt;center&gt;&lt;img src='imagens/{0}.gif'/&gt;&lt;/center&gt;"
                                        HeaderText="Atrs." Width="30">
                                    </eo:StaticColumn>
                                    <eo:StaticColumn DataField="VeicPlac" HeaderText="Placa" Width="75">
                                    </eo:StaticColumn>
                                    <eo:StaticColumn DataField="MotoNome" HeaderText="Motorista" Width="160">
                                    </eo:StaticColumn>
                                    <eo:StaticColumn DataField="RotaOrig" HeaderText="Origem">
                                    </eo:StaticColumn>
                                    <eo:StaticColumn DataField="RotaDest" HeaderText="Destino">
                                    </eo:StaticColumn>
                                    <eo:DateTimeColumn DataField="ViagDHIR" DataFormat="{0:dd/MM/yyyy HH:mm}" HeaderText="Inicio"
                                        Width="130">
                                        <DatePicker ControlSkinID="None" DayCellHeight="16" DayCellWidth="19" DayHeaderFormat="FirstLetter"
                                            DisabledDates="" OtherMonthDayVisible="True" SelectedDates="" TitleLeftArrowImageUrl="DefaultSubMenuIconRTL"
                                            TitleRightArrowImageUrl="DefaultSubMenuIcon">
                                            <TodayStyle CssText="font-family: tahoma; font-size: 12px; border-right: #bb5503 1px solid; border-top: #bb5503 1px solid; border-left: #bb5503 1px solid; border-bottom: #bb5503 1px solid" />
                                            <SelectedDayStyle CssText="font-family: tahoma; font-size: 12px; background-color: #fbe694; border-right: white 1px solid; border-top: white 1px solid; border-left: white 1px solid; border-bottom: white 1px solid" />
                                            <DisabledDayStyle CssText="font-family: tahoma; font-size: 12px; color: gray; border-right: white 1px solid; border-top: white 1px solid; border-left: white 1px solid; border-bottom: white 1px solid" />
                                            <PickerStyle CssText="font-family:Courier New; padding-left:5px; padding-right: 5px;" />
                                            <CalendarStyle CssText="background-color: white; border-right: #7f9db9 1px solid; padding-right: 4px; border-top: #7f9db9 1px solid; padding-left: 4px; font-size: 9px; padding-bottom: 4px; border-left: #7f9db9 1px solid; padding-top: 4px; border-bottom: #7f9db9 1px solid; font-family: tahoma" />
                                            <TitleArrowStyle CssText="cursor:hand" />
                                            <DayHoverStyle CssText="font-family: tahoma; font-size: 12px; border-right: #fbe694 1px solid; border-top: #fbe694 1px solid; border-left: #fbe694 1px solid; border-bottom: #fbe694 1px solid" />
                                            <MonthStyle CssText="font-family: tahoma; font-size: 12px; margin-left: 14px; cursor: hand; margin-right: 14px" />
                                            <TitleStyle CssText="background-color:#9ebef5;font-family:Tahoma;font-size:12px;padding-bottom:2px;padding-left:6px;padding-right:6px;padding-top:2px;" />
                                            <OtherMonthDayStyle CssText="font-family: tahoma; font-size: 12px; color: gray; border-right: white 1px solid; border-top: white 1px solid; border-left: white 1px solid; border-bottom: white 1px solid" />
                                            <DayHeaderStyle CssText="font-family: tahoma; font-size: 12px; border-bottom: #aca899 1px solid" />
                                            <DayStyle CssText="font-family: tahoma; font-size: 12px; border-right: white 1px solid; border-top: white 1px solid; border-left: white 1px solid; border-bottom: white 1px solid" />
                                        </DatePicker>
                                    </eo:DateTimeColumn>
                                    <eo:DateTimeColumn DataField="ViagDHFP" DataFormat="{0:dd/MM/yyyy HH:mm}" HeaderText="T&#233;rmino"
                                        Width="130">
                                        <DatePicker ControlSkinID="None" DayCellHeight="16" DayCellWidth="19" DayHeaderFormat="FirstLetter"
                                            DisabledDates="" OtherMonthDayVisible="True" SelectedDates="" TitleLeftArrowImageUrl="DefaultSubMenuIconRTL"
                                            TitleRightArrowImageUrl="DefaultSubMenuIcon">
                                            <TodayStyle CssText="font-family: tahoma; font-size: 12px; border-right: #bb5503 1px solid; border-top: #bb5503 1px solid; border-left: #bb5503 1px solid; border-bottom: #bb5503 1px solid" />
                                            <SelectedDayStyle CssText="font-family: tahoma; font-size: 12px; background-color: #fbe694; border-right: white 1px solid; border-top: white 1px solid; border-left: white 1px solid; border-bottom: white 1px solid" />
                                            <DisabledDayStyle CssText="font-family: tahoma; font-size: 12px; color: gray; border-right: white 1px solid; border-top: white 1px solid; border-left: white 1px solid; border-bottom: white 1px solid" />
                                            <PickerStyle CssText="font-family:Courier New; padding-left:5px; padding-right: 5px;" />
                                            <CalendarStyle CssText="background-color: white; border-right: #7f9db9 1px solid; padding-right: 4px; border-top: #7f9db9 1px solid; padding-left: 4px; font-size: 9px; padding-bottom: 4px; border-left: #7f9db9 1px solid; padding-top: 4px; border-bottom: #7f9db9 1px solid; font-family: tahoma" />
                                            <TitleArrowStyle CssText="cursor:hand" />
                                            <DayHoverStyle CssText="font-family: tahoma; font-size: 12px; border-right: #fbe694 1px solid; border-top: #fbe694 1px solid; border-left: #fbe694 1px solid; border-bottom: #fbe694 1px solid" />
                                            <MonthStyle CssText="font-family: tahoma; font-size: 12px; margin-left: 14px; cursor: hand; margin-right: 14px" />
                                            <TitleStyle CssText="background-color:#9ebef5;font-family:Tahoma;font-size:12px;padding-bottom:2px;padding-left:6px;padding-right:6px;padding-top:2px;" />
                                            <OtherMonthDayStyle CssText="font-family: tahoma; font-size: 12px; color: gray; border-right: white 1px solid; border-top: white 1px solid; border-left: white 1px solid; border-bottom: white 1px solid" />
                                            <DayHeaderStyle CssText="font-family: tahoma; font-size: 12px; border-bottom: #aca899 1px solid" />
                                            <DayStyle CssText="font-family: tahoma; font-size: 12px; border-right: white 1px solid; border-top: white 1px solid; border-left: white 1px solid; border-bottom: white 1px solid" />
                                        </DatePicker>
                                    </eo:DateTimeColumn>
                                    <eo:DateTimeColumn DataField="VUCODHRa" DataFormat="{0:dd/MM/yyyy HH:mm}" HeaderText="Ult.Cont."
                                        Width="130">
                                        <DatePicker ControlSkinID="None" DayCellHeight="16" DayCellWidth="19" DayHeaderFormat="FirstLetter"
                                            DisabledDates="" OtherMonthDayVisible="True" SelectedDates="" TitleLeftArrowImageUrl="DefaultSubMenuIconRTL"
                                            TitleRightArrowImageUrl="DefaultSubMenuIcon">
                                            <TodayStyle CssText="font-family: tahoma; font-size: 12px; border-right: #bb5503 1px solid; border-top: #bb5503 1px solid; border-left: #bb5503 1px solid; border-bottom: #bb5503 1px solid" />
                                            <SelectedDayStyle CssText="font-family: tahoma; font-size: 12px; background-color: #fbe694; border-right: white 1px solid; border-top: white 1px solid; border-left: white 1px solid; border-bottom: white 1px solid" />
                                            <DisabledDayStyle CssText="font-family: tahoma; font-size: 12px; color: gray; border-right: white 1px solid; border-top: white 1px solid; border-left: white 1px solid; border-bottom: white 1px solid" />
                                            <PickerStyle CssText="font-family:Courier New; padding-left:5px; padding-right: 5px;" />
                                            <CalendarStyle CssText="background-color: white; border-right: #7f9db9 1px solid; padding-right: 4px; border-top: #7f9db9 1px solid; padding-left: 4px; font-size: 9px; padding-bottom: 4px; border-left: #7f9db9 1px solid; padding-top: 4px; border-bottom: #7f9db9 1px solid; font-family: tahoma" />
                                            <TitleArrowStyle CssText="cursor:hand" />
                                            <DayHoverStyle CssText="font-family: tahoma; font-size: 12px; border-right: #fbe694 1px solid; border-top: #fbe694 1px solid; border-left: #fbe694 1px solid; border-bottom: #fbe694 1px solid" />
                                            <MonthStyle CssText="font-family: tahoma; font-size: 12px; margin-left: 14px; cursor: hand; margin-right: 14px" />
                                            <TitleStyle CssText="background-color:#9ebef5;font-family:Tahoma;font-size:12px;padding-bottom:2px;padding-left:6px;padding-right:6px;padding-top:2px;" />
                                            <OtherMonthDayStyle CssText="font-family: tahoma; font-size: 12px; color: gray; border-right: white 1px solid; border-top: white 1px solid; border-left: white 1px solid; border-bottom: white 1px solid" />
                                            <DayHeaderStyle CssText="font-family: tahoma; font-size: 12px; border-bottom: #aca899 1px solid" />
                                            <DayStyle CssText="font-family: tahoma; font-size: 12px; border-right: white 1px solid; border-top: white 1px solid; border-left: white 1px solid; border-bottom: white 1px solid" />
                                        </DatePicker>
                                    </eo:DateTimeColumn>
                                    <eo:StaticColumn DataField="VucoRodo" HeaderText="Locali.">
                                    </eo:StaticColumn>
                                    <eo:StaticColumn DataField="VUCOLoca" DataFormat="" HeaderText="Cidade" Width="130">
                                    </eo:StaticColumn>
                                    <eo:StaticColumn DataField="ViagStMa" HeaderText="Status">
                                    </eo:StaticColumn>
                                    <eo:StaticColumn DataField="RastNome" HeaderText="Rastreador" Width="150">
                                    </eo:StaticColumn>
                                    <eo:StaticColumn DataField="VeicRaID" HeaderText="Antena">
                                    </eo:StaticColumn>
                                    <eo:StaticColumn AllowResize="False" DataField="VUCOLati" HeaderText="Lati" 
                                        Width="0">
                                    </eo:StaticColumn>
                                    <eo:StaticColumn AllowResize="False" DataField="VUCOLong" HeaderText="Long" 
                                        Width="0">
                                    </eo:StaticColumn>
                                    <eo:StaticColumn AllowResize="False" DataField="ViagCodi" HeaderText="Codi" 
                                        Width="0">
                                    </eo:StaticColumn>
                                    </Columns>
                                <FooterStyle CssText="padding-bottom:4px;padding-left:4px;padding-right:4px;padding-top:4px;" />
                                <ColumnTemplates>
                                    <eo:TextBoxColumn>
                                        <TextBoxStyle CssText="BORDER-RIGHT: #7f9db9 1px solid; PADDING-RIGHT: 2px; BORDER-TOP: #7f9db9 1px solid; PADDING-LEFT: 2px; FONT-SIZE: 8.75pt; PADDING-BOTTOM: 1px; MARGIN: 0px; BORDER-LEFT: #7f9db9 1px solid; PADDING-TOP: 2px; BORDER-BOTTOM: #7f9db9 1px solid; FONT-FAMILY: Tahoma" />
                                    </eo:TextBoxColumn>
                                    <eo:DateTimeColumn>
                                        <DatePicker ControlSkinID="None" DayCellHeight="16" DayCellWidth="19" DayHeaderFormat="FirstLetter"
                                            DisabledDates="" OtherMonthDayVisible="True" SelectedDates="" TitleLeftArrowImageUrl="DefaultSubMenuIconRTL"
                                            TitleRightArrowImageUrl="DefaultSubMenuIcon">
                                            <TodayStyle CssText="font-family: tahoma; font-size: 12px; border-right: #bb5503 1px solid; border-top: #bb5503 1px solid; border-left: #bb5503 1px solid; border-bottom: #bb5503 1px solid" />
                                            <SelectedDayStyle CssText="font-family: tahoma; font-size: 12px; background-color: #fbe694; border-right: white 1px solid; border-top: white 1px solid; border-left: white 1px solid; border-bottom: white 1px solid" />
                                            <DisabledDayStyle CssText="font-family: tahoma; font-size: 12px; color: gray; border-right: white 1px solid; border-top: white 1px solid; border-left: white 1px solid; border-bottom: white 1px solid" />
                                            <PickerStyle CssText="border-bottom-color:#7f9db9;border-bottom-style:solid;border-bottom-width:1px;border-left-color:#7f9db9;border-left-style:solid;border-left-width:1px;border-right-color:#7f9db9;border-right-style:solid;border-right-width:1px;border-top-color:#7f9db9;border-top-style:solid;border-top-width:1px;font-family:Courier New;font-size:8pt;margin-bottom:0px;margin-left:0px;margin-right:0px;margin-top:0px;padding-bottom:1px;padding-left:2px;padding-right:2px;padding-top:2px;" />
                                            <CalendarStyle CssText="background-color: white; border-right: #7f9db9 1px solid; padding-right: 4px; border-top: #7f9db9 1px solid; padding-left: 4px; font-size: 9px; padding-bottom: 4px; border-left: #7f9db9 1px solid; padding-top: 4px; border-bottom: #7f9db9 1px solid; font-family: tahoma" />
                                            <TitleArrowStyle CssText="cursor:hand" />
                                            <DayHoverStyle CssText="font-family: tahoma; font-size: 12px; border-right: #fbe694 1px solid; border-top: #fbe694 1px solid; border-left: #fbe694 1px solid; border-bottom: #fbe694 1px solid" />
                                            <MonthStyle CssText="font-family: tahoma; font-size: 12px; margin-left: 14px; cursor: hand; margin-right: 14px" />
                                            <TitleStyle CssText="background-color:#9ebef5;font-family:Tahoma;font-size:12px;padding-bottom:2px;padding-left:6px;padding-right:6px;padding-top:2px;" />
                                            <OtherMonthDayStyle CssText="font-family: tahoma; font-size: 12px; color: gray; border-right: white 1px solid; border-top: white 1px solid; border-left: white 1px solid; border-bottom: white 1px solid" />
                                            <DayHeaderStyle CssText="font-family: tahoma; font-size: 12px; border-bottom: #aca899 1px solid" />
                                            <DayStyle CssText="font-family: tahoma; font-size: 12px; border-right: white 1px solid; border-top: white 1px solid; border-left: white 1px solid; border-bottom: white 1px solid" />
                                        </DatePicker>
                                    </eo:DateTimeColumn>
                                    <eo:MaskedEditColumn>
                                        <MaskedEdit ControlSkinID="None" TextBoxStyle-CssText="BORDER-RIGHT: #7f9db9 1px solid; PADDING-RIGHT: 2px; BORDER-TOP: #7f9db9 1px solid; PADDING-LEFT: 2px; PADDING-BOTTOM: 1px; MARGIN: 0px; BORDER-LEFT: #7f9db9 1px solid; PADDING-TOP: 2px; BORDER-BOTTOM: #7f9db9 1px solid; font-family:Courier New;font-size:8pt;">
                                        </MaskedEdit>
                                    </eo:MaskedEditColumn>
                                </ColumnTemplates>
                                <ColumnHeaderHoverStyle CssText="background-image:url('00050202');padding-left:8px;padding-top:4px;" />
                                <ColumnHeaderStyle CssText="background-image:url('00050201');padding-left:8px;padding-top:4px;" />                                                               
                            </eo:Grid>
                        </div>                  
                    </eo:CallbackPanel>
            </ContentTemplate>
        </eo:Dialog>


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.