PDA

View Full Version : Really Really simple question



JamieG
13 Feb 2007, 6:50 AM
Hi,

I'm very new to all this YUI stuff. I am using Microsoft Visual Studio 2005 connecting to a Lotus Notes Database for the data. Everything is going ok....but what I want to do is really simple.

In my west panel, I would like to have a series of links. when I click one of the links i would like it to open an ASP page in a new tab in the centre region.

ANyone have any ideas as how to do this?

Thanks very much.

Jamie.

JamieG
13 Feb 2007, 8:08 AM
does this help anyone help me? :

In a Domino Form the syntax would be :

$about','About')">About (#)



Thanks

JG

tryanDLS
13 Feb 2007, 8:17 AM
I suggest you start looking at the examples. There are numerous examples of hooking a click event to something an driving other UI things e.g. opening a panel.

JamieG
13 Feb 2007, 8:32 AM
I have had a look at the examples, but cannot see an HTML link which opens in another panel.

If you can point me in the right direction, that would be great.

Jamie.

aconran
13 Feb 2007, 11:36 AM
Check out this thread...
http://www.yui-ext.com/forum/viewtopic.php?t=2441

JamieG
14 Feb 2007, 1:32 AM
Now i'm trying to do something even easier..... add a tab....but its not working...here is my code:


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

<!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 id="Head1" runat="server">
<title>Untitled Page</title>
<script type="text/javascript" src="scripts/utilities_2.1.0.js"></script>
<script type="text/javascript" src="scripts/yui-ext.js"></script>
<script type="text/javascript" src="scripts/layout.js"></script>

<link rel="stylesheet" type="text/css" href="styles/reset-min.css" />
<link rel="stylesheet" type="text/css" href="styles/tabs.css"/>
<link rel="stylesheet" type="text/css" href="styles/layout.css"/>
<link rel="stylesheet" type="text/css" href="styles/grid.css"/>
<link rel="stylesheet" type="text/css" href="styles/basic-dialog.css" />
<link rel="stylesheet" type="text/css" href="styles/resizable.css" />
<link rel="stylesheet" type="text/css" href="styles/yui-ext.css" />
<link href="styles/banner.css" rel="stylesheet" type="text/css" />
<link href="styles/NC.css" rel="stylesheet" type="text/css" />

<script type="text/javascript" src="scripts/PropsGrid.js"></script>
<script type="text/javascript" src="scripts/hello.js"></script>

<style type="text/css">
body {font:normal 9pt verdana; margin:0;padding:0;border:0px none;overflow:hidden;}
.ylayout-panel-north {
border:0px none;
background-color:#c3daf9;
}
#nav {
}
#autoTabs, #center1, #center2, #west {
padding:10px;
}
#north, #south{
font:normal 8pt arial, helvetica;
padding:4px;
}
.ylayout-panel-center p {
margin:5px;
}
#props-panel .ygrid-col-0{
}
#props-panel .ygrid-col-1{
}
</style>
<script type="text/javascript">
Example = function(){
var layout;
return {
init : function(){
layout = new YAHOO.ext.BorderLayout(document.body, {
hideOnLayout: true,
north: {
split:false,
initialSize: 150,
titlebar: false
},
west: {
split:true,
initialSize: 200,
minSize: 175,
maxSize: 400,
titlebar: false,
collapsible: true,
animate: true
},
east: {
split:true,
initialSize: 202,
minSize: 202,
maxSize: 202,
titlebar: true,
collapsible: true,
animate: true
},
south: {
split:true,
initialSize: 25,
minSize: 25,
maxSize: 100,
titlebar: false,
collapsible: true,
animate: true
},
center: {
titlebar: true,
autoScroll:true
}
});
var propsGrid = new YAHOO.ext.grid.PropsGrid('props-panel');
// bogus object as a data source
propsGrid.setSource({
"(name)": "Properties Grid",
"grouping": false,
"autoFitColumns": true,
"productionQuality": false,
"created": new Date(Date.parse('10/15/2006')),
"tested": false,
"version": .01,
"borderWidth": 1
});
propsGrid.render();
layout.beginUpdate();
layout.add('north', new YAHOO.ext.ContentPanel('north', 'Header'));
layout.add('south', new YAHOO.ext.ContentPanel('south', {title: 'South', closable: true}));
layout.add('west', new YAHOO.ext.ContentPanel('west', {title: 'West'}));
layout.add('east', new YAHOO.ext.GridPanel(propsGrid, {title: 'Properties', closable: true}));
layout.add('east', new YAHOO.ext.ContentPanel('autoTabs', {title: 'Calendar', closable: true}));
layout.add('center', new YAHOO.ext.ContentPanel('center1', {title: 'Close Me', closable: true}));
layout.add('center', new YAHOO.ext.ContentPanel('centerdetail' {title: 'Details', closable: false}));
layout.add('center', new YAHOO.ext.ContentPanel('center2', {title: 'Center Panel', closable: false}));
layout.getRegion('center').showPanel('center1');
layout.getRegion('west').hide();
layout.endUpdate();
},

toggleWest : function(link){
var west = layout.getRegion('west');
if(west.isVisible()){
west.hide();
link.innerHTML = 'Show West Region';
}else{
west.show();
link.innerHTML = 'Hide West Region';
}
}
}

}();
YAHOO.ext.EventManager.onDocumentReady(Example.init, Example, true);
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
</div>
<div id ="container">
<div id="west" class="ylayout-inactive-content">
<div id="Div2" class="ylayout-inactive-content">
WEST MENU
</div>
</div>
<div id="north" class="ylayout-inactive-content">
images\bannerback.jpg
<div class="bannerBox" style="text-align: left">images/wcld.gif</div>
<div class="bannerLogo">images/logo.gif</div>
<div class="bannerStrap" style="text-align: left">Leaders in all round pumping solutions for global industry</div>
<div class="logoutLink" style="left: 927px; width: 37px; top: 123px; height: 16px">
<span style="font-size: 0.7em; color: #ffffff">
<asp:LoginStatus ID="LoginStatus1" runat="server" Font-Size="Larger" Height="13px"
LogoutAction="Redirect" LogoutPageUrl="~/Default.aspx" Width="38px" />
</span></div>
</div>
<div id="autoTabs" class="ylayout-inactive-content">
<asp:Calendar ID="Calendar1" runat="server" BackColor="White" BorderColor="#999999"
CellPadding="4" DayNameFormat="Shortest" Font-Names="Verdana" Font-Size="8pt"
ForeColor="Black" Height="180px" Width="180px">
<SelectedDayStyle BackColor="#666666" Font-Bold="True" ForeColor="White" />
<TodayDayStyle BackColor="#CCCCCC" ForeColor="Black" />
<SelectorStyle BackColor="#CCCCCC" />
<WeekendDayStyle BackColor="#FFFFCC" />
<OtherMonthDayStyle ForeColor="#808080" />
<NextPrevStyle VerticalAlign="Bottom" />
<DayHeaderStyle BackColor="#CCCCCC" Font-Bold="True" Font-Size="7pt" />
<TitleStyle BackColor="#999999" BorderColor="Black" Font-Bold="True" />
</asp:Calendar>


<input type="button" id="show-dialog-btn" value="Show Dialog" />



<div id="hello-dlg" style="visibility:hidden;">
<div class="ydlg-hd">Layout Dialog</div>
<div class="ydlg-bd">
<div id="Div1" class="ylayout-inactive-content">
blah
</div>
<div id="center" class="ylayout-inactive-content">

<input type="button" id="theme-btn" value="Toggle Theme" />
</div>
</div>
</div>
</div>
<div id="center2" class="ylayout-inactive-content">


Show West Region (#)</p>


My closable attribute is set to false so you can't close me. The other center panels can be closed.</p>


The center panel automatically grows to fit the remaining space in the container that isn't taken up by the border regions.</p>


Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Sed metus nibh, sodales a, porta at, vulputate eget, dui. Pellentesque ut nisl. Maecenas tortor turpis, interdum non, sodales non, iaculis ac, lacus. Vestibulum auctor, tortor quis iaculis malesuada, libero lectus bibendum purus, sit amet tincidunt quam turpis vel lacus. In pellentesque nisl non sem. Suspendisse nunc sem, pretium eget, cursus a, fringilla vel, urna. Aliquam commodo ullamcorper erat. Nullam vel justo in neque porttitor laoreet. Aenean lacus dui, consequat eu, adipiscing eget, nonummy non, nisi. Morbi nunc est, dignissim non, ornare sed, luctus eu, massa. Vivamus eget quam. Vivamus tincidunt diam nec urna. Curabitur velit. Quisque dolor magna, ornare sed, elementum porta, luctus in, leo.</p>


Donec quis dui. Sed imperdiet. Nunc consequat, est eu sollicitudin gravida, mauris ligula lacinia mauris, eu porta dui nisl in velit. Nam congue, odio id auctor nonummy, augue lectus euismod nunc, in tristique turpis dolor sed urna. Donec sit amet quam eget diam fermentum pharetra. Integer tincidunt arcu ut purus. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nulla blandit malesuada odio. Nam augue. Aenean molestie sapien in mi. Suspendisse tincidunt. Pellentesque tempus dui vitae sapien. Donec aliquam ipsum sit amet pede. Sed scelerisque mi a erat. Curabitur rutrum ullamcorper risus. Maecenas et lorem ut felis dictum viverra. Fusce sem. Donec pharetra nibh sit amet sapien.</p>


Aenean ut orci sed ligula consectetuer pretium. Aliquam odio. Nam pellentesque enim. Nam tincidunt condimentum nisi. Maecenas convallis luctus ligula. Donec accumsan ornare risus. Vestibulum id magna a nunc posuere laoreet. Integer iaculis leo vitae nibh. Nam vulputate, mauris vitae luctus pharetra, pede neque bibendum tellus, facilisis commodo diam nisi eget lacus. Duis consectetuer pulvinar nisi. Cras interdum ultricies sem. Nullam tristique. Suspendisse elementum purus eu nisl. Nulla facilisi. Phasellus ultricies ullamcorper lorem. Sed euismod ante vitae lacus. Nam nunc leo, congue vehicula, luctus ac, tempus non, ante. Morbi suscipit purus a nulla. Sed eu diam.</p>


Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Cras imperdiet felis id velit. Ut non quam at sem dictum ullamcorper. Vestibulum pharetra purus sed pede. Aliquam ultrices, nunc in varius mattis, felis justo pretium magna, eget laoreet justo eros id eros. Aliquam elementum diam fringilla nulla. Praesent laoreet sapien vel metus. Cras tempus, sapien condimentum dictum dapibus, lorem augue fringilla orci, ut tincidunt eros nisi eget turpis. Nullam nunc nunc, eleifend et, dictum et, pharetra a, neque. Ut feugiat. Aliquam erat volutpat. Donec pretium odio nec felis. Phasellus sagittis lacus eget sapien. Donec est. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae;</p>


Vestibulum semper. Nullam non odio. Aliquam quam. Mauris eu lectus non nunc auctor ullamcorper. Sed tincidunt molestie enim. Phasellus lobortis justo sit amet quam. Duis nulla erat, varius a, cursus in, tempor sollicitudin, mauris. Aliquam mi velit, consectetuer mattis, consequat tristique, pulvinar ac, nisl. Aliquam mattis vehicula elit. Proin quis leo sed tellus scelerisque molestie. Quisque luctus. Integer mattis. Donec id augue sed leo aliquam egestas. Quisque in sem. Donec dictum enim in dolor. Praesent non erat. Nulla ultrices vestibulum quam.</p>


Duis hendrerit, est vel lobortis sagittis, tortor erat scelerisque tortor, sed pellentesque sem enim id metus. Maecenas at pede. Nulla velit libero, dictum at, mattis quis, sagittis vel, ante. Phasellus faucibus rutrum dui. Cras mauris elit, bibendum at, feugiat non, porta id, neque. Nulla et felis nec odio mollis vehicula. Donec elementum tincidunt mauris. Duis vel dui. Fusce iaculis enim ac nulla. In risus.</p>


Donec gravida. Donec et enim. Morbi sollicitudin, lacus a facilisis pulvinar, odio turpis dapibus elit, in tincidunt turpis felis nec libero. Nam vestibulum tempus ipsum. In hac habitasse platea dictumst. Nulla facilisi. Donec semper ligula. Donec commodo tortor in quam. Etiam massa. Ut tempus ligula eget tellus. Curabitur id velit ut velit varius commodo. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Nulla facilisi. Fusce ornare pellentesque libero. Nunc rhoncus. Suspendisse potenti. Ut consequat, leo eu accumsan vehicula, justo sem lobortis elit, ac sollicitudin ipsum neque nec ante.</p>


Aliquam elementum mauris id sem. Vivamus varius, est ut nonummy consectetuer, nulla quam bibendum velit, ac gravida nisi felis sit amet urna. Aliquam nec risus. Maecenas lacinia purus ut velit. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Suspendisse sit amet dui vitae lacus fermentum sodales. Donec varius dapibus nisl. Praesent at velit id risus convallis bibendum. Aliquam felis nibh, rutrum nec, blandit non, mattis sit amet, magna. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Etiam varius dignissim nibh. Quisque id orci ac ante hendrerit molestie. Aliquam malesuada enim non neque.</p>
</div>
<div id="centerdetail" class="ylayout-inactive-content">


test</p>
</div>
<div id="center1" class="ylayout-inactive-content">
<asp:GridView ID="GridView1" runat="server" AllowSorting="True" AutoGenerateColumns="False"
CellPadding="4" DataSourceID="NCSystem" ForeColor="#333333" GridLines="None"
Height="137px" Width="100%">
<FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
<Columns>
<asp:BoundField DataField="DateIssued" HeaderText="Date" ReadOnly="True" SortExpression="DateIssued" />
<asp:BoundField DataField="NCRNum" HeaderText="NCR Num" ReadOnly="True" SortExpression="NCRNum" />
<asp:BoundField DataField="ReworkNum" HeaderText="Rework Num" ReadOnly="True" SortExpression="ReworkNum" />
<asp:BoundField DataField="JobNum" HeaderText="Job Num" ReadOnly="True" SortExpression="JobNum" />
<asp:BoundField DataField="ItemNum" HeaderText="Item Num" ReadOnly="True" SortExpression="ItemNum" />
<asp:BoundField DataField="CompCodeDesc" HeaderText="Description" ReadOnly="True"
SortExpression="CompCodeDesc" />
<asp:BoundField DataField="_8" HeaderText="Status" ReadOnly="True" SortExpression="_8" />
<asp:BoundField DataField="_13" HeaderText="Owner" ReadOnly="True" SortExpression="_13" />
</Columns>
<RowStyle BackColor="#F7F6F3" Font-Size="Smaller" ForeColor="#333333" VerticalAlign="Middle" />
<EditRowStyle BackColor="#999999" Font-Size="Smaller" />
<SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
<PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
<HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
<AlternatingRowStyle BackColor="White" Font-Size="Smaller" ForeColor="#284775" />
</asp:GridView>


<asp:SqlDataSource ID="NCSystem" runat="server" ConnectionString="<%$ ConnectionStrings:NCDevCopy %>"
ProviderName="<%$ ConnectionStrings:NCDevCopy.ProviderName %>" SelectCommand='SELECT "2__NCR_1_Open".* FROM "2__NCR_1_Open"'>
</asp:SqlDataSource>
</div>
<div id="props-panel" class="ylayout-inactive-content" style="width:200px;height:200px;overflow:hidden;">
</div>
<div id="south" class="ylayout-inactive-content">
Hello <asp:LoginName ID="LoginName1" runat="server" />
</div>
</div>
</form>
</body>
</html>


Anyone have any ideas?

Thanks

Jamie

Animal
14 Feb 2007, 5:47 AM
What is not working?

mnugter
14 Feb 2007, 6:12 AM
Try adding the following function to your Example class:



addTab: function(header, content)
{
var el = YAHOO.ext.DomHelper.append(document.body, {tag:'div', id:header, html:content);
layout.add('west', new YAHOO.ext.ContentPanel(el, {title:header, closable: true}));
}