Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Larry on Nov 03, 2009 08:16
open dhtmlx forum
doPostBack + dhtmlxloyout

Good day!.
I need help with __doPostBack + dhtmlxloyout, what happens is that I am placing a form in a cell with a button, and when I press the button should I switch to another form, the problem is that I can not get pass the variables, I always go through blank variables.

The code I use is the sgte.

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="index.aspx.vb" Inherits="index" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<link rel="stylesheet" type="text/css" href="code/dhtmlxlayout.css">
<link rel="stylesheet" type="text/css" href="code/skins/dhtmlxlayout_dhx_black.css">
<link rel="stylesheet" type="text/css" href="code/skins/dhtmlxlayout_dhx_blue.css">
<link rel="stylesheet" type="text/css" href="code/skins/dhtmlxlayout_dhx_skyblue.css">
<script src="code/dhtmlxcommon.js"></script>
<script src="code/dhtmlxlayout.js"></script>
<script src="code/dhtmlxcontainer.js"></script>
<script>
var dhxLayout;
var activeSkin = "dhx_skyblue";
function carga()
{
dhxLayout = new dhtmlXLayoutObject(document.body,"3L", activeSkin);
dhxLayout.cells("b").attachObject("objId1");
dhxLayout.cells("c").attachObject("objId2");
dhxLayout.cells("a").setText("Opcion1 ");
dhxLayout.cells("b").setText("Opcion2");
dhxLayout.cells("c").setText("Opcion3");
setWidth();
setHeight();
}
function changeSkin(skin)
{
dhxLayout.setSkin(skin);
document.getElementById("tr_" + activeSkin).style.backgroundColor = "#FFFFFF";
activeSkin = skin;
document.getElementById("tr_" + activeSkin).style.backgroundColor = "#CFCFCF";
}
function setWidth() {
dhxLayout.items[0].setWidth(200);
}
function setHeight() {
dhxLayout.items[1].setHeight(130);
}
function ver()
{
__doPostBack('Obj');
}
</script>
<style>
        html, body {
            width: 100%;
            height: 100%;
            margin: 0px;
            padding: 0px;
            overflow: hidden;
        }
    </style>
<title>.:: ABL PHARMA PERU ::.</title>
</head>
<body leftmargin="0" topmargin="0" rightmargin="0" bgproperties="fixed" marginwidth="0" marginheight="0" onload="carga();">
<form id="form1" runat="server" target="detalle2" action="variable.aspx" >
<div id="objId1" style="width: 100%; height: 100%; font-family: Tahoma;">
<asp:TextBox ID="variab" runat="server"></asp:TextBox>
<asp:Button ID="Button" runat="server" Text="Ver" PostBackUrl="variable.aspx" OnClientClick ="ver();"/>
</div>
<div id="objId2" style="width: 100%; height: 100%; overflow: auto; display: none; font-family: Tahoma; font-size: 11px;">
<iframe src="vacio2.aspx" name="detalle2" frameborder="1" scrolling="no" width= "100%" height = "100%" ></iframe>
</div>
</form>
</body>
</html>

The procedure is correct because I tested this on a file regardless of the tool and dhtmlxLayout successful, could please help me maybe I'm skipping some steps.

Thank you.
Answer posted by Alex (support) on Nov 03, 2009 09:31
Hello,

please try to place form inside objId1 container:

<div id="objId1" style="width: 100%; height: 100%; font-family: Tahoma;">
    <form id="form1" runat="server" target="detalle2" action="variable.aspx" >
         <asp:TextBox ID="variab" runat="server"></asp:TextBox>
         <asp:Button ID="Button" runat="server" Text="Ver" PostBackUrl="variable.aspx" OnClientClick ="ver();"/>
    </form>
</div>
<div id="objId2" style="width: 100%; height: 100%; overflow: auto; display: none; font-family: Tahoma; font-size: 11px;">
      <iframe src="vacio2.aspx" name="detalle2" frameborder="1" scrolling="no" width= "100%" height = "100%" ></iframe>
</div>
Answer posted by Larry on Nov 03, 2009 10:13
Thanks for the answer, but I have the same result with this code.


The idea is to have my <iframe> in "objId2".
Answer posted by Larry on Nov 03, 2009 10:18

Thanks for the answer, but I have the same result with this code.

<form id="form1" runat="server" target="detalle2" action="variable.aspx" >

<div id="objId1" style="width: 100%; height: 100%; font-family: Tahoma;">

<asp:TextBox ID="variab" runat="server"></asp:TextBox>

<asp:Button ID="Button" runat="server" Text="Ver" PostBackUrl="variable.aspx" OnClientClick ="ver();"/>

<iframe src="vacio2.aspx" name="detalle2" frameborder="1" scrolling="no" width= "100%" height = "100%" ></iframe>

</div>

<div id="objId2" style="width: 100%; height: 100%; overflow: auto; display: none; font-family: Tahoma; font-size: 11px;">

</div>

</form>


You need the <iframe> in "objId2.

Attachments (1)
DHTMLX.jpg27.44 Kb
Answer posted by Alex (support) on Nov 04, 2009 02:04
This is not code that we have recommended.

Please try to use the following

<div id="objId1" style="width: 100%; height: 100%; font-family: Tahoma;">
    <form id="form1" runat="server" target="detalle2" action="variable.aspx" >
         <asp:TextBox ID="variab" runat="server"></asp:TextBox>
         <asp:Button ID="Button" runat="server" Text="Ver" PostBackUrl="variable.aspx" OnClientClick ="ver();"/>
    </form>
</div>

<div id="objId2" style="width: 100%; height: 100%; overflow: auto; display: none; font-family: Tahoma; font-size: 11px;">
      <iframe src="vacio2.aspx" name="detalle2" frameborder="1" scrolling="no" width= "100%" height = "100%" ></iframe>
</div>

Answer posted by Larry on Nov 04, 2009 05:38
Perfect.
Thank you very much!