Search Results

Search found 1178 results on 48 pages for 'w3c'.

Page 38/48 | < Previous Page | 34 35 36 37 38 39 40 41 42 43 44 45  | Next Page >

  • Applying a Dojo Toolkit (Dijit) theme to ASP.NET pages.

    - by mcoolbeth
    In the code below, I am trying to apply a Dijit theme to the controls in my .aspx page. However, the controls persist in their normal, unthemed appearance. Anybody know why? Master Page: <%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Main.master.cs" Inherits="WebJournalEntryClient.Main" %> <!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"> <title>My Web Application</title> <link rel="stylesheet" href="dojoroot/dijit/themes/tundra/tundra.css" /> <script type="text/javascript" src="dojoroot/dojo/dojo.js"/> <script type="text/javascript"> dojo.require("dijit.form.Button"); dojo.require("dijit.form.TextBox"); dojo.require("dijit.form.ComboBox"); </script> </head> <body class = "tundra"> <form id="form1" runat="server"> <div> <div> This is potentially space for a header bar. </div> <table> <tr> <td> Maybe <br /> a <br /> Side <br /> bar. </td> <td> <asp:ContentPlaceHolder ID="CenterPlaceHolder" runat="server"/> </td> </tr> </table> <div> This is potentially space for a footer bar. </div> </div> </form> </body> </html> Content Page: <%@ Page Title="" Language="C#" MasterPageFile="~/Main.Master" AutoEventWireup="true" CodeBehind="LogIn.aspx.cs" Inherits="WebJournalEntryClient.LogIn" %> <asp:Content ID="Content" ContentPlaceHolderID="CenterPlaceHolder" runat="server"> <div> User ID: <asp:TextBox ID = "UserName" dojoType="dijit.form.TextBox" runat="server" /><br /> Password: <asp:TextBox ID = "PassWord" dojoType="dijit.form.TextBox" runat="server" /><br /> <asp:Button ID="LogInButton" Text="Log In" dojoType="dijit.form.Button" runat="server" /> </div> </asp:Content>

    Read the article

  • java-eclipse-jsf -404 error

    - by ognistysztorm
    I am trying to create my first project in JSF (Eclipse Juno). I have only one jsp file witch contain: <?xml version="1.0" encoding="ISO-8859-1" ?> <!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" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:ui="http://java.sun.com/jsf/facelets"> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /> <title>Insert title here</title> </head> <body> <f:view> <ui:component>Hello World</ui:component> </f:view> </body> </html> ...but when I try run it on server I receiving 404 error. I add jsf.jar and jstl.jar to my bulid path. this is web.xml: <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" version="3.0"> <display-name>inwert</display-name> <servlet> <servlet-name>Faces Servlet</servlet-name> <servlet-class>javax.faces.webapp.FacesServlet</servlet-class> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>Faces Servlet</servlet-name> <url-pattern>/faces/*</url-pattern> </servlet-mapping> <context-param> <description>State saving method: 'client' or 'server' (=default). See JSF Specification 2.5.2</description> <param-name>javax.faces.STATE_SAVING_METHOD</param-name> <param-value>client</param-value> </context-param> <context-param> <param-name>javax.servlet.jsp.jstl.fmt.localizationContext</param-name> <param-value>resources.application</param-value> </context-param> <listener> <listener-class>com.sun.faces.config.ConfigureListener</listener-class> </listener> </web-app> After 3 Hours I give up :( Could anyone help me?

    Read the article

  • Cross Browser Issue

    - by dazedandconfused
    My background is in WinForms programming and I'm trying to branch out a bit. I'm finding cross-browser issues a frustrating barrier in general, but have a specific one that I just can't seem to work through. I want to display an image and place a semi-transparent bar across the top and bottom. This isn't my ultimate goal, of course, but it demonstrates the problem I'm having ina a relatively short code fragment so let's go with it. The sample code below displays as intended in Chrome, Safari, and Firefox. In IE8, the bar at the bottom doesn't appear at all. I've researched it for hours but just can't seem to come up with the solution. I'm sure this is some dumb rookie mistake, but gotta start somewhere. Code snippet... <!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> <title></title> <script type="text/javascript" language="javascript"> </script> <style type="text/css"> .workarea { position: relative; border: 1px solid black; background-color: #ccc; overflow: hidden; cursor: move; -moz-user-focus: normal; -moz-user-select: none; unselectable: on; } .semitransparent { filter: alpha(opacity=70); -moz-opacity: 0.7; -khtml-opacity: 0.7; opacity: 0.7; background-color: Gray; } </style> </head> <body style="width: 800px; height: 600px;"> <div id="workArea" class="workarea" style="width: 800px; height: 350px; left: 100px; top: 50px; background-color: White; border: 1px solid black;"> <img alt="" src="images/TestImage.jpg" style="left: 0px; top: 0px; border: none; z-index: 1;" /> <div id="topBar" class="semitransparent" style="position: absolute;width: 800px; height: 75px; left: 0px; top: 0px; min-height: 75px; border: none; z-index: 2;" /> <div id="bottomBar" class="semitransparent" style="position: absolute; width: 800px; height: 75px; left: 0px; top: 275px; min-height: 75px; border: none; z-index: 2;" /> </div> </body> </html>

    Read the article

  • ASP.NET MVC 2 from Scratch &ndash; Part 1 Listing Data from Database

    - by Max
    Part 1 - Listing Data from Database: Let us now learn ASP.NET MVC 2 from Scratch by actually developing a front end website for the Chinook database, which is an alternative to the traditional Northwind database. You can get the Chinook database from here. As always the best way to learn something is by working on it and doing something. The Chinook database has the following schema, a quick look will help us implementing the application in a efficient way. Let us first implement a grid view table with the list of Employees with some details, this table also has the Details, Edit and Delete buttons on it to do some operations. This is series of post will concentrate on creating a simple CRUD front end for Chinook DB using ASP.NET MVC 2. In this post, we will look at listing all the possible Employees in the database in a tabular format, from which, we can then edit and delete them as required. In this post, we will concentrate on setting up our environment and then just designing a page to show a tabular information from the database. We need to first setup the SQL Server database, you can download the required version and then set it up in your localhost. Then we need to add the LINQ to SQL Classes required for us to enable interaction with our database. Now after you do the above step, just use your Server Explorer in VS 2010 to actually navigate to the database, expand the tables node and then drag drop all the tables onto the Object Relational Designer space and you go you will have the tables visualized as classes. As simple as that. Now for the purpose of displaying the data from Employee in a table, we will show only the EmployeeID, Firstname and lastname. So let us create a class to hold this information. So let us add a new class called EmployeeList to the ViewModels. We will send this data model to the View and this can be displayed in the page. public class EmployeeList { public int EmployeeID { get; set; } public string Firstname { get; set; } public string Lastname { get; set; } public EmployeeList(int empID, string fname, string lname) { this.EmployeeID = empID; this.Firstname = fname; this.Lastname = lname; } } Ok now we have got the backend ready. Let us now look at the front end view now. We will first create a master called Site.Master and reuse it across the site. The Site.Master content will be <%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Site.Master.cs" Inherits="ChinookMvcSample.Views.Shared.Site" %>   <!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></title> <style type="text/css"> html { background-color: gray; } .content { width: 880px; position: relative; background-color: #ffffff; min-width: 880px; min-height: 800px; float: inherit; text-align: justify; } </style> <script src="../../Scripts/jquery-1.4.1.min.js" type="text/javascript"></script> <asp:ContentPlaceHolder ID="head" runat="server"> </asp:ContentPlaceHolder> </head> <body> <center> <h1> My Website</h1> <div class="content"> <asp:ContentPlaceHolder ID="body" runat="server"> </asp:ContentPlaceHolder> </div> </center> </body> </html> The backend Site.Master.cs does not contain anything. In the actual Index.aspx view, we add the code to simply iterate through the collection of EmployeeList that was sent to the View via the Controller. So in the top of the Index.aspx view, we have this inherits which says Inherits="System.Web.Mvc.ViewPage<IEnumerable<ChinookMvcSample.ViewModels.EmployeeList>>" In this above line, we dictate that the page is consuming a IEnumerable collection of EmployeeList. So once we specify this and compile the project. Then in our Index.aspx page, we can consume the EmployeeList object and access all its methods and properties. <table class="styled" cellpadding="3" border="0" cellspacing="0"> <tr> <th colspan="3"> </th> <th> First Name </th> <th> Last Name </th> </tr> <% foreach (var item in Model) { %> <tr> <td align="center"> <%: Html.ActionLink("Edit", "Edit", new { id = item.EmployeeID }, new { id = "links" })%> </td> <td align="center"> <%: Html.ActionLink("Details", "Details", new { id = item.EmployeeID }, new { id = "links" })%> </td> <td align="center"> <%: Html.ActionLink("Delete", "Delete", new { id = item.EmployeeID }, new { id = "links" })%> </td> <td> <%: item.Firstname %> </td> <td> <%: item.Lastname %> </td> </tr> <% } %> <tr> <td colspan="5"> <%: Html.ActionLink("Create New", "Create") %> </td> </tr> </table> The Html.ActionLink is a Html Helper to a create a hyperlink in the page, in the one we have used, the first parameter is the text that is to be used for the hyperlink, second one is the action name, third one is the parameter to be passed, last one is the attributes to be added while the hyperlink is rendered in the page. Here we are adding the id=”links” to the hyperlinks that is created in the page. In the index.aspx page, we add some jQuery stuff add alternate row colours and highlight colours for rows on mouse over. Now the Controller that handles the requests and directs the request to the right view. For the index view, the controller would be public ActionResult Index() { //var Employees = from e in data.Employees select new EmployeeList(e.EmployeeId,e.FirstName,e.LastName); //return View(Employees.ToList()); return View(_data.Employees.Select(p => new EmployeeList(p.EmployeeId, p.FirstName, p.LastName))); } Let us also write a unit test using NUnit for the above, just testing EmployeeController’s Index. DataClasses1DataContext _data; public EmployeeControllerTest() { _data = new DataClasses1DataContext("Data Source=(local);Initial Catalog=Chinook;Integrated Security=True"); }   [Test] public void TestEmployeeIndex() { var e = new EmployeeController(_data); var result = e.Index() as ViewResult; var employeeList = result.ViewData.Model; Assert.IsNotNull(employeeList, "Result is null."); } In the first EmployeeControllerTest constructor, we set the data context to be used while running the tests. And then in the actual test, We just ensure that the View results returned by Index is not null. Here is the zip of the entire solution files until this point. Let me know if you have any doubts or clarifications. Cheers! Have a nice day.

    Read the article

  • jQuery::Scrollable Div does not work

    - by Legend
    I am trying to create a scrollable DIV using the following: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html> <head> <title>Test</title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> <script type="text/javascript" src="lib/jquery/jquery-1.3.2.js"></script> <style type="text/css"> div.container { overflow:hidden; width:200px; height:200px; } div.content { position:relative; top:0; } </style> <script type="text/javascript"> $(function(){ $(".container a.up").bind("click", function(){ var topVal = $(this).parents(".container").find(".content").css("top"); $(this).parents(".container").find(".content").css("top", topVal-10); }); $(".container a.dn").bind("click", function(){ var topVal = $(this).parents(".container").find(".content").css("top"); $(this).parents(".container").find(".content").css("top", topVal+10); }); }); </script> </head> <body> <div class="container"> <p> <a href="#" class="up">Up</a> / <a href="#" class="dn">Down</a> </p> <div class="content"> <p>Hello World 1</p> <p>Hello World 2</p> <p>Hello World 3</p> <p>Hello World 4</p> <p>Hello World 5</p> <p>Hello World 6</p> <p>Hello World 7</p> <p>Hello World 8</p> <p>Hello World 9</p> <p>Hello World 10</p> <p>Hello World 10</p> <p>Hello World 11</p> <p>Hello World 12</p> <p>Hello World 13</p> <p>Hello World 14</p> <p>Hello World 15</p> <p>Hello World 16</p> <p>Hello World 17</p> <p>Hello World 18</p> <p>Hello World 19</p> <p>Hello World 20</p> <p>Hello World 21</p> <p>Hello World 22</p> <p>Hello World 23</p> <p>Hello World 24</p> <p>Hello World 25</p> <p>Hello World 26</p> <p>Hello World 27</p> </div> </div> </body> </html> I don't know where I am messing up, but it simply refuses to work. Any suggestions?

    Read the article

  • Problems with show hide jquery

    - by Michael
    I am trying to get show hide to work on multiple objects but I am unable to get it to work. Any help would be nice an much appreciated... I am lost on how to do this. If I only do one show hide it works fine but more than one it does not work properly. <!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> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Show Hide Sample</title> <script src="js/jquery.js" type="text/javascript"></script> <script type="text/javascript"> $(document).ready(function(){ $('#content1').hide(); $('a').click(function(){ $('#content1').show('slow'); }); $('a#close').click(function(){ $('#content1').hide('slow'); }) }); </script> <style> body{font-size:12px; font-family:"Trebuchet MS"; background: #CCF} #content1{ border:1px solid #DDDDDD; padding:10px; margin-top:5px; width:300px; } </style> </head> <body> <a href="#" id="click">Test 1</a> <div class="box"> <div id="content1"> <h1 align="center">Hide 1</h1> <P> Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nullam pulvinar, enim ac hendrerit mattis, lorem mauris vestibulum tellus, nec porttitor diam nunc tempor dui. Aenean orci. Sed tempor diam eget tortor. Maecenas quis lorem. Nullam semper. Fusce adipiscing tellus non enim volutpat malesuada. Cras urna. Vivamus massa metus, tempus et, fermentum et, aliquet accumsan, lectus. Maecenas iaculis elit eget ipsum cursus lacinia. Mauris pulvinar.</p> <p><a href="#" id="close">Close</a></p> </div> </div> <a href="#" id="click">Test 2</a> <div class="box"> <div id="content1"> <h1 align="center">Hide 2</h1> <p> Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nullam pulvinar, enim ac hendrerit mattis, lorem mauris vestibulum tellus, nec porttitor diam nunc tempor dui. Aenean orci. Sed tempor diam eget tortor. Maecenas quis lorem. Nullam semper. Fusce adipiscing tellus non enim volutpat malesuada. Cras urna. Vivamus massa metus, tempus et, fermentum et, aliquet accumsan, lectus. Maecenas iaculis elit eget ipsum cursus lacinia. Mauris pulvinar.</p> <p><a href="#" id="close">Close</a></p> </div> </div> </body> </html>

    Read the article

  • Why do jQuery fadeIn() and fadeOut() seem quirky in this example?

    - by Ben McCormack
    I've been playing with jQuery in an ASP.NET project and am finding some odd behavior with the .fadeIn() and fadeOut() functions. In the below example, a click on the button (ID Button1) is supposed to cause both the span of text with ID Label1 and the the button with the ID TextBox1 to do the following things: Fade Out Change the text of both the text box and the span of text to be You clicked the button Fade In Based on the browser I'm using, I get 3 different scenarios, and each element functions differently in each situation. Here's what happens when I actually click the button: TextBox1: In IE8, the text box fades out, changes text, then fades back in In IE8 Compatibility View, the text box fades out, changes text, then fades back in. However, the text in the box looks a little different than before the button was clicked. In FireFox 3.5.8, the text box doesn't fade out (but it does "pause" for the amount of time the fade would take), does change the text, then seems to "pause" again where it would be fading in. Label1: In IE8, the label doesn't fade out (but it does "pause" for the amount of time the fade would take), does change the text, then seems to "pause" again where it would be fading in. In IE8 Compatibility View, the label does fade out, change text, and fades back in, but the text looks a little different than before the button was clicked. In FireFox 3.5.8, the label doesn't fade out (but it does "pause" for the amount of time the fade would take), does change the text, then seems to "pause" again where it would be fading in. Two questions: What's going in to make each element to behave differently in different browsers? Is there a better way to get the functionality I'm looking for across multiple platforms? Here's the source code of the file: <!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><title> </title> <script src="http://ajax.microsoft.com/ajax/jQuery/jquery-1.4.1-vsdoc.js" type="text/javascript"></script> <script type="text/javascript"> $(document).ready(function() { $("#Button1").click(function(event) { $("#Label1").fadeOut("slow", function() { $(this).text("You clicked the button"); $(this).fadeIn("slow"); }); $("#TextBox1").fadeOut("slow", function() { $(this).val("You clicked the button").fadeIn("slow"); $(this).fadeIn("slow"); }); event.preventDefault(); }); $("a").click(function(event) { $("#Label1").text("You clicked the link"); $("#TextBox1").val("You clicked the link"); event.preventDefault(); }); }); </script> </head> <body> <form name="form1" method="post" action="Default.aspx" id="form1"> <div> <input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUJNTQwMjM5ODcyZGT6OfedWuFhLrSUyp+gwkCEueddvg==" /> </div> <div> <input type="hidden" name="__EVENTVALIDATION" id="__EVENTVALIDATION" value="/wEWAwK56uWtBwLs0bLrBgKM54rGBotkyyA5RRsPBGNaPTPCe7F5ARwv" /> </div> <div> <span id="Label1" style="color:#009900;">Type Something Here:</span> &nbsp; <a href="http://www.google.com">This is a test Link</a> <input name="TextBox1" type="text" value="test" id="TextBox1" style="width:258px;" /> <br /> <br /> <input type="submit" name="Button1" value="Button" id="Button1" /> </div> </form> </body> </html>

    Read the article

  • How do I effectively fake a div's background color using an image in the body element?

    - by janoChen
    I want to get something like the following: The dark grey is the sidebar but I want to apply that color into the body element as an image which repeats itself vertically but at the same time doesn't cover the footer (light gray). (this is the easiest way I found to stretch the color (dark gray) until the bottom.) Part of my CSS: body { color: #888; font-family: Arial, "MS Trebuchet", sans-serif; font-size: 75% } .container { margin: 0 auto; overflow: hidden; padding: 0 15px; width: 960px; } /* header */ #header { background: #444; } /* banner */ #header-top { overflow: hidden; height: 77px; width: 960px; /* ie6 hack */ } #lang { float: right; padding: 50px 0 0 0; } /* work */ #content { background: #EEE; } #content a { border-bottom: 0; } #mainbar { overflow: hidden; margin: 0 10px 0 0; width: 644; float: left; } #sidebar { background: #DDD; color: #777; overflow: hidden; margin: 20px 0 10px 0; padding: 15px; width: 240px; float: right; } #sidebar h3 { color: #888; } #about { margin: 0 0 20px; } /* footer */ #footer { color: #777; background: #DDD; clear: both; } /* contact */ #footer-top { line-height: 160%; overflow: hidden; padding: 30px 0; width: 960px; /* ie6 hack */ } #footer-bottom { font-size: 10px; margin: 15px auto; } Part of my HTML: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7"/> <title>Alex Chen - Web Development, Graphic Design, and Translation</title> <link rel="stylesheet" type="text/css" href="styles/global.css" /> </head> <body id="home"> <div id="header"> <div class="container"> <div id="header-top"> </div> </div><!-- .container --> </div><!-- #header --> <div id="content"> <div class="container"> <div id="mainbar"> </div> <!-- #mainbar--> <div id=sidebar> </div> <!-- #sidebar --> </div><!-- .container --> </div><!-- #content --> <div id="footer"> <div class="container"> <div id="footer-top"> </div><!-- #footer-top --> <div id="footer-bottom"> </div> </div><!-- .container --> </div><!-- #footer --> </body> </html>

    Read the article

  • Trouble Percent-Encoding Spaces in Java

    - by behrk2
    Hi Everyone, I am using the URLUTF8Encoder.java class from W3C (www.w3.org/International/URLUTF8Encoder.java). Currently, it will encode any blank spaces ' ' into plus signs '+'. I am having difficulty modifying the code to percent-encode the blank space into '%20'. Unfortunately, I am not too familiar with hex. Can anyone help me out? I need to modify this snippet... else if (ch == ' ') { // space sbuf.append('+'); in the following code: final static String[] hex = { "%00", "%01", "%02", "%03", "%04", "%05", "%06", "%07", "%08", "%09", "%0A", "%0B", "%0C", "%0D", "%0E", "%0F", "%10", "%11", "%12", "%13", "%14", "%15", "%16", "%17", "%18", "%19", "%1A", "%1B", "%1C", "%1D", "%1E", "%1F", "%20", "%21", "%22", "%23", "%24", "%25", "%26", "%27", "%28", "%29", "%2A", "%2B", "%2C", "%2D", "%2E", "%2F", "%30", "%31", "%32", "%33", "%34", "%35", "%36", "%37", "%38", "%39", "%3A", "%3B", "%3C", "%3D", "%3E", "%3F", "%40", "%41", "%42", "%43", "%44", "%45", "%46", "%47", "%48", "%49", "%4A", "%4B", "%4C", "%4D", "%4E", "%4F", "%50", "%51", "%52", "%53", "%54", "%55", "%56", "%57", "%58", "%59", "%5A", "%5B", "%5C", "%5D", "%5E", "%5F", "%60", "%61", "%62", "%63", "%64", "%65", "%66", "%67", "%68", "%69", "%6A", "%6B", "%6C", "%6D", "%6E", "%6F", "%70", "%71", "%72", "%73", "%74", "%75", "%76", "%77", "%78", "%79", "%7A", "%7B", "%7C", "%7D", "%7E", "%7F", "%80", "%81", "%82", "%83", "%84", "%85", "%86", "%87", "%88", "%89", "%8A", "%8B", "%8C", "%8D", "%8E", "%8F", "%90", "%91", "%92", "%93", "%94", "%95", "%96", "%97", "%98", "%99", "%9A", "%9B", "%9C", "%9D", "%9E", "%9F", "%A0", "%A1", "%A2", "%A3", "%A4", "%A5", "%A6", "%A7", "%A8", "%A9", "%AA", "%AB", "%AC", "%AD", "%AE", "%AF", "%B0", "%B1", "%B2", "%B3", "%B4", "%B5", "%B6", "%B7", "%B8", "%B9", "%BA", "%BB", "%BC", "%BD", "%BE", "%BF", "%C0", "%C1", "%C2", "%C3", "%C4", "%C5", "%C6", "%C7", "%C8", "%C9", "%CA", "%CB", "%CC", "%CD", "%CE", "%CF", "%D0", "%D1", "%D2", "%D3", "%D4", "%D5", "%D6", "%D7", "%D8", "%D9", "%DA", "%DB", "%DC", "%DD", "%DE", "%DF", "%E0", "%E1", "%E2", "%E3", "%E4", "%E5", "%E6", "%E7", "%E8", "%E9", "%EA", "%EB", "%EC", "%ED", "%EE", "%EF", "%F0", "%F1", "%F2", "%F3", "%F4", "%F5", "%F6", "%F7", "%F8", "%F9", "%FA", "%FB", "%FC", "%FD", "%FE", "%FF" }; public static String encode(String s) { StringBuffer sbuf = new StringBuffer(); int len = s.length(); for (int i = 0; i < len; i++) { int ch = s.charAt(i); if ('A' <= ch && ch <= 'Z') { // 'A'..'Z' sbuf.append((char) ch); } else if ('a' <= ch && ch <= 'z') { // 'a'..'z' sbuf.append((char) ch); } else if ('0' <= ch && ch <= '9') { // '0'..'9' sbuf.append((char) ch); } else if (ch == ' ') { // space sbuf.append('+'); } else if (ch == '-' || ch == '_' // unreserved || ch == '.' || ch == '!' || ch == '~' || ch == '*' || ch == '\'' || ch == '(' || ch == ')') { sbuf.append((char) ch); } else if (ch <= 0x007f) { // other ASCII sbuf.append(hex[ch]); } else if (ch <= 0x07FF) { // non-ASCII <= 0x7FF sbuf.append(hex[0xc0 | (ch >> 6)]); sbuf.append(hex[0x80 | (ch & 0x3F)]); } else { // 0x7FF < ch <= 0xFFFF sbuf.append(hex[0xe0 | (ch >> 12)]); sbuf.append(hex[0x80 | ((ch >> 6) & 0x3F)]); sbuf.append(hex[0x80 | (ch & 0x3F)]); } } return sbuf.toString(); } Thanks!

    Read the article

  • Problem saving as png a SVG generated by Raphael JS in a canvas

    - by ClemDesm
    Hi fellow SOers, I'm trying to convert a SVG generated by Raphael JS (and the user, since you can drag and rotate the images). I followed this Conversion of SVG to Jpeg but still can't get it. It must be easy but I can't put my finger on what I get wrong. I got my svg in a div with #ec as id and the canvas's one is #canvas. function saveDaPicture(){ var img = document.getElementById('canvas').toDataURL("image/png"); $('body').append('<img src="'+img+'"/>'); } $('#save').click(function(){ var svg = $('#ec').html(); alert(svg); canvg('canvas', svg, {renderCallback: saveDaPicture(), ignoreMouse: true, ignoreAnimation: true}); }); The alert gives me : <svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="600" height="512"> <desc>Created with Raphael</desc> <defs></defs> <image x="0" y="0" width="300" height="512" preserveAspectRatio="none" href="imageurl.jpg"></image> <rect x="168" y="275" width="52" height="70" r="0" rx="0" ry="0" fill="none" stroke="#000" stroke-dasharray="8,3" transform="rotate(21.91207728 194 310)" style="opacity: 1; display: none; " opacity="1"></rect> <circle cx="50" cy="50" r="50" fill="none" stroke="#000"></circle> <image x="358" y="10" width="39" height="138" preserveAspectRatio="none" href="imageurl2.png" style="cursor: move; "></image> <image x="397" y="10" width="99" height="153" preserveAspectRatio="none" href="imageurl3.png" style="cursor: move; "></image> <image x="184" y="286" width="10" height="10" preserveAspectRatio="none" href="imageurl4.png" style="cursor: pointer; opacity: 1; display: none; " opacity="1"></image> <image x="204" y="286" width="10" height="10" preserveAspectRatio="none" href="imageurl5.png" style="cursor: pointer; opacity: 1; display: none; " opacity="1"></image> <image x="170" y="277" width="48" height="66" preserveAspectRatio="none" href="imageurl6.png" style="cursor: move; opacity: 1; " r="50" opacity="1" transform="rotate(21.91207728 194 310)"></image> </svg> which is the xml of the svg and if I believe canvg documentation, it's good. Anyway, with this code, the variable img, which should have the converted image data, got the data of an empty png with the dimensions of the svg. The only thing I guess is that the svg generated by Raphael JS is not well formated for canvg (like, href of image should be xlink:href if I follow the W3C recommandations ) Anyone got an idea on this problem ? :D

    Read the article

  • How to use metaWeblog.newPost (xmlrpc api) properly with PHP ?

    - by Sjne
    Update: solved this problem see answer I want to make new posts on my blog remotely with XMLRPC api and i m trying to use metaWeblog.newPost function, because it provides much features. I successfully added new posts into wordpress but i failed to post it in a defined category(categories) i tried lots of various things but failed at end now i m using code from this site http://www.samuelfolkes.com/2009/08/posting-to-wordpress-with-php-and-xml-rpc/ after stripping down the code for my needs here's what i got and its working fine remotepost.class.php <?php class remotePost { private $client; private $wpURL = 'http://localhost/wp/xmlrpc.php '; private $ixrPath = '/wp-includes/class-IXR.php'; private $uname = 'zxc'; private $pass = 'zxc'; public $postID; function __construct($content) { if(!is_array($content)) throw new Exception('Invalid Argument'); include $this->ixrPath; $this->client = new IXR_Client($this->wpURL); $this->postID = $this->postContent($content); } private function postContent($content) { $content['description'] = $content['description']; if(!$this->client->query('metaWeblog.newPost','',$this->uname,$this->pass,$content,true)) throw new Exception($this->client->getErrorMessage()); return $this->client->getResponse(); } } ?> post.php ( you can name it whatever you want ) <?php if(isset($_POST['submit'])) { include "remotepost.class.php"; $content['title'] = $_POST['title']; $content['categories'] = $_POST['category']; $content['description'] = $_POST['description']; try { $posted = new remotePost($content); $pid = $posted->postID; } catch(Exception $e) { echo $e->getMessage(); } } ?> <!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> <title>WordPress Poster</title> </head> <body> <?php if(isset($_POST['submit'])) echo "Posted! <a href=\"http://localhost/wp/?p=$pid\">View Post</a><br /><br />"; ?> <form enctype="multipart/form-data" method="post" action="#"> Title <input type="text" name="title" /> <br /> Category <input type="text" name="category" /> <br /> Description <input type="text" name="description" /> <br /> <input type="submit" value="Submit" name="submit" /> </form> </body> </html> dont know whats wrong in this code :( ,failing to post in right directory

    Read the article

  • IE / Facebook Issue : Why Facebook Like box not display in Internet Explorer 6 - IE8 ?

    - by Vaibhav Bhalke
    IE / Facebook Issue : Why Facebook Like box not display in Internet Explorer6 - IE8 ? Facebook like box display throgh my web application on every browser excluding IE-IE8 Now final Application.html file contains are < !DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/DTD/strict.dtd"><BR> < html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml"> <BR>< head> < meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" /> < /head><BR> < body> < script type="text/javascript" language="javascript" src="http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php"> < /script> <BR> < script type="text/javascript"> FB_RequireFeatures(["Connect"], function(){ var x=1; } ); < /script> <BR> < script src="http://static.ak.connect.facebook.com/connect.php/en_US" type="text/javascript"> < /script> < /body> < /html> My Java code for LIke Box is as follows FBPageFanWidget.java class FBPageFanWidget extends Composite { public FBPageFanWidget() { VerticalPanel mainPanel = new VerticalPanel(); mainPanel .getElement() .setInnerHTML( "< script type='text/javascript' src='http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php/en_US'>< /script>< script type='text/javascript'>FB.init('');< /script>< fb:fan profile_id=\"113106068709539\" stream=\"0\" connections=\"10\" logobar=\"0\" width=\"244\" height=\"240\" css='http://127.0.01:8080/webapplicationname/facebook.css?1'>< /fb:fan>"); initWidget(mainPanel); } } We used proper facebook API_KEY & PAGE_ID It's very important for us to Show Facebook like Box in Our web application Because we have more IE users. If we add FBPageFanWidget.java in our web applicaton then Our Home page is not display in IE because we add Facebook LikeBox so we made changes in Our FBPageFanWidget.java class FBPageFanWidget extends Composite { public FBPageFanWidget() { VerticalPanel mainPanel = new VerticalPanel(); if (!isIE()) { mainPanel.getElement() .setInnerHTML("<script type='text/javascript' src='http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php/en_US'></script><script type='text/javascript'>FB.init('');</script><fb:fan profile_id=\"113106068709539\" stream=\"0\" connections=\"10\" logobar=\"0\" width=\"244\" height=\"240\" css='http://127.0.01:8080/webapplicationname/facebook.css?1'></fb:fan>"); } initWidget(mainPanel); } public native String getUserAgent() /*-{ return navigator.userAgent; }-*/; private boolean isIE() { return (getUserAgent().indexOf("MSIE") > -1); } } when we did this changes Then Facebook Like Box display in every browser excluding IE6 - IE8 :( and also display Our Home page in IE8 excludeing Facebook Like Box. It means There is probelm in IE ? or what changes i need to do in my html file or java file to show facebook like Box properly with displaying our home page It's very important for us to Show Facebook like Box in Our web application Because we have more IE users. Please Reply ASAP. Hope-for Best Co-operation from your side !!!!

    Read the article

  • JSTL c:forEach causes @ViewScoped bean to invoke @PostConstruct on every request

    - by Nitesh Panchal
    Hello, Again i see that the @PostConstruct is firing every time even though no binding attribute is used. See this code :- <?xml version='1.0' encoding='UTF-8' ?> <!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" xmlns:h="http://java.sun.com/jsf/html" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:c="http://java.sun.com/jsp/jstl/core"> <h:head> <title>Facelet Title</title> </h:head> <h:body> <h:form> <c:forEach var="item" items="#{TestBean.listItems}"> <h:outputText value="#{item}"/> </c:forEach> <h:commandButton value="Click" actionListener="#{TestBean.actionListener}"/> </h:form> </h:body> </html> And this is the simplest possible bean in JSF :- package managedBeans; import java.io.Serializable; import java.util.ArrayList; import java.util.List; import javax.annotation.PostConstruct; import javax.faces.bean.ManagedBean; import javax.faces.bean.ViewScoped; @ManagedBean(name="TestBean") @ViewScoped public class TestBean implements Serializable { private List<String> listItems; public List<String> getListItems() { return listItems; } public void setListItems(List<String> listItems) { this.listItems = listItems; } public TestBean() { } @PostConstruct public void init(){ System.out.println("Post Construct fired!"); listItems = new ArrayList<String>(); listItems.add("Mango"); listItems.add("Apple"); listItems.add("Banana"); } public void actionListener(){ System.out.println("Action Listener fired!"); } } Do you see any behaviour that should cause postconstruct callback to fire each time? I think JSF 2.0 is highly unstable. If it has to fire PostConstruct each and every time what purpose does @ViewScoped serve. Why not to use @RequestScoped only? I thought i have made some mistake in my application. But when i created this simplest possible in JSF, i still get this error. Am i not understanding the scopes of JSF? or are they not testing it properly? Further, if you remove c:forEach and replace it with ui:repeat, then it works fine. Waiting for replies to confirm whether it is bug or it is intentional to stop the programmers from using jstl?

    Read the article

  • servlet does not envoke when I call a from method.

    - by saloni
    My web.xml is like <web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"> <display-name>sample</display-name> <servlet> <servlet-name>Sampleclass</servlet-name> <servlet-class>sample.SampleClass</servlet-class> </servlet> <servlet-mapping> <servlet-name>Sampleclass</servlet-name> <url-pattern>/SampleClass</url-pattern> </servlet-mapping> <welcome-file-list> <welcome-file>/page/form.jsp</welcome-file> </welcome-file-list> </web-app> and form.jsp <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>Insert title here</title> </head> <body> <h1>A simple web application</h1> <form method="POST" name="Sampleclass" action="SampleClass"> <label for="name">Enter your name </label> <input type="text" id="name" name="name"/><br><br> <input type="submit" value="Submit Form"/> <input type="reset" value="Reset Form"/> </form> </body> </html> and SampleClass.java is public class SampleClass extends HttpServlet { public void init(ServletConfig config) throws ServletException { super.init(config); } protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String name = request.getParameter("name"); String age = request.getParameter("age"); PrintWriter out = response.getWriter(); out.write("<html>Hello Your name is "+name +", and your age is "+age+"</html>"); } public void destroy() { } } but I am getting error when I entered to submit button of form.jsp and error is type Status report message HTTP method POST is not supported by this URL description The specified HTTP method is not allowed for the requested resource (HTTP method POST is not supported by this URL). I am not understanding that what is the problem exactly ? Please help..

    Read the article

  • Customize jquery ui progress bar

    - by P. Sohm
    I'd like to add some values under the jquery progress like My current code is : <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js"> </script> <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.23/jquery-ui.min.js"></script> <style type="text/css"> .ui-progressbar { height:2em; text-align: left; overflow: hidden; } .ui-progressbar .ui-progressbar-value {margin: -1px; height:100%; } .ui-widget { font-family: Trebuchet MS, Tahoma, Verdana, Arial, sans-serif; font-size: 1.1em; } .ui-widget .ui-widget { font-size: 1em; } .ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Trebuchet MS, Tahoma, Verdana, Arial, sans-serif; font-size: 1em; } .ui-widget-content { border: 1px solid #dddddd; background: #EDEFF1 50% top repeat-x; color: #333333; } .ui-widget-content a { color: #333333; } .ui-widget-header { border: 1px solid #e78f08; background: #AB3B3B 50% 50% repeat-x; color: #ffffff; font-weight: bold; } .ui-widget-header a { color: #ffffff; } .ui-corner-all, .ui-corner-top, .ui-corner-left, .ui-corner-tl { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; -khtml-border-top-left-radius: 4px; border-top-left-radius: 4px; } .ui-corner-all, .ui-corner-top, .ui-corner-right, .ui-corner-tr { -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; -khtml-border-top-right-radius: 4px; border-top-right-radius: 4px; } .ui-corner-all, .ui-corner-bottom, .ui-corner-left, .ui-corner-bl { -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; -khtml-border-bottom-left-radius: 4px; border-bottom-left-radius: 4px; } .ui-corner-all, .ui-corner-bottom, .ui-corner-right, .ui-corner-br { -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; -khtml-border-bottom-right-radius: 4px; border-bottom-right-radius: 4px; } #progressbar { float: right; margin-right: 100px; width: 120px; margin-top: -30px } #progress { position: relative} </style></head> <body> <script type="text/javascript"> $().ready(function() { $("#progressbar").progressbar({ value: 29 }); }); </script> <div id="progressbar"></div> </body></html> I didn't find how to have this result ... Another possibility would be to add some text at the right of the progress bar (I tryied with a but it comes in the line after)

    Read the article

  • Simple PHP upload form not working

    - by Lea
    Hi all, I seem to run into so many issues when dealing with writing to directories. If someone could please look over this script, and tell me why it's not working, I'd be so appreciative. Upon uploading the file from the form, I don't get anything.. It doesnt output any errors, it simply just refreshes. Thanks, Lea <?php include ('config.php'); if( isset($_POST['submit']) ) { $target = ''.$_SERVER['DOCUMENT_ROOT'].'/images/'; $target = $target . basename( $_FILES['photo']['name']) ; $url = basename( $_FILES['photo']['name']) ; if(move_uploaded_file($_FILES['photo']['tmp_name'], $target)) { $moved = "File has been moved to location $target"; $name = mysql_real_escape_string($_POST['photoname']); mysql_query("INSERT INTO photos (photo_name, photo_image) VALUES ('$name', '$url' )") or die(mysql_error()); $success = "Photo has been added!"; } else { $moved = "File has not been moved to $target"; $success = "Failed to upload:("; } } ?> <!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> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Photo Upload</title> <meta name="robots" content="index, follow" /> <meta name="keywords" content="" /> <meta name="description" content="" /> <link href="<?php echo $globalurl; ?>styles.css" rel="stylesheet" type="text/css" /> </head> <body> <div class="holder"> <br /><br /> <b>Add a new photo</b> <hr /> <br /> <b><?php echo "$success<br />"; ?> <?php echo "$moved<br />"; ?></b> <form enctype="multipart/form-data" method="post" action="<?php echo $PHP_SELF; ?>"> <table cellspacing="0" cellpadding="0" width="500px"> <tbody> <tr> <td valign="top">Photo Name:</td> <td valign="top"> <input type="text" name="photoname" /><br /> <br /> </td> </tr> <tr> <td valign="top">Photo:</td> <td valign="top"> <input type="file" name="photo"><br /> <br /> </td> </tr> </tbody> </table> <input type="submit" value="submit" /> </form> </div> </body> </html>

    Read the article

  • Difficulty in Understanding Slideshow script

    - by shining star
    I have taken slide show script from net. But There some functions i cannot understand here is script <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd" > <html lang="en"> <head> <title></title> <script> var interval = 1500; var random_display = 0; var imageDir = "my_images/"; var imageNum = 0; imageArray = new Array(); imageArray[imageNum++] = new imageItem(imageDir + "01.jpg"); imageArray[imageNum++] = new imageItem(imageDir + "02.jpg"); imageArray[imageNum++] = new imageItem(imageDir + "03.jpg"); imageArray[imageNum++] = new imageItem(imageDir + "04.jpg"); imageArray[imageNum++] = new imageItem(imageDir + "05.jpg"); var totalImages = imageArray.length; function imageItem(image_location) { this.image_item = new Image(); this.image_item.src = image_location; return this.image_item.src; } function get_ImageItemLocation(imageObj) { return(imageObj.image_item.src) } alert(imageArray[imageNum].image_item.src); function randNum(x, y) { var range = y - x + 1; return Math.floor(Math.random() * range) + x; } function getNextImage() { if (random_display) { imageNum = randNum(0, totalImages-1); } else { imageNum = (imageNum+1) % totalImages; } var new_image = get_ImageItemLocation(imageArray[imageNum]); //alert(new_image) return(new_image); } function getPrevImage() { imageNum = (imageNum-1) % totalImages; var new_image = get_ImageItemLocation(imageArray[imageNum]); return(new_image); } function prevImage(place) { var new_image = getPrevImage(); document[place].src = new_image; } function switchImage(place) { var new_image = getNextImage(); document[place].src = new_image; var recur_call = "switchImage('"+place+"')"; timerID = setTimeout(recur_call, interval); } </script> </head> <body onLoad="switchImage('slideImg')"> <img name="slideImg" src="27.jpg" width=500 height=375 border=0> <a href="#" onClick="switchImage('slideImg')">play slide show</a> <a href="#" onClick="clearTimeout(timerID)"> pause</a> <a href="#" onClick="prevImage('slideImg'); clearTimeout(timerID)"> previous</a> <a href="#" onClick="switchImage('slideImg'); clearTimeout(timerID)">next </a> </body> </html> here exactly i dont know what does acctually function of get_ImageItemLocation(imageObj) and imageItem(image_location) what does these two functions seperately? Thanks in advance for attention

    Read the article

  • How do I search using the Google Maps API?

    - by Thomas
    Hello all, I'm trying to figure out how to search for nearby businesses in an iPhone app using the Google Maps API. I'm completely new to Javascript, and have waded through some of Google's sample code easily enough. I found how to grab the user's current location. Now I want to search for "restaurants" near that location. I'm just building on the sample code from here. I'll post it below with my changes anyway, just in case. <html> <head> <meta name="viewport" content="initial-scale=1.0, user-scalable=no" /> <meta http-equiv="content-type" content="text/html; charset=UTF-8"/> <title>Google Maps JavaScript API v3 Example: Map Geolocation</title> <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=true"></script> <script type="text/javascript" src="http://code.google.com/apis/gears/gears_init.js"></script> <script type="text/javascript"> var currentLocation; var detroit = new google.maps.LatLng(42.328784, -83.040877); var browserSupportFlag = new Boolean(); var map; var infowindow = new google.maps.InfoWindow(); function initialize() { var myOptions = { zoom: 6, mapTypeId: google.maps.MapTypeId.ROADMAP }; map = new google.maps.Map(document.getElementById("map_canvas"), myOptions); map.enableGoogleBar(); // Try W3C Geolocation method (Preferred) if(navigator.geolocation) { browserSupportFlag = true; navigator.geolocation.getCurrentPosition(function(position) { // TRP - Save current location in a variable (currentLocation) currentLocation = new google.maps.LatLng(position.coords.latitude,position.coords.longitude); // TRP - Center the map around current location map.setCenter(currentLocation); }, function() { handleNoGeolocation(browserSupportFlag); }); } else { // Browser doesn't support Geolocation browserSupportFlag = false; handleNoGeolocation(browserSupportFlag); } } function handleNoGeolocation(errorFlag) { if (errorFlag == true) { // TRP - Default location is Detroit, MI currentLocation = detroit; contentString = "Error: The Geolocation service failed."; } else { // TRP - This should never run. It's embedded in a UIWebView, running on iPhone contentString = "Error: Your browser doesn't support geolocation."; } // TRP - Set the map to the default location and display the error message map.setCenter(currentLocation); infowindow.setContent(contentString); infowindow.setPosition(currentLocation); infowindow.open(map); } </script> </head> <body style="margin:0px; padding:0px;" onload="initialize()"> <div id="map_canvas" style="width:100%; height:100%"></div> </body> </html>

    Read the article

  • jQuery not support rich:hotKey in jsf tag

    - by eswaramoorthy-nec
    Hi, i have used rich:hotKey for h:inputText in my jsp page. And also i wrote jQuery for get the textBox value. When i use jquery, that time rich:kotKey not worked sample.jsp <%@page contentType="text/html" pageEncoding="UTF-8"%> <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %> <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %> <%@ taglib uri="http://richfaces.org/a4j" prefix="a4j" %> <%@ taglib uri="http://richfaces.org/rich" prefix="rich"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <f:view> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>JSP Page</title> <script type="text/javascript" src="../../resource/js/jquery.min.js"/> <script type="text/javascript"> function typedName() { //Get The value using styleClass id var userName = jQuery.trim($('.textBox').val()); alert("Name is : " + userName); } // If i am not use above typedName() script and load src, then // the following testButton() clicked script perfectly worked. function testButton() { alert("Test Button Clicked"); } </script> </head> <body> <h:form> <rich:panel> <h:outputText value="Enter your Name : "/> <h:inputText id="textBox" styleClass="textBox" value ="" />&nbsp; <a4j:commandButton id="nameButton" value="NameButton" onclick="typedName();"/><br> <a4j:commandButton id="testButton" value="TestButton" onclick="testButton();" /> <%--HotKey for text Box and focus to testButton --%> <rich:hotKey key="return" selector="#textBox" handler="#{rich:element('testButton')}.click(); event.stopPropagation();event.preventDefault(); return false;"/> </rich:panel> </h:form> </body> </f:view> If i am not include the jquery, then that time i hit the enter button from text box, then automatically called testButton() script. If i include the Jquery, then rich:hotkey not work. I am also Used , var $J = jQuery.noConflict(); . But this time also not work jQuery. I hope help me about this. Thanks for your effort.

    Read the article

  • Javascript: Dynamic Check box (Fieldset with Father/Child Checkboxes)

    - by BoDiE2003
    I have a problem here, when I select any of the 'father' checkboxes all the child checkboxes are getting enabled or disabled. So I need each father checkbox to affect it own child fieldset. Could someone help me with this. Thank you <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html lang="en"> <head> <title>toggle disabled</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <style type="text/css"> .cssDisabled { color: #ccc; } </style> <script src="http://prototypejs.org/assets/2009/8/31/prototype.js" type="text/javascript"> </script> <script type="text/javascript"> Event.observe(window, 'load', function(){ // for all items in the group_first class $$('.father').each(function(chk1){ // watch for clicks chk1.observe('click', function(evt){ dynamicCheckbox(); }); dynamicCheckbox(); }); }); function dynamicCheckbox (){ // count how many of group_first are checked, // doEnable true if any are checked var doEnable = ($$('.father:checked').length > 0) ? true : false; // for each in group_second, enable the checkbox, and // remove the cssDisabled class from the parent label $$('.child').each(function(item){ if (doEnable) { item.enable().up('label').removeClassName('cssDisabled'); } else { item.disable().up('label').addClassName('cssDisabled'); } }); }; </script> </head> <body> <fieldset> <legend>First Group</legend> <label><input type="checkbox" value="1" class="father" />Check box 1</label><br /> <label><input type="checkbox" value="2" class="father" checked/>Check box 2</label> </fieldset> <fieldset> <legend>Second Group</legend> <label class="cssDisabled"><input type="checkbox" value="x" class="child" disabled="disabled" />Check box x</label><br /> <label class="cssDisabled"><input type="checkbox" value="y" class="child" disabled="disabled" />Check box y</label><br /> <label class="cssDisabled"><input type="checkbox" value="z" class="child" disabled="disabled" />Check box z</label> </fieldset> <fieldset> <legend>First Group</legend> <label><input type="checkbox" value="3" class="father" />Check box 1</label><br /> </fieldset> <fieldset> <legend>Second Group</legend> <label class="cssDisabled"><input type="checkbox" value="x" class="child" disabled="disabled" />Check box x</label><br /> <label class="cssDisabled"><input type="checkbox" value="y" class="child" disabled="disabled" />Check box y</label><br /> <label class="cssDisabled"><input type="checkbox" value="z" class="child" disabled="disabled" />Check box z</label> </fieldset> </body> </html>

    Read the article

  • Why do I get error "prefix [..] is not defined" when I try to use my jsf custom tag?

    - by Roman
    I created a jsf custom tag (I'm not sure that it's correct, I could miss something easily, so I attached code below). Now I'm trying to use this tag but I get an error: error on line 28 at column 49: Namespace prefix gc on ganttchart is not defined So, here is the xhtml-page: <!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" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:gc="http://myganttchart.org"> <body> <ui:composition template="/masterpage.xhtml"> <ui:define name="title">Gantt chart test</ui:define> <ui:define name="content"> <f:view> <gc:ganttchart width="300" height="100" rendered="true"/> ... </f:view> </ui:define> </ui:composition> </body> </html> And here is tld-file (it's placed in WEB-INF/): <taglib xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-jsptaglibrary_2_1.xsd" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.1"> <tlib-version> 1.0 </tlib-version> <short-name> oext </short-name> <uri> http://myganttchart.org </uri> <tag> <name>ganttchart</name> <tag-class>usermanagement.support.ganttchart.GanttChartTag</tag-class> <body-content>empty</body-content> <attribute> <name>binding</name> <deferred-value> <type>javax.faces.component.UIComponent</type> </deferred-value> </attribute> ... </tag> </tablib> Here is a part of tag-class code: public class GanttChartTag extends UIComponentELTag { private ValueExpression width; private ValueExpression height; private ValueExpression styleClass; public String getComponentType () { return "org.myganttchart"; } public String getRendererType () { return null; } ... } Correspondent block from faces-config: <component> <component-type>org.myganttchart</component-type> <component-class>usermanagement.support.ganttchart.UIGanttChart</component-class> </component> And the last part if UIGanttChart: public class UIGanttChart extends UIOutput { public UIGanttChart() { setRendererType (null); } //some test code public void encodeBegin(FacesContext context) throws IOException { ResponseWriter writer = context.getResponseWriter (); writer.startElement("img", this); writer.writeAttribute("src", "no-img", "source"); writer.writeAttribute("width", getAttributes ().get ("width"), "width"); writer.writeAttribute("height", getAttributes ().get ("height"), "height"); writer.writeAttribute("class", ".someclass", "styleClass"); writer.endElement("img"); } } So, what did I miss?

    Read the article

  • Parse Nested XML tags with the same name

    - by footose
    Let's take a simple XML document: <x> <e> <e> <e>Whatever 1</e> </e> </e> <e> <e> <e>Whatever 2</e> </e> </e> <e> <e> <e>Whatever 3</e> </e> </e> </x> Using the standard org.w3c.dom, I can get the nodes in X by doing.. NodeList fullnodelist = doc.getElementsByTagName("x"); But if I want to return the next set of "e" I try to use something like .. Element element = (Element) fullnodelist.item(0); NodeList nodes = pelement.getElementsByTagName("e"); Expecting it to return "3" nodes (because there are 3 sets of "e"), but instead, it returns "9" - becuase it gets all entries with "e" apperently. This would be fine in the above case, because I could probably iterate through and find what I'm looking for. The problem I'm having is that when the XML file looks like the following: <x> <e> <pattern>whatever</pattern> <blanks> <e>Something Else</e> </blanks> </e> <e> <pattern>whatever</pattern> <blanks> <e>Something Else</e> </blanks> </e> </x> When I request the "e" value, it returns 4, instead of (what i expect) 2. Am I just not understanding how the DOM parsing works? Typically in the past I have used my own XML documents so I would never name the items like this, but unfortunately this is not my XML file and I have no choice to work like this. What I thought I would do is write a loop that "drills down" nodes so that I could group each node together... public static NodeList getNodeList(Element pelement, String find) { String[] nodesfind = Utilities.Split(find, "/"); NodeList nodeList = null; for (int i = 0 ; i <= nodesfind.length - 1; i++ ) { nodeList = pelement.getElementsByTagName( nodesfind[i] ); pelement = (Element)nodeList.item(i); } // value of the nod we are looking for return nodeList; } .. So that if you passed "s/e" into the function, it would return the 2 nodes that I'm looking for (or elements, maybe I'm using the terminology incorrect?). instead it returns all of the "e" nodes within that node. I'm using J2SE for this, so options are rather limited. I can't use any third party XML Parsers. Anyway, if anyone is still with me and has a suggestion, it would be appreciated.

    Read the article

  • jQuery sortable Div's

    - by kai lange
    is it possible to sort direct between two or more div's/boxe's and return the complete data (var order = ...) ? Online Demo: http://jsbin.com/alegu4 <!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> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>jQuery Dynamic Drag'n Drop</title> <script type="text/javascript" src="http://cdn.jquerytools.org/1.2.5/jquery.tools.min.js"></script> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.8/jquery-ui.min.js"></script> <style> body { font-family: Arial, Helvetica, sans-serif; font-size: 16px; margin-top: 10px; } ul { margin: 0; } #s1,#s2 { float: left; width: 400px; } #s1 li,#s2 li { list-style: none; margin: 0 0 4px 0; padding: 10px; background-color:#00CCCC; border: #CCCCCC solid 1px; color:#fff; } </style> <script type="text/javascript"> $(document).ready(function(){ $(function() { $("#s1 ul,#s2 ul").sortable({ opacity: 0.6, cursor: 'move', update: function() { var order = $(this).sortable("serialize") + '&action=updateRecordsListings'; //$.post("updateDB.php", order); alert(order); } }); }); }); </script> </head> <body> <div id="box"> <div class="box" id="s1"> <ul> <li id="recordsArray_1">1. Lorem ipsum dolor sit amet, consetetur</li> <li id="recordsArray_2">2. Lorem ipsum dolor sit amet, consetetur</li> <li id="recordsArray_3">3. Lorem ipsum dolor sit amet, consetetur</li> <li id="recordsArray_4">4. Lorem ipsum dolor sit amet, consetetur</li> </ul> </div> <div class="box" id="s2"> <ul> <li id="recordsArray_5">5. Lorem ipsum dolor sit amet, consetetur</li> <li id="recordsArray_6">6. Lorem ipsum dolor sit amet, consetetur</li> <li id="recordsArray_7">7. Lorem ipsum dolor sit amet, consetetur</li> <li id="recordsArray_8">8. Lorem ipsum dolor sit amet, consetetur</li> </ul> </div> </div> </body> </html> Please note it's not the same like my other post - thanks!

    Read the article

  • Why only one video shows up in ASP.NET Video panel ?

    - by user284523
    It is possible to have multiple videos with Flowplayer http://flowplayer.org/demos/installation/multiple-players.html To do so in ASP.NET DYNAMICALLY, one has to use a Panel (see http://idevwebs.com/Default.aspx?id=25): <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %> <!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> <!-- A minimal Flowplayer setup to get you started --> <!-- include flowplayer JavaScript file that does Flash embedding and provides the Flowplayer API. --> <script type="text/javascript" src="flowplayer-3.1.4.min.js"></script> <!-- page title --> <title>Minimal Flowplayer setup</title> </head><body> <form id="form1" runat="server"> <div id="page"> <h1>Minimal Flowplayer setup</h1> <p>View commented source code to get familiar with Flowplayer installation.</p> <!-- this A tag is where your Flowplayer will be placed. it can be anywhere --> <!-- player #1 --> <asp:Panel ID="panelVideo" runat="server"> </asp:Panel> <!-- this will install flowplayer inside previous A- tag. --> <script type="text/javascript"> flowplayer("player", "flowplayer-3.1.5.swf"); </script> <!-- after this line is purely informational stuff. does not affect on Flowplayer functionality --> <p> If you are running these examples <strong>locally</strong> and not on some webserver you must edit your <a href="http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html"> Flash security settings</a>. </p> <p class="less"> Select "Edit locations" &gt; "Add location" &gt; "Browse for files" and select flowplayer-x.x.x.swf you just downloaded. </p> <h2>Documentation</h2> <p> <a href="http://flowplayer.org/documentation/installation/index.html">Flowplayer installation</a> </p> <p> <a href="http://flowplayer.org/documentation/configuration/index.html">Flowplayer configuration</a> </p> <p> See this identical page on <a href="http://flowplayer.org/demos/example/index.htm">Flowplayer website</a> </p> </div> </form> </body></html> and then add video anchor dynamically public partial class _Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { this.panelVideo.Controls.Add(new LiteralControl("<a href=\"" + "http://blip.tv/file/get/" + "KimAronson-TwentySeconds58192" + ".flv\" style=\"display:block;width:388px;height:230px\" id=\"player\"></a>")); this.panelVideo.Controls.Add(new LiteralControl("<a href=\"" + "http://blip.tv/file/get/" + "KimAronson-TwentySeconds67463" + ".flv\" style=\"display:block;width:388px;height:230px\" id=\"player\"></a>")); } } But it works only partially as the first video shows up not both. And all html below doesn't show up either.

    Read the article

  • In ASP.NET MVC, How do I make a partial view available to all controllers?

    - by Quakkels
    In ASP.NET MVC, How do I make a partial view available to all controllers? I want to create navigation that is common across the entire site, but when I place the Html.Action into my master page, it only works on views associated with 1 controller. Right now, I have a controller action defined like this: // GET: GetCategoriesPartial [ChildActionOnly] public ActionResult GetCategoriesPartial() { var category = CategoriesDataContext.GetCategories(); return PartialView(category); } And I've created my partial view like this: <%@ Import Namespace="wopr.Models" %> <%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %> <ul> <% foreach (var cat in Model as IEnumerable<Category>) { %> <li><a href="/categories/Details/<%=cat.catID%>"><%=cat.catName%></a></li> <% } %> </ul> My Master Page looks like this: <%@ Import Namespace="wopr.Models" %> <%@ Master Language="C#" Inherits="System.Web.Mvc.ViewMasterPage" %> <!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"> <title><asp:ContentPlaceHolder ID="TitleContent" runat="server" /></title> <link type="text/css" rel="Stylesheet" href="/Content/Site.css" /> </head> <body> <div class="wrap-all"> <div style="text-align:right;"> <a href="/">Home</a> | <a href="/games/">Games</a> | <a href="/games/Index2/1">Games <em>(paginated)</em></a> | <a href="/categories/">Categories</a> | <a href="/upload/">Upload</a> </div> <asp:ContentPlaceHolder ID="MainContent" runat="server"> </asp:ContentPlaceHolder> <!--This errors on any non-CategoryController page.--> <%= Html.Action("GetCategoriesPartial")%> <!----> </div> </body> </html> This code works as long as I'm viewing something handled by the CategoriesController. If I go to any view handled by a different controller, I get the exception: System.Web.HttpException: A public action method 'GetCategoriesPartial' was not found on controller 'wopr.Controllers.GamesController'. How do I make this partial view available to all the site's controllers? Thanks for any help. Quakkels

    Read the article

< Previous Page | 34 35 36 37 38 39 40 41 42 43 44 45  | Next Page >