Search Results

Search found 22083 results on 884 pages for 'display templates'.

Page 7/884 | < Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >

  • Linux Defualt Startup Display PCI to fix black boot screen

    - by Jonathan
    You heard it all before black screen on boot after perfectly fine install of most linux ubnuntu mint etc distributions (the netbook works fine) It has an Intel N10 integrated graphics chipset. I have actually found that if I plug in an external display then remove it the default screen turns on and my laptop works fine drivers all great - I have tried the screen cycle button fn f7 but doesn't work when no display is plugged in. It also works out all the correct resolutions and no modification of the grub bootloader or creating any xorg configs. So I think my monitor is forcing to a display that doesn't exist. Do you know if there is anyway I can force it to choose a different screen at boot so I can get a login screen? I can use nomodeset on grub but xrandr cant add the damned 1024 600 60 resolution that I need! Ideas guys?

    Read the article

  • Display Resolution Getting Changed Automatically (sometimes) - Win7x64 - Asus M3A78-EM

    - by kamleshrao
    AMD PC Motherboard - Asus M3A78-EM (installed VGA drivers from Asus website - AMD_VGA_V863200_XPVistaWin7.zip) It has VGA and HDMI inbuilt ports (ATI Radeon HD 3200 Graphics 256MB) VGA is connected to my ViewSonic Monitor. HDMI is connected to LG LCD TV OS - Windows 7 x64 Ultimate Sometimes, when I reboot/start my PC, my ViewSonic display resolution changes and does not show the recommended value(1440x900) in Resolution Settings. The HDMI display works well always. But after multiple reboots/starts, the problem gets fixed automatically and I get back my recommended resolution on ViewSonic display. I am not making any changes to the existing drivers. It sometimes work well, and sometimes doesn't work. Can someone assist me resolving this permanently.

    Read the article

  • Notebook display not working properly

    - by jfcfar
    I have an old Acer TM4001 notebook. If the laptop is powered-off, with the lid closed, when I power it on, it generally works. Then, without touching anything, if I reboot the computer the internal display wil not work anymore. To make it working again I need to shut down the pc, close and reopen the lid and then turn it on. If I close and reopen the lid if it is not working after power the pc on, it won't work. When the screen is working, closing and opening it has no effect (the data cable seems ok). The external monitor always works as expected: If the internal display is not detected, the external will be the main (and only) display. This is not OS-related. When the screen is not working I cannot see the POST. What could be the cause for this?

    Read the article

  • Virtually adjusting screen size and position

    - by Mishari
    Hi, I'm working on a display piece which is an LCD monitor that is partially covered and needs to be running an application in full screen in the uncovered portion of the screen. I have tried xvidtune on linux which gives me mode errors and switchresx on macosx which only seems to change resolution but not reposition nor resize (it stretches to full screen anyways). I'm wondering if there's anyway to do this? Practically, I have access to any OS.

    Read the article

  • Templates vs. coded HTML

    - by Alan Harris-Reid
    I have a web-app consisting of some html forms for maintaining some tables (SQlite, with CherryPy for web-server stuff). First I did it entirely 'the Python way', and generated html strings via. code, with common headers, footers, etc. defined as functions in a separate module. I also like the idea of templates, so I tried Jinja2, which I find quite developer-friendly. In the beginning I thought templates were the way to go, but that was when pages were simple. Once .css and .js files were introduced (not necessarily in the same folder as the .html files), and an ever-increasing number of {{...}} variables and {%...%} commands were introduced, things started getting messy at design-time, even though they looked great at run-time. Things got even more difficult when I needed additional javascript in the or sections. As far as I can see, the main advantages of using templates are: Non-dynamic elements of page can easily be viewed in browser during design. Except for {} placeholders, html is kept separate from python code. If your company has a web-page designer, they can still design without knowing Python. while some disadvantages are: {{}} delimiters visible when viewed at design-time in browser Associated .css and .js files have to be in same folder to see effects in browser at design-time. Data, variables, lists, etc., must be prepared in advanced and either declared globally or passed as parameters to render() function. So - when to use 'hard-coded' HTML, and when to use templates? I am not sure of the best way to go, so I would be interested to hear other developers' views. TIA, Alan

    Read the article

  • Is there any way to combine transparency and "ajax usability" with HTML templates

    - by Sam
    I'm using HTML_Template_Flexy in PHP but the question should apply to any language or template library. I am outputting a list of relatively complex objects. In the beginning I just iterated over a list of the objects and called a toHtml method on them. When I was about to have my layout designer look over the template I noticed that it was too opaque and that he would have ended up looking through and/or editing many additional php source files to see what really gets generated by the toHtml method. So I extracted most of the HTML strings in the php classes up to the template which made for one clear file where you can see the whole page structure at once. However this causes problems when you want to add an object to the list using javascript. Then I have to keep the old toHtml method and maintain both the main template and the html strings at the same time, so I can output just the HTML for a new object that should be added to the page. So I'm back to the idea of using smaller templates for the objects that make up the page, but I was wondering if there was some easy way of having my cake and eating it too by having one template that shows the whole page but also the mini-templates for smaller objects on the page. Edit: Yes, updating the page is not a problem at all. My concern is with having both maintainability and transparency of the template files. If I have one single template for the whole page, then I must maintain mini-templates of the objects that are shown on the page. If I just have the mini-templates and include them from the higher-level template it becomes more difficult to look at the top-level html and imagine what the end result will look like.

    Read the article

  • No display on computer due to connection problem

    - by whamsicore
    My computer is booting but has no display. The optical drive has power, but the USB doesn't, so I figured that I had a broken motherboard. However I tried to boot my computer again laying flat, and it worked fine for two seconds, and then froze like it did the first time. It had no display after that. I have come to the conclusion that it is a connection problem (someone had a similar problem on one of the online forums).

    Read the article

  • Can't run monitor at native 1080p resolution on Windows 7

    - by Rex
    I have a 24" ViewSonic VX2453 monitor that supports 1920x1080p, connected using HDMI. However at that resolution, the desktop goes off the screen. Using the Nvidia control panel, I have to set it to a custom resolution of 1804x1014 to display correctly. The monitor has its drivers properly installed (the correct model name shows up in control panel after installing the drivers), and I'm running 64 bit Win7 Ultimate. I have a GeForce 560 Ti card, if that helps. Why does this happen?

    Read the article

  • How To Adjust Properly Brightness And Contrast On Monitor

    - by Johannes
    This days, it seems that I either go worse with my eyes or some settings with contrast and brightness have been changed. However, I have been searching now for some tutorial on how to adjust contrast and brightness, and I have found already some, on how to use Microsoft Win7 Calibrate Display Color program, but some people don't recommend it.. My monitor control menu shows settings (which are by default) that contrast is set to 80, contrast to 90 and sharpnes to 45, for which I belive are pretty dam high. I'm usually every day in front of my PC about 6-10h. The biggest problem is, when the night comes, and I have to read some word document, after a 10-15m of reading, eyes starts hurting. I'm using ASUS VW198 and Nvidia 9800 GT graphic card. So please suggest me, what should I decrease, contrast or brightness or both?

    Read the article

  • What is the process for diagnosing a ViewSonic Monitor? [closed]

    - by Phxvyper
    I have a ViewSonic monitor that has been busted for quite some time. I've been researching it and i still have no clue as to why it doesn't work. It doesn't turn on. Or rather, it will turn on, but it will not display anything. How do i go about diagnosing the monitor? The monitor is a: ViewSonic VG2230WM Model #: VS11422 Fix: I opened up the monitor and replaced all of the burst capacitors. The monitor works beautifully now.

    Read the article

  • Optimisation <xsl:apply-templates/> for a set of tags.

    - by kalininew
    How it is possible to reduce this record? <xsl:template match="BR"> <br/> </xsl:template> <xsl:template match="B"> <strong><xsl:apply-templates /></strong> </xsl:template> <xsl:template match="STRONG"> <strong><xsl:apply-templates /></strong> </xsl:template> <xsl:template match="I"> <em><xsl:apply-templates /></em> </xsl:template> <xsl:template match="EM"> <em><xsl:apply-templates /></em> </xsl:template> <xsl:template match="OL"> <ol><xsl:apply-templates /></ol> </xsl:template> <xsl:template match="UL"> <ul><xsl:apply-templates /></ul> </xsl:template> <xsl:template match="LI"> <li><xsl:apply-templates /></li> </xsl:template> <xsl:template match="SUB"> <sub><xsl:apply-templates /></sub> </xsl:template> <xsl:template match="SUP"> <sup><xsl:apply-templates /></sup> </xsl:template> <xsl:template match="NOBR"> <nobr><xsl:apply-templates /></nobr> </xsl:template>

    Read the article

  • Useful Eclipse Java Code Templates

    - by Jon
    You can create various Java code templates in Eclipse via the Window->Preferences->Java -> Editor -> Templates e.g. sysout is expanded to: System.out.println(${word_selection}${});${cursor} You can activate this by typing sysout followed by CTRL+SPACE What useful Java code templates do you currently use? Include the name and description of it and why it's awesome. There's an open bounty on this for an original/novel use of a template rather than a built-in existing feature. Create Log4J logger Get swt color from display Syncexec - Eclipse Framework Singleton Pattern/Enum Singleton Generation Readfile Const Traceout Format String Comment Code Review String format Try Finally Lock Message Format i18n and log Equalsbuilder Hashcodebuilder Spring Object Injection Create FileOutputStream

    Read the article

  • Are C++ Templates just Macros in disguise?

    - by Roddy
    I've been programming in C++ for a few years, and I've used STL quite a bit and have created my own template classes a few times to see how it's done. Now I'm trying to integrate templates deeper into my OO design, and a nagging thought keeps coming back to me: They're just a macros, really... You could implement (rather UGLY) auto_ptrs using #defines, if you really wanted to. This way of thinking about templates helps me understand how my code will actually work, but I feel that I must be missing the point somehow. Macros are meant evil incarnate, yet "template metaprogramming" is all the rage. So, what ARE the real distinctions? and how can templates avoid the dangers that #define leads you into, like Inscrutable compiler errors in places where you don't expect them? Code bloat? Difficulty in tracing code? Setting Debugger Breakpoints?

    Read the article

  • Do c++ templates make programs slow ?

    - by user293398
    Hi, I have heard from many people that usage of templates make the code slow. Is it really true. I'm currently building a library. There are places where if templates are not created, it would result in code management problem. As of now I can think two solutions to this problem: o use #defines o Use templates and define all possible types in the header file/library itself but do not allow end user to make template instances. e.g. typedef Graph GraphI32; etc. Is there anyway, to restrict user from creating various template instances on their own. Help on above queries would be highly regarded.

    Read the article

  • What is a user-friendly solution to editing email templates with replacement variables?

    - by Daniel Magliola
    I'm working on a system where we rely a lot of "admins / managers" emailing users from the database. One of the key features is being able to email several people at the same time, with specific information relevant to each of them. Another key feature is to be able to hand-craft emails, because it tends to be be necessary to slightly modify them each time, but having a basic template saves a lot of time. For this, we have the typical "templates" solution, where we have a template that looks kind of like this: Hello {{recipient.full_name}}, Your application to {{activity.title}} has been accepted. You have requested to participate on dates {{application.dates}}, in role {{application.role}} Blah blah blah The problem we are having is obviously that (as we expected), managers don't get the whole "variables" idea, and they do things like overwriting them, which doesn't let them email more than one person at a time, assuming those are not going to get replaced and that the system is broken, or even inexplicable things like "Hello {{John}}". The big problem is that this isn't relegated, as usual, to an "admin" section where only a few power users have access to editing the templates that are automatically send out, and they're expected to know what they are doing. Every user of the system gets exposed to this problem. The obvious solution would be to replace the variables before showing this template for the user to edit, but that doesn't work when emailing several people. This seems like a reasonably common problem, and we are kind of hoping that someone has already solved it. Have you seen anywhere/created/can think of good solutions to this problem?

    Read the article

  • Ubuntu ATI second display as main display

    - by Josh
    how can i make my external second display as main display for ubuntu? Im using the ATI Control Center (amdcccle) Seems there is no way to make this switch under the GUI Section "ServerLayout" Identifier "amdcccle Layout" Screen 0 "amdcccle-Screen[1]-0" 0 0 EndSection Section "Files" EndSection Section "Module" Load "glx" EndSection Section "ServerFlags" Option "Xinerama" "off" EndSection Section "Monitor" Identifier "0-LCD" Option "VendorName" "ATI Proprietary Driver" Option "ModelName" "Generic Autodetecting Monitor" Option "DPMS" "true" Option "PreferredMode" "1366x768" Option "TargetRefresh" "60" Option "Position" "1680 0" Option "Rotate" "normal" Option "Disable" "false" EndSection Section "Monitor" Identifier "0-CRT1" Option "VendorName" "ATI Proprietary Driver" Option "ModelName" "Generic Autodetecting Monitor" Option "DPMS" "true" Option "PreferredMode" "1680x1050" Option "TargetRefresh" "60" Option "Position" "0 0" Option "Rotate" "normal" Option "Disable" "false" EndSection Section "Device" Identifier "Default Device" Driver "fglrx" EndSection Section "Device" Identifier "amdcccle-Device[1]-0" Driver "fglrx" Option "Monitor-LCD" "0-LCD" Option "Monitor-CRT1" "0-CRT1" BusID "PCI:1:5:0" EndSection Section "Device" Identifier "amdcccle-Device[1]-1" Driver "fglrx" Option "Monitor-LCD" "0-LCD" BusID "PCI:1:5:0" Screen 1 EndSection Section "Screen" Identifier "Default Screen" DefaultDepth 24 EndSection Section "Screen" Identifier "amdcccle-Screen[1]-0" Device "amdcccle-Device[1]-0" DefaultDepth 24 SubSection "Display" Viewport 0 0 Virtual 3046 3046 Depth 24 EndSubSection EndSection Section "Screen" Identifier "amdcccle-Screen[1]-1" Device "amdcccle-Device[1]-1" DefaultDepth 24 SubSection "Display" Viewport 0 0 Depth 24 EndSubSection EndSection

    Read the article

  • Notebook display problem (multiplication)

    - by SubniC
    Hi, I'm having some troubles with the display of a LG E500 notebook. The thing is that without any known reason the display starts to show the screen divided in eigth parts and each part show the display image as if I had a matrix of eigth displays :) I thought it could be some kind of refresh rate problem or driver related, but it is happening at boot-up as well and the BIOS. I got the computer completely unassambled yesterday and I check all the wires and connectors looking for something broken or unconected, but without luck... You can see a picture here of the problem (sorry for the low quality, but I think it illustrate the problem. EDIT 1: I uploaded a new pictrue, here you cans ee the problem better :) There are three horizontal lines that you can see just between the windows. You can see the grey line at the first moment you turn on the computer and the after the duplicated screens show up just like if they where arranged over a grid (over the horizontal lines...) I hope it makes any sense. Do you know what could be happening? or can you tell me what would you do? Thank you very much for your help.

    Read the article

  • Use external display from boot on Samsung laptop

    - by OhMrBigshot
    I have a Samsung RV511 laptop, and recently my screen broke. I connected an external screen and it works fine, but only after Windows starts. I want to be able to use the external screen right from boot, in order to set the BIOS to boot from DVD, and to then install a different OS and also format the hard drive. Right now I can only use the screen when Windows loads. What I've tried: I've tried opening up the laptop and disconnecting the display to make it only find the external and use the VGA as default -- didn't work. I've tried using the Fn+key combo in BIOS to connect external display - nothing I've been looking around for ways to change boot sequence without entering BIOS, but it doesn't look like it's possible. Possible solutions? A way to change boot sequence without entering BIOS? Someone with the same brand/similar model to help me blindly keystroke the correct arrows/F5/F6 buttons while in BIOS mode to change boot sequence? A way to force the external display to work from boot, through modifying the internal connections (I have no problem taking the laptop apart if needed, please no soldering though), through BIOS or program? Also, if I change boot sequence without accessing external screen, would the Ubuntu 12.1 installation sequence attempt to use the external screen or would I only be able to use it after Linux is installed and running? I'd really appreciate help, I can't afford to fix the screen for a few months from now, and I'd really like to make my computer come back to decent performance! Thanks in advance!

    Read the article

  • Mirror your display to another computer on your network

    - by klikkamongo
    I have a computer I am using for showing media, running windows 7 (XBMC). It is hooked up with a projector. I want other computers on my network to have the opportunity to mirror their display to this computer.(without the media computer having to accept it, it should be all controlled by the sending computer.(like sending a movie with Apple's Airplay)) One scenario: I am finding a webpage with a great article (or a Word document) on my computer that i want to show to the other people in the room, i press a button, then my screen is mirrored to the media pc. I can still scroll, write etc. so everybody can see it. When i am done showing the article, I can exit the display mirroring, and the media computer display goes back to normal. This should mirror the whole screen, not only the browser like plugins can do in chrome, or sending Youtube movies like plugins for Opera. Update I found a video example of the solution I am looking for, unfortunately it looks like it will be hard making a Chromecast reciever for windows. Using the "Cast entire screen (experimentally)" button on the Chromecast plugin in Chrome is doing the exact thing I want to do, see this video.

    Read the article

  • Metro: Dynamically Switching Templates with a WinJS ListView

    - by Stephen.Walther
    Imagine that you want to display a list of products using the WinJS ListView control. Imagine, furthermore, that you want to use different templates to display different products. In particular, when a product is on sale, you want to display the product using a special “On Sale” template. In this blog entry, I explain how you can switch templates dynamically when displaying items with a ListView control. In other words, you learn how to use more than one template when displaying items with a ListView control. Creating the Data Source Let’s start by creating the data source for the ListView. Nothing special here – our data source is a list of products. Two of the products, Oranges and Apples, are on sale. (function () { "use strict"; var products = new WinJS.Binding.List([ { name: "Milk", price: 2.44 }, { name: "Oranges", price: 1.99, onSale: true }, { name: "Wine", price: 8.55 }, { name: "Apples", price: 2.44, onSale: true }, { name: "Steak", price: 1.99 }, { name: "Eggs", price: 2.44 }, { name: "Mushrooms", price: 1.99 }, { name: "Yogurt", price: 2.44 }, { name: "Soup", price: 1.99 }, { name: "Cereal", price: 2.44 }, { name: "Pepsi", price: 1.99 } ]); WinJS.Namespace.define("ListViewDemos", { products: products }); })(); The file above is saved with the name products.js and referenced by the default.html page described below. Declaring the Templates and ListView Control Next, we need to declare the ListView control and the two Template controls which we will use to display template items. The markup below appears in the default.html file: <!-- Templates --> <div id="productItemTemplate" data-win-control="WinJS.Binding.Template"> <div class="product"> <span data-win-bind="innerText:name"></span> <span data-win-bind="innerText:price"></span> </div> </div> <div id="productOnSaleTemplate" data-win-control="WinJS.Binding.Template"> <div class="product onSale"> <span data-win-bind="innerText:name"></span> <span data-win-bind="innerText:price"></span> (On Sale!) </div> </div> <!-- ListView --> <div id="productsListView" data-win-control="WinJS.UI.ListView" data-win-options="{ itemDataSource: ListViewDemos.products.dataSource, layout: { type: WinJS.UI.ListLayout } }"> </div> In the markup above, two Template controls are declared. The first template is used when rendering a normal product and the second template is used when rendering a product which is on sale. The second template, unlike the first template, includes the text “(On Sale!)”. The ListView control is bound to the data source which we created in the previous section. The ListView itemDataSource property is set to the value ListViewDemos.products.dataSource. Notice that we do not set the ListView itemTemplate property. We set this property in the default.js file. Switching Between Templates All of the magic happens in the default.js file. The default.js file contains the JavaScript code used to switch templates dynamically. Here’s the entire contents of the default.js file: (function () { "use strict"; var app = WinJS.Application; app.onactivated = function (eventObject) { if (eventObject.detail.kind === Windows.ApplicationModel.Activation.ActivationKind.launch) { WinJS.UI.processAll().then(function () { var productsListView = document.getElementById("productsListView"); productsListView.winControl.itemTemplate = itemTemplateFunction; });; } }; function itemTemplateFunction(itemPromise) { return itemPromise.then(function (item) { // Select either normal product template or on sale template var itemTemplate = document.getElementById("productItemTemplate"); if (item.data.onSale) { itemTemplate = document.getElementById("productOnSaleTemplate"); }; // Render selected template to DIV container var container = document.createElement("div"); itemTemplate.winControl.render(item.data, container); return container; }); } app.start(); })(); In the code above, a function is assigned to the ListView itemTemplate property with the following line of code: productsListView.winControl.itemTemplate = itemTemplateFunction;   The itemTemplateFunction returns a DOM element which is used for the template item. Depending on the value of the product onSale property, the DOM element is generated from either the productItemTemplate or the productOnSaleTemplate template. Using Binding Converters instead of Multiple Templates In the previous sections, I explained how you can use different templates to render normal products and on sale products. There is an alternative approach to displaying different markup for normal products and on sale products. Instead of creating two templates, you can create a single template which contains separate DIV elements for a normal product and an on sale product. The following default.html file contains a single item template and a ListView control bound to the template. <!-- Template --> <div id="productItemTemplate" data-win-control="WinJS.Binding.Template"> <div class="product" data-win-bind="style.display: onSale ListViewDemos.displayNormalProduct"> <span data-win-bind="innerText:name"></span> <span data-win-bind="innerText:price"></span> </div> <div class="product onSale" data-win-bind="style.display: onSale ListViewDemos.displayOnSaleProduct"> <span data-win-bind="innerText:name"></span> <span data-win-bind="innerText:price"></span> (On Sale!) </div> </div> <!-- ListView --> <div id="productsListView" data-win-control="WinJS.UI.ListView" data-win-options="{ itemDataSource: ListViewDemos.products.dataSource, itemTemplate: select('#productItemTemplate'), layout: { type: WinJS.UI.ListLayout } }"> </div> The first DIV element is used to render a normal product: <div class="product" data-win-bind="style.display: onSale ListViewDemos.displayNormalProduct"> <span data-win-bind="innerText:name"></span> <span data-win-bind="innerText:price"></span> </div> The second DIV element is used to render an “on sale” product: <div class="product onSale" data-win-bind="style.display: onSale ListViewDemos.displayOnSaleProduct"> <span data-win-bind="innerText:name"></span> <span data-win-bind="innerText:price"></span> (On Sale!) </div> Notice that both templates include a data-win-bind attribute. These data-win-bind attributes are used to show the “normal” template when a product is not on sale and show the “on sale” template when a product is on sale. These attributes set the Cascading Style Sheet display attribute to either “none” or “block”. The data-win-bind attributes take advantage of binding converters. The binding converters are defined in the default.js file: (function () { "use strict"; var app = WinJS.Application; app.onactivated = function (eventObject) { if (eventObject.detail.kind === Windows.ApplicationModel.Activation.ActivationKind.launch) { WinJS.UI.processAll(); } }; WinJS.Namespace.define("ListViewDemos", { displayNormalProduct: WinJS.Binding.converter(function (onSale) { return onSale ? "none" : "block"; }), displayOnSaleProduct: WinJS.Binding.converter(function (onSale) { return onSale ? "block" : "none"; }) }); app.start(); })(); The ListViewDemos.displayNormalProduct binding converter converts the value true or false to the value “none” or “block”. The ListViewDemos.displayOnSaleProduct binding converter does the opposite; it converts the value true or false to the value “block” or “none” (Sadly, you cannot simply place a NOT operator before the onSale property in the binding expression – you need to create both converters). The end result is that you can display different markup depending on the value of the product onSale property. Either the contents of the first or second DIV element are displayed: Summary In this blog entry, I’ve explored two approaches to displaying different markup in a ListView depending on the value of a data item property. The bulk of this blog entry was devoted to explaining how you can assign a function to the ListView itemTemplate property which returns different templates. We created both a productItemTemplate and productOnSaleTemplate and displayed both templates with the same ListView control. We also discussed how you can create a single template and display different markup by using binding converters. The binding converters are used to set a DIV element’s display property to either “none” or “block”. We created a binding converter which displays normal products and a binding converter which displays “on sale” products.

    Read the article

  • Metro: Dynamically Switching Templates with a WinJS ListView

    - by Stephen.Walther
    Imagine that you want to display a list of products using the WinJS ListView control. Imagine, furthermore, that you want to use different templates to display different products. In particular, when a product is on sale, you want to display the product using a special “On Sale” template. In this blog entry, I explain how you can switch templates dynamically when displaying items with a ListView control. In other words, you learn how to use more than one template when displaying items with a ListView control. Creating the Data Source Let’s start by creating the data source for the ListView. Nothing special here – our data source is a list of products. Two of the products, Oranges and Apples, are on sale. (function () { "use strict"; var products = new WinJS.Binding.List([ { name: "Milk", price: 2.44 }, { name: "Oranges", price: 1.99, onSale: true }, { name: "Wine", price: 8.55 }, { name: "Apples", price: 2.44, onSale: true }, { name: "Steak", price: 1.99 }, { name: "Eggs", price: 2.44 }, { name: "Mushrooms", price: 1.99 }, { name: "Yogurt", price: 2.44 }, { name: "Soup", price: 1.99 }, { name: "Cereal", price: 2.44 }, { name: "Pepsi", price: 1.99 } ]); WinJS.Namespace.define("ListViewDemos", { products: products }); })(); The file above is saved with the name products.js and referenced by the default.html page described below. Declaring the Templates and ListView Control Next, we need to declare the ListView control and the two Template controls which we will use to display template items. The markup below appears in the default.html file: <!-- Templates --> <div id="productItemTemplate" data-win-control="WinJS.Binding.Template"> <div class="product"> <span data-win-bind="innerText:name"></span> <span data-win-bind="innerText:price"></span> </div> </div> <div id="productOnSaleTemplate" data-win-control="WinJS.Binding.Template"> <div class="product onSale"> <span data-win-bind="innerText:name"></span> <span data-win-bind="innerText:price"></span> (On Sale!) </div> </div> <!-- ListView --> <div id="productsListView" data-win-control="WinJS.UI.ListView" data-win-options="{ itemDataSource: ListViewDemos.products.dataSource, layout: { type: WinJS.UI.ListLayout } }"> </div> In the markup above, two Template controls are declared. The first template is used when rendering a normal product and the second template is used when rendering a product which is on sale. The second template, unlike the first template, includes the text “(On Sale!)”. The ListView control is bound to the data source which we created in the previous section. The ListView itemDataSource property is set to the value ListViewDemos.products.dataSource. Notice that we do not set the ListView itemTemplate property. We set this property in the default.js file. Switching Between Templates All of the magic happens in the default.js file. The default.js file contains the JavaScript code used to switch templates dynamically. Here’s the entire contents of the default.js file: (function () { "use strict"; var app = WinJS.Application; app.onactivated = function (eventObject) { if (eventObject.detail.kind === Windows.ApplicationModel.Activation.ActivationKind.launch) { WinJS.UI.processAll().then(function () { var productsListView = document.getElementById("productsListView"); productsListView.winControl.itemTemplate = itemTemplateFunction; });; } }; function itemTemplateFunction(itemPromise) { return itemPromise.then(function (item) { // Select either normal product template or on sale template var itemTemplate = document.getElementById("productItemTemplate"); if (item.data.onSale) { itemTemplate = document.getElementById("productOnSaleTemplate"); }; // Render selected template to DIV container var container = document.createElement("div"); itemTemplate.winControl.render(item.data, container); return container; }); } app.start(); })(); In the code above, a function is assigned to the ListView itemTemplate property with the following line of code: productsListView.winControl.itemTemplate = itemTemplateFunction;   The itemTemplateFunction returns a DOM element which is used for the template item. Depending on the value of the product onSale property, the DOM element is generated from either the productItemTemplate or the productOnSaleTemplate template. Using Binding Converters instead of Multiple Templates In the previous sections, I explained how you can use different templates to render normal products and on sale products. There is an alternative approach to displaying different markup for normal products and on sale products. Instead of creating two templates, you can create a single template which contains separate DIV elements for a normal product and an on sale product. The following default.html file contains a single item template and a ListView control bound to the template. <!-- Template --> <div id="productItemTemplate" data-win-control="WinJS.Binding.Template"> <div class="product" data-win-bind="style.display: onSale ListViewDemos.displayNormalProduct"> <span data-win-bind="innerText:name"></span> <span data-win-bind="innerText:price"></span> </div> <div class="product onSale" data-win-bind="style.display: onSale ListViewDemos.displayOnSaleProduct"> <span data-win-bind="innerText:name"></span> <span data-win-bind="innerText:price"></span> (On Sale!) </div> </div> <!-- ListView --> <div id="productsListView" data-win-control="WinJS.UI.ListView" data-win-options="{ itemDataSource: ListViewDemos.products.dataSource, itemTemplate: select('#productItemTemplate'), layout: { type: WinJS.UI.ListLayout } }"> </div> The first DIV element is used to render a normal product: <div class="product" data-win-bind="style.display: onSale ListViewDemos.displayNormalProduct"> <span data-win-bind="innerText:name"></span> <span data-win-bind="innerText:price"></span> </div> The second DIV element is used to render an “on sale” product: <div class="product onSale" data-win-bind="style.display: onSale ListViewDemos.displayOnSaleProduct"> <span data-win-bind="innerText:name"></span> <span data-win-bind="innerText:price"></span> (On Sale!) </div> Notice that both templates include a data-win-bind attribute. These data-win-bind attributes are used to show the “normal” template when a product is not on sale and show the “on sale” template when a product is on sale. These attributes set the Cascading Style Sheet display attribute to either “none” or “block”. The data-win-bind attributes take advantage of binding converters. The binding converters are defined in the default.js file: (function () { "use strict"; var app = WinJS.Application; app.onactivated = function (eventObject) { if (eventObject.detail.kind === Windows.ApplicationModel.Activation.ActivationKind.launch) { WinJS.UI.processAll(); } }; WinJS.Namespace.define("ListViewDemos", { displayNormalProduct: WinJS.Binding.converter(function (onSale) { return onSale ? "none" : "block"; }), displayOnSaleProduct: WinJS.Binding.converter(function (onSale) { return onSale ? "block" : "none"; }) }); app.start(); })(); The ListViewDemos.displayNormalProduct binding converter converts the value true or false to the value “none” or “block”. The ListViewDemos.displayOnSaleProduct binding converter does the opposite; it converts the value true or false to the value “block” or “none” (Sadly, you cannot simply place a NOT operator before the onSale property in the binding expression – you need to create both converters). The end result is that you can display different markup depending on the value of the product onSale property. Either the contents of the first or second DIV element are displayed: Summary In this blog entry, I’ve explored two approaches to displaying different markup in a ListView depending on the value of a data item property. The bulk of this blog entry was devoted to explaining how you can assign a function to the ListView itemTemplate property which returns different templates. We created both a productItemTemplate and productOnSaleTemplate and displayed both templates with the same ListView control. We also discussed how you can create a single template and display different markup by using binding converters. The binding converters are used to set a DIV element’s display property to either “none” or “block”. We created a binding converter which displays normal products and a binding converter which displays “on sale” products.

    Read the article

  • Oracle VM Templates for EBS 12.1.3 for Exalogic Now Available

    - by Elke Phelps (Oracle Development)
    Oracle VM Templates for Oracle E-Business Suite 12.1.3 for x86 Exalogic Platform (64 bit) are now available on the Oracle Software Delivery Cloud.  The templates contain all the required elements to create an Oracle E-Business Suite R12 demonstration system on an Exalogic server. You can use these templates to quickly build an EBS 12.1.3 demonstration environment, bypassing the operating system and the software install (via the EBS Rapid Install).   The Oracle E-Business Suite Release 12.1.3 (64 bit) template for the Exalogic platform is a Oracle Virtual Server Guest template that contains a complete Oracle E-Business Suite Release 12.1.3 Database Tier and Application Tier Installation.  For additional details, please refer to the following My Oracle Support Note: Oracle E-Business Suite Release 12.1.3 Database Tier and Application Tier Template for Oracle Exalogic Platform (Note 1499132.1) The Oracle E-Business Suite system is installed on top of Oracle Linux Version 5 update 6. The templates have been optimized for performance, including OS kernel settings and E-Business Suite configuration settings tuned specifically for the Exalogic platform.  The configuration delivered with this template for a mid-tier running on Exalogic will support hundreds of concurrent users.  Please refer to Section 2: Performance Analysis in My Oracle Support Note 1499132.1 for additional details.   Additional Information The Oracle E-Business Suite VM templates for the Exalogic platform contain the following software versions: Operating System: Oracle Linux Version 5 Update 6 Oracle E-Business Suite 12.1.3 (Database Tier) Oracle E-Business Suite 12.1.3 (Application Tier) The following considerations were made when the Oracle E-Business Suite VM template for the Exalogic platform were designed: Templates use the hardware-virtualized architecture, supporting hardware with virtualization feature. Database Tier Template is configured to use the following configuration: 16 GB RAM 4 VCPUs 250 GB of Disk space for application installation Application Tier Template is configured to use the following configuration: 16 GB RAM 4 VCPUs 50 GB of Disk space for application installation References Oracle E-Business Suite Release 12.1.3 Database Tier and Application Tier Template for Oracle Exalogic Platform (Note 1499132.1) Related Articles Part 1: E-Business Suite 12.1.1 Templates for Oracle VM Now Available Part 2: Using Oracle VM with Oracle E-Business Suite Virtualization Kit Part 3: On Clouds and Virtualization in EBS Environments (OpenWorld 2009 Recap) Part 4: Deploying E-Business Suite on Amazon Web Services Elastic Compute Cloud Part 5: Live Migration of EBS Services Using Oracle VM Support Policies for Virtualization Technologies and Oracle E-Business Suite Virtualization and the E-Business Suite, Redux Virtualization and E-Business Suite

    Read the article

  • How can I switch user in a shell and use the existing gnome display session?

    - by z7sg
    If I switch user in a terminal. su bob I can't open gedit because bob doesn't own the display. If I execute xhost + before switching to bob I can open the display for some applications but not all. I get the following output when trying to execute gedit: (crashreporter:4415): GnomeUI-WARNING *: While connecting to session manager: None of the authentication protocols specified are supported. * GLib-GIO:ERROR:/build/buildd/glib2.0-2.28.6/./gio/gdbusconnection.c:2279:initable_init: assertion failed: (connection-initialization_error == NULL)

    Read the article

  • How can I prevent my laptop to freeze when I connect my external display?

    - by user170230
    I'm facing a problem with connecting a display on my laptop (a Toshiba mini NB 200), running Ubuntu 13.04. Processor: Intel® Atom™ CPU N270 @ 1.60GHz × 2 Memory: 993,6 MiB Graphics: Intel® 945GME x86/MMX/SSE2 OS type: 32-bit Disk: 156,3 GB After having connected my display with my laptop the first five minutes all runs perfect, however after that my laptop do not respond any more and I don't know what to do. When I disconnect the HDMI cable the screen just goes all black.

    Read the article

< Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >