LightSwitch HTML multi-level tile navigation menu

I am working on a multi-level tile navigation system for the LS HTML client.  The idea is to have tiles on the home screen that when tapped navigate to a lower-level screen with more tiles that eventually lead to browse screens with the actual LS data. 
Here is what I have so far (simplified of course).  Looking for suggestions on how to improve this.  TIA!
Home navigation tiles (these tiles appear on the application Home Screen)
-Orders - tap goes to Orders Home screen with additional tiles.
-Customers - tap goes to Customers Home screen with additional tiles.
-Lookups - tap goes to Lookups Home screen with additional tiles.
Order Navigation Tiles (these tiles appear on the Order home screen)
-Orders (search/browse Orders)
-Returns (screen based on a modeled query of Orders)
-other tiles for screens based on modeled queries of Orders
Customer Navigation Tiles (these tiles appear on a Customers home screen)
-Customers (search/browse Customers)
-other tiles based on modeled queries of Customers
Lookup Navigation Tiles
- Each tile links to a browse screen for one of the lookup tables.
>>>>
(didn't create an image/icon for this yet)
>>> ItemTap leads to a browse screen for "Test Records".
To power this menu system, there is a database table MenuTiles.
MenuTiles:
Title
Description
ScreenId
MenuGroup choicelist
-HomeGroup
-OrderGroup
-CustomerGroup
ImageFileName (contains the name of the static image file for the tile)
I have three modelled queries to get the tiles associated with each group.  The Home Screen gets its tiles from a modelled query selecting the tiles with MenuGroup == HomeGroup.  The other screens work the same way respectively.
The Home screen has the following js.  The other screens have similar methods.
myapp.Home.ImageFileName_render = function (element, contentItem) {
contentItem.dataBind("value", function (newValue) {
var newFileName = newValue;
if (newFileName !== null && newFileName !== undefined) {
element.innerHTML = "<image src='Content/Images/Tiles/" + newFileName + ".png'>";
myapp.Home.MenuTilesHomeGroup_ItemTap_execute = function (screen) {
var entity = screen.MenuTilesHomeGroup.selectedItem;
var modelItem = entity.details.properties["ScreenId"].value;
if (modelItem !== null && modelItem !== undefined) {
myapp.showScreen('Browse' + modelItem);
This all seems to work well.  The databind on the ImageFileName keeps the images updated on the screen if they are added or changed.  The ItemTap_execute function correctly navigates to a lower level navigation screen or a browse screen for the
appropriate entity collection.
The problem I have with it is it seems to rely on magic strings and that sort of thing.  For example, if the ScreenId does not match the name of a screen it will error.  If the ImageFileName does not match an image in the folder, it shows the default
placeholder.  Is there a better way to do this?

Nice Job Hessc!  I also like Dales tile menu that Dave mentioned.
For a look at another example, albeit not multi-level, see how
syncfusion does tiles in this demo:
Javascript
myapp.Home.ScreenContent_render = function (element, contentItem) {
TileCreation(element, contentItem);
$(".tile-li").on("click", function (args) {
var screen = args.currentTarget ? $(args.currentTarget).attr('data') : "";
myapp.showScreen(screen);
function TileCreation(element, contentItem) {
var SampleList = [
{ imgClass: "Editor", sampleName: "Editors", screenName: "BrowseEmployeeInfo" },
{ imgClass: "DatePicker", sampleName: "DatePicker", screenName: "DatePicker" },
{ imgClass: "DateTimePicker", sampleName: "DateTimePicker", screenName: "DateTimePicker" },
{ imgClass: "TimePicker", sampleName: "TimePicker", screenName: "TimePicker" },
{ imgClass: "Editor", sampleName: "TextBoxes", screenName: "TextBoxes" },
{ imgClass: "RichTextBox", sampleName: "RichTextEditor", screenName: "RichTextEditor" },
{ imgClass: "AutoComplete", sampleName: "AutoComplete", screenName: "AutoComplete" },
{ imgClass: "DropDownList", sampleName: "DropDownList", screenName: "DropDownList" },
{ imgClass: "Slider", sampleName: "Slider", screenName: "Slider" },
{ imgClass: "ProgressBar", sampleName: "ProgressBar", screenName: "ProgressBar" },
{ imgClass: "grid", sampleName: "Grid", screenName: "Grid" },
{ imgClass: "Chart", sampleName: "Chart", screenName: "Chart" },
{ imgClass: "CircularGauge", sampleName: "CircularGauge", screenName: "CircularGauge" },
{ imgClass: "LinearGauge", sampleName: "LinearGauge", screenName: "LinearGauge" },
{ imgClass: "DigitalGauge", sampleName: "DigitalGauge", screenName: "DigitalGauge" },
{ imgClass: "TreeMap", sampleName: "TreeMap", screenName: "TreeMapFlatCollection" },
{ imgClass: "Maps", sampleName: "Maps", screenName: "Maps" },
{ imgClass: "RangeNavigator", sampleName: "RangeNavigator", screenName: "RangeNavigator" },
{ imgClass: "BulletGraph", sampleName: "BulletGraph", screenName: "BulletGraph" },
{ imgClass: "ReportViewer", sampleName: "ReportViewer", screenName: "ReportViewer" }
var root = $('<ul class="tile-ul"></ul>'), content = "";
$(element).append(root);
$(SampleList).each(function (i, val) {
content = "<li class='tile-li' data='" + val.screenName + "'> " +
"<div><span class= 'innerList tile-img " + val.imgClass + "'>" + "</span>"
+ "<span class= 'innerList tile-txt'>" + val.sampleName + "</span></div>"
+ "</li>"
$(root).append(content);
// to remove screen display name in layout
$(".msls-label").remove();
CSS:
/*Sample Layout design CSS*/
ul.tile-ul {
list-style-type: none;
margin: 30px 0;
padding: 0;
li.tile-li {
float: left;
font-size: 16px;
height: 157px;
width: 157px;
li.charttile-li {
float: left;
font-size: 16px;
height: 157px;
width: 157px;
li.charttile-li span.tile-img {
border: 1px solid #606161;
display: block;
height: 100px;
margin: 0 auto;
width: 100px;
background- center;
background-repeat: no-repeat;
background-color: #282827;
.charttile-li > div {
text-align: center;
li.charttile-li span.tile-img:hover {
border: 1px solid #606161;
background-color: #474747;
li.charttile-li span.tile-img:active {
border: 1px solid #606161;
background-color: #191818;
li.charttile-li span.tile-img.Chart {
background-image: url("SampleImg/Chart.png");
li.gridtile-li {
float: left;
font-size: 16px;
height: 157px;
width: 157px;
li.gridtile-li span.tile-img {
border: 1px solid #606161;
display: block;
height: 100px;
margin: 0 auto;
width: 100px;
background- center;
background-repeat: no-repeat;
background-color: #282827;
.gridtile-li > div {
text-align: center;
li.gridtile-li span.tile-img:hover {
border: 1px solid #606161;
background-color: #474747;
li.gridtile-li span.tile-img:active {
border: 1px solid #606161;
background-color: #191818;
li.gridtile-li span.tile-img.grid {
background-image: url("SampleImg/grid.png");
.tile-li > div {
text-align: center;
li.tile-li span.tile-img {
border: 1px solid #606161;
display: block;
height: 100px;
margin: 0 auto;
width: 100px;
background- center;
background-repeat: no-repeat;
background-color: #282827;
li.tile-li span.tile-img:hover {
border: 1px solid #606161;
background-color: #474747;
li.tile-li span.tile-img:active {
border: 1px solid #606161;
background-color: #191818;
li.tile-li span.tile-img.Editor {
background-image: url("SampleImg/Editor.png");
li.tile-li span.tile-img.grid {
background-image: url("SampleImg/grid.png");
li.tile-li span.tile-img.Employee {
background-image: url("SampleImg/EmpManage.png");
li.tile-li span.tile-img.CircularGauge {
background-image: url("SampleImg/Radial Gauge.png");
li.tile-li span.tile-img.DigitalGauge {
background-image: url("SampleImg/Digital Gauge.png");
li.tile-li span.tile-img.LinearGauge {
background-image: url("SampleImg/Linear Gauge.png");
li.tile-li span.tile-img.Chart {
background-image: url("SampleImg/Chart.png");
li.tile-li span.tile-img.RangeNavigator {
background-image: url("SampleImg/RangeNavigator.png");
li.tile-li span.tile-img.BulletGraph {
background-image: url("SampleImg/BulletGraph.png");
li.tile-li span.tile-img.TreeMap {
background-image: url("SampleImg/TreeMap.png");
li.tile-li span.tile-img.Maps {
background-image: url("SampleImg/Maps.png");
li.tile-li span.tile-img.ReportViewer {
background-image: url("SampleImg/ReportViewer.png");
li.charttile-li span.tile-img.MultipleAxes {
background-image: url("SampleImg/MultipleAxes.png");
li.charttile-li span.tile-img.Chart3D {
background-image: url("SampleImg/Chart3D.png");
li.charttile-li span.tile-img.LiveChart{
background-image: url("SampleImg/LiveChart.png");
li.charttile-li span.tile-img.CombinationChart {
background-image: url("SampleImg/CombinationChart.png");
li.charttile-li span.tile-img.DrillDown {
background-image: url("SampleImg/DrillDown.png");
li.gridtile-li span.tile-img.FlatGrid {
background-image: url("SampleImg/FlatGrid.png");
li.gridtile-li span.tile-img.Exporting {
background-image: url("SampleImg/Exporting.png");
li.gridtile-li span.tile-img.Summary {
background-image: url("SampleImg/Summary.png");
li.gridtile-li span.tile-img.ColumnTemplate{
background-image: url("SampleImg/ColumnTemplate.png");
li.tile-li span.tile-img.DatePicker {
background-image: url("SampleImg/DatePicker.png");
li.tile-li span.tile-img.DateTimePicker {
background-image: url("SampleImg/DateTimePicker.png");
li.tile-li span.tile-img.TimePicker {
background-image: url("SampleImg/TimePicker.png");
li.tile-li span.tile-img.RichTextBox {
background-image: url("SampleImg/RichTextBox.png");
li.tile-li span.tile-img.AutoComplete {
background-image: url("SampleImg/AutoComplete.png");
li.tile-li span.tile-img.DropDownList {
background-image: url("SampleImg/DropDownList.png");
li.tile-li span.tile-img.Slider {
background-image: url("SampleImg/Slider.png");
li.tile-li span.tile-img.ProgressBar {
background-image: url("SampleImg/ProgressBar.png");
.e-handle.e-select.ui-link {
margin: 0 0 0 -16px !important;
width: 28px !important;
height:17px !important;
.msls-label {
margin-bottom: 8px;
.innerList.tile-txt {
display: block;
word-wrap: break-word;
font-family: 'Segoe UI';
font-size: 14px;
color: #cececd;
margin-top:5px;
.innerList.tile-txt:hover {
color: #bababa;
.innerList.tile-txt:active {
color: #eaeaea;
.msls-header .msls-header-area {
padding: 2px 25px;
.msls-title-container .msls-title{
padding-top:2px;
h1.msls-title .msls-text-container, .msls-control-header .msls-text-container {
letter-spacing: 1px;
white-space: pre-line;
.ui-body-a, .ui-overlay-a {
background: none repeat scroll 0 0 #111111 !important;
.msls-dialog-inner-frame.ui-body-a.msls-rows-layout {
background: none repeat scroll 0 0 #111111 !important;
.msls-footer.ui-footer.ui-bar-a {
background-color: black !important;
.msls-dialog-inner-frame {
border-color:#484848 !important ;
.ui-header-fixed, .ui-footer-fixed {
z-index:0;
.msls-content {
padding-top:8px;
#msls-id-app-loading {
border-top-width:1px;
.msls-label.msls-label-align-left {
padding-top:7px;
.msls-tabs-container.ui-corner-all.ui-controlgroup.ui-controlgroup-horizontal {
padding-top: 12px;
@media (min-width: 320px) and (max-width:470px) {
li.tile-li, li.gridtile-li, li.charttile-li{
height: 150px;
width: 140px;
.msls-header .ui-title {
color: #eee;
font-family: "Segoe UI";
font-size: 13px;
@media (min-width: 480px) {
li.tile-li, li.gridtile-li, li.charttile-li{
height: 150px;
width: 147px;
Some things to notice are CSS classes are used to assign images and since it renders straight <UL> in a custom control, it prevents rendering all the extra DOM elements that LS tile list has - might make some customizations of look & feel
easier.
HTH,
Josh

Similar Messages

  • Can't tap on links in HTML overlays without the navigation menu popping up

    When I insert my html overlays, I'm trying to find a viable workaround for the following issue.
    If a user tries tapping any of the links to trigger animations I've created in my HTML, the content browser's navigation pops up at the same time as the link triggering the animation. This is similar to what I run into with other vendors like pixel mags.
    We recommended to them to have their navigation not pop-up unless a user double taps, 2 finger taps, or taps and holds the screen. Is there any type of distinction in the works for Adobe as well? Or are there any workarounds for this?
    Most of the time, it's almost too easy to get the navigation to pop-up when I was simply trying to trigger something else.
    Does this make sense? Apologies if this has already been addressed, and thanks.

    Yes it has been adressed, several times before.
    The one-tap solution for evoking the viewer UI seems to be a decision adobe
    will stick to for the next time.
    Although the html overlay triggers the viewer UI every time you tap a link,
    that was aknowledged as a problem and we read that adobe is working on a
    fix, don't know if it is included in the viewer that is currently under
    review by apple.
    —Johannes

  • Office 365 SharePoint online: How to create multi level top Navigation

    I having a requirement that we have a site structure which contains departmental sites and each site have multiple subsites.
    eg:
    Site 1: 
        sub site 1
        Sub site 2
    Site 2: 
        sub site 1
           sub site 1 (last node)
           sub site 2 (last node)
        Sub site 2
    Site 3
    and so on.
    I have to show site structure in top navigation, can you guide me how can we achieve this using SharePoint Design Manager or if their is any other way then please tell me.

    In snippet gallery, select top navigation from Ribbon, it will show snippet and customization details.
    In Customization - Top Navigation (ASP.NET) section, expand
    Important node and change value of StaticDisplayLevels
    to 2. After that expand Behavior node and change value of
    MaximumDynamicDisplayLevels to 2.
    Adnan Amin MCT, SharePoint Architect | If you find this post useful kindly please mark it as an answer.

  • Multi level navigation menus in iweb

    Hi iweb experts
    I am creating a website that has multi levels. Basically a main page that links to 2 other main pages one for each of my kids and would like to have the navigation menus reflect that fact in iweb.
    So on the main page should have only home, son1, son2
    and then on each on the main webs have the links specific to that website.
    I can do this multi level in frontpage just fine, can this be done in iweb as well. I know I can create many site and link them but it makes it harder to maintain the external links between each of the pages.
    Is there an easier way?
    Any help is appreciated.
    Thanks
    Samer

    No, iWeb does not do this, but you can do it without having to build your own nav menu.
    Use the page template navigation menu and have your main page in the navigation menu and this will show up - you can then have individual pages coming off this such as Person1 Person2 and when you create these pages they don't have to be in the navigation menu - all you do is open the Inspector and then open Page - the first one along and then click on "Don't show in navigation menu" and the "Don't include in navigation menu" options. On the two hidden or sub pages, which is what they are called, you can then place your own links such as Back and Next by using a text box or a shape.
    This can be done and using the ordinary navigation menu too.
    If you meant anything else, such a drop down menu - this requires a lot of code to be used and unless you know something about html and javascript I would not even bother to do it.

  • Images are not reflecting in Multi Level Menu

    Hi,
    i am facing some problem in the Multi Level Menu.
    i have created a book in my portal application.
    For the "Main Page Book" i am setting "Multi Level Menu"
    For the Book with in the menu, i am setting "No Navigation"(to avoid the sub pages displaying when clicking the book)
    for example the Book name is "Home".
    i want to replace the Home with some images.
    using "selected image" i have placed some .gif
    when i have checked at run time that image is not reflected.
    when i keep the menu as "Single level menu" images are coming. (but drop down is not coming)
    the problem is when i put the menu as "multi level menu" the images are not reflected.
    pls help me to solve this issue.
    regards.

    Hi,
    we've got the same issue in the project I'm working on. We told thos to BEA and they said that this is not coded. So 2 BEA's consultants are working on it for us. May be it will be included in the next version of WLP...
    Tom

  • Need help on Multi level menu implementation

    Hi All,
    Need help on Multi level menu implementation
    Thanks,
    Anu

    Hi Anu,
    Please go through this link Implement Multilevelmenu navigation
    Thanks,

  • I want to implement three level Horizental navigation on the top navigation and menu items are created based on the data available in a SharePoint List.

    Hi All,
    I want to implement three level Horizental navigation on the top navigation and menu items are created based on the data available in a SharePoint List.
    Implement this requirement through customization, how can i start any help
    Thanks

    Hello,
    You can follow these links to get the result that you want. You can get the desired result either using the custom list or a site map. Please make sure when you edit the master page, dont work on the original v4.master. Always make a a copy and then work
    on it.
    This link will show you how get that navigation using a list.
    http://www.bitsofsharepoint.com/BlogPoint/Lists/Posts/Post.aspx?ID=60
    This link will show you how get that navigation using a sitemap.
    http://www.sharepointdiary.com/2012/01/custom-top-navigation-using-sitemap.html
    Please mark as "Answered" if this helped you.
    Thanks,
    norasampang

  • Show 2 level hierarchy in Managed Navigation menu(Current Navigation) in SharePoint 2013

    We have enabled Managed Navigation in SharePoint 2013 Publishing Site. Now when a user browses a page we want to show the current page siblings are its parent links in the Managed Navigation. Right now its showing only current page siblings in managed navigation.
    Is there any way to show current page parent links in Managed Navigation menu?
    For example I have a term set enabled for managed navigation with following terms:
    Level1
        Level 1.1
            Level 1.1.1
            Level 1.1.2
            Level 1.1.3
    Level 2
        Level 2.1
            Level 2.1.1
    Level 3
        Level 3.1
    Level 4
        Level 4.1 
    Now if a user is on page Level1.1.1 then Current Navigation should show following hierarchy in using Managed Navigation :
    Level 1.1
        Level 1.1.1 -> This node will be shown as selected
        Level 1.1.2
        Level 1.1.3
    Level 2.1
    Level 3.1
    Level 4.1
    Is the above behaviour possible by doing any out of box configuration or using SharePoint designer?
    Thanks,
    Anna Jhaveri

    Ha i was given the same task by my client but they wanted it to be done in client side rather than creating new user control and inheriting from actual control.
    i used Jquery and css to achieve staticlevel 3+  left navigation in sharepoint 2013. first of all let me explain the structure i had created.
    HR department
     -->Level 1
    ---->Level 1.1
    ------>Level 1.1.1
    ------>Level 1.1.2
    -->Level 1.2
     (same as above structure)
    all i did was setting up the staticlevel ="2" and dynamiclevel="3"
    so this would make left navigation with two level  and remaining of its sub sites as flyouts
    Part-1:
    so i used Js to convert all the flyout(dynamic class ) to static $(function(){  
    $("ul.dynamic").removeClass('dynamic').addClass('static');$(".dynamic").removeClass('dynamic').addClass('static');  $(".static").removeClass('dynamic-children'); $("#zz12_RootAspMenu > li:nth-child(n) > ul").removeClass('dynamic-children');
    $("leftnavigation ID"> li:nth-child(n) > ul > li.static > ul").removeClass('dynamic-children');              $("leftnavigation ID" > li:nth-child(n) > ul > li.static > ul > li:nth-child(n) > ul").removeClass('dynamic-children')
    $(".ms-navedit-flyoutArrow").removeClass('dynamic-children').removeClass('ms-navedit-flyoutArrow');
    by using this script all the dynamic classes get convert to static. after getting rid of classes call "dynamic" and "dynamic-children"
    second part :
    now we have convert all the dynamic level to static (just look wise) but functionally  its behaviors is like flyout menu items.so the following js adds the static behavior classes so it just functions like static menu
    $(function()
    var path = window.location.pathname;
    path = path.replace(/\/$/, "");
    path = decodeURIComponent(path)
    $("left nav ID" > li > ul > li.static.selected > ul > li > a").each(function () {
    var href = $(this).attr('href');
    if (path.substring(0, href.length) === href)
    $(this).closest('li').addClass('selected');
    $(this).removeClass('ms-core-listMenu-selected').addClass('selected').addClass('ms-core-listMenu-selected');
    else
    $(this).closest('li').removeClass('selected');
    $(this).removeClass('selected').removeClass('ms-core-listMenu-selected');
    How above code works:
    it  takes the url path of current page and compare it with the all the anchor elements href ,so when it finds the match it would go insert the static level class  like "selected" in the <li> and "ms-core-listMenu-selected" in the <a>
    tag so  they function like static.
    so i have done it for 4 levels so i had to put one more function as shown above to target and read <a> tag href values for 4th level and compare it with current page url.
    i didn't explain in detail in here, i'll be writing up again on this issue on  my blog with screen captures soon.
    Till then you can leave comments and questions.
    Disadvantage :this doest work if you have anything listed other then Subsites(pages,list,libraries) in left navigation.

  • Iweb page modified with a simple html editor , now not display navigation menu

    Hello i've designed a site http://www.ballettgastini.ch with Iweb and was working till i've the needs to update a simple text in one page and get it via ftp from the server, modified with a simple html editor !!!!, and update via ftp on the server. now the page do not diplay the navigation menu bar !!!! the page is here  : http://www.ballettgastini.ch/stundenplan.html ... any suggesion ? i'm working now with a new imac with no possibility to modify the entire web site on the server...but the need it's really to change few text lines so i think to use a simple html editor... any ideas ? thanks luca giay turin italy

    Why not continue in the topic you started earlier?
    https://discussions.apple.com/message/21158910#21158910
    Anyway, the scripts folder with essential files is missing :
    http://www.lakesweddingmusic.com/Scripts/iWebImage.js
    + more
    And this is missing too :
    http://www.lakesweddingmusic.com/feed.xml
    No feed, no menu.
    And we keep finding more webpage. This one is made with iWeb 1
    http://www.lakesweddingmusic.com/The_Barn.html

  • Second level navigation menu not highlighted

    Hello Experts,
    We have a par file which is redirecting to a third party website from portal using Response.sendRedirect.Here the issue is when the third party website opens in the same window in portal,second level navigation menu is not getting highlighted,its still highlighting the previously selected menu.We are on EP6 SP16.
    Thanks in advance,
    Suresh

    Hi Suresh,
    I guess that's because you are just redirecting the page & this doesn't refresh the Navigation nodes.
    Hence just try adding the below code before redirection.
    refreshPage() ;
    function refreshPage() {
    try {
    frameworkSupport.refreshContentArea();
    } catch(e) {
    document.location.reload()
    Redeploy and check. I think it should work.
    Regards,
    Santhosh

  • The multi level "isolation mode" don't work after the last upgrading to Illustrator CC 18.1.0? by the right mouse button menu

    PROVA

    Yes, I know that, but I ever work with the right mouse button,
    because selecting groups and subgroups with double click make some confusion for me.
    Regards,
    Fabio
    ufficio tecnico
    grafica e prestampa
    Via Verdi, 11 - 43058 Sorbolo (PR)
    Tel. 0521.694111 - Fax 0521.694360
    E-mail: [email protected] <mailto:[email protected]>
    E-mail: [email protected] <mailto:[email protected]>
    Web: www.litoexpress.it <http://www.litoexpress.it/>
    Il giorno 28/ott/2014, alle ore 06:57, Satinder S Bains <[email protected]> ha scritto:
    The multi level "isolation mode" don't work after the last upgrading to Illustrator CC 18.1.0? by the right mouse button menu
    created by Satinder S Bains <https://forums.adobe.com/people/SatinderSBains> in Illustrator - View the full discussion <https://forums.adobe.com/message/6874053#6874053>
    You can double click on the selected object to get into the multilevel isolation mode.
    Regards,
    Satinder
    Please note that the Adobe Forums do not accept email attachments. If you want to embed a screen image in your message please visit the thread in the forum to embed the image at https://forums.adobe.com/message/6874053#6874053
    Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page:
    To unsubscribe from this thread, please visit the message page at . In the Actions box on the right, click the Stop Email Notifications link.
    Start a new discussion in Illustrator by email <mailto:[email protected]m> or at Adobe Community <https://forums.adobe.com/choose-container.jspa?contentType=1&containerType=14&container=33 67>
    For more information about maintaining your forum email notifications please go to http://forums.adobe.com/thread/416458?tstart=0 <http://forums.adobe.com/thread/416458?tstart=0>.

  • Extending Screens for Multi-Select in the LightSwitch HTML Client

    Hi i
    read Mike Droney's article of 
    Extending Screens for Multi-Select in the LightSwitch HTML Client
    But i just want to understand the code, so what is the ‘__isSelected’ property? from where does it come?
    why does the contentItem.value.details have an ‘__isSelected’ property?
    is the value of the contentItem not the screen?
    and also how can i implement the ‘Can Execute Code’ only if one or more check boxes are checked?
    Thanks  

    But i just want to understand the code, so what is the ‘__isSelected’ property? from where does it come?
    why does the contentItem.value.details have an ‘__isSelected’ property?
    is the value of the contentItem not the screen?
    and also how can i implement the ‘Can Execute Code’ only if one or more check boxes are checked?
    The '__isSelected' property is a private member of the class msls.ContentItem related to the backing data for the selected item.  That is to say, it would be a private member if JavaScript actually had encapsulation and information hiding like a typical
    object-oriented language. I like to reference David Herman's description from his book
    Effective JavaScript:
    Often, JavaScript programmers resort to coding conventions rather than any absolute enforcement mechanism for private properties. For example, some programmers use naming conventions such as prefixing or suffixing private property names with an underscore
    character (_). This does nothing to enforce information hiding, but it suggests to well-behaved users of an object that they should not inspect or modify the property so that the object can remain free to change its implementation.
    ...which means that it's generally not recommended to directly get or set backing data properties like __isSelected, instead working with the public property 'selectedItem', although it may work fine in certain cases like this one.
    To make _canExecute fire only when an item in the list is selected to enable a button method, try:
    return (screen.Contacts.selectedItem !== null);

  • Occasionally Connected LightSwitch HTML Apps Using JayData

    JayData, as many are probably aware from prior blog posts and discussions on this forum, is a powerful JavaScript utility library for OData providers, including LightSwitch. 
    Recently, the JayData developers have expanded the
    provider offerings to include many other database programmatic interfaces. 
    Their latest release, JayData 1.3.6, codenamed “Advanced Sync Edition,” aims to support occasionally connected apps by exploiting the local storage capability of the browser (Web SQL. sqLite, IndexedDb, etc.). 
    Development is simplified when using the same data model and API for writing to both local storage and the OData endpoint.
    An example of this is shown at How to Create a Synchronized Online-Offline Data App with JavaScript and JayData. 
    This model, the “To Does” project, was successfully adapted to a LightSwitch HTML app without difficulty. 
    Although “To Does” projects like this serve as a nice proof-of-concept, they are excessively simple compared to real world business applications. 
    Fortunately, JayData 1.3.6 also includes support for configurable foreign keys. 
    With this, more complex object-relational mapping that would typically be used with Entity Framework and similar RDBMS may be approximated.
    To illustrate, the To Does project was expanded to include entity relationships. 
    Specifically, a To Do must be assigned to a single individual Project, and any single Project can have many To Does. 
    A Project can be assigned to an Employee or to multiple Employees, while an Employee can have a single Project or many Projects, thus defining a many-to-many relationship between Employee and Project.
    So how might and online-offline LightSwitch HTML application work in practice? 
    Ideally in my opinion, the transition from online to offline and back should be seamless and transparent to the user, allowing for both UX and UI to be unperturbed. 
    This approach turned out to be too difficult for me as a developer, as I experienced problems with the closed-end nature of LightSwitch’s Visual Collection object, for instance. Separation of concerns is a real challenge with this approach.
     There is also the separate UI approach for both offline and online data entry, which have been nicely illustrated by Michael Washington and Paul van Bladel on their blogs using JayData and BreezeJS with AngularJS alongside a LightSwitch HTML
    app.  This approach is valid, and from the viewpoint of the developer has its advantages. From a design standpoint, it is likely to be frustrating for an end-user who must deal with “spotty” network coverage, necessitating changing back-and-forth
    from one UI to another.
    I opted for a hybrid approach, staying entirely inside the LightSwitch HTML app environment but having individual menu options to select depending on the user’s online status, which is constantly displayed with a status icon (see Main Menu figure). 
    In many cases, the native LightSwitch screen and menu buttons are fully functional in the offline state. 
    When they are not, most often with regard to a “Browse” screen or involving a Visual Collection, I have substituted the updated WinJS library (now at
    version 4.0, capable of replacing LightSwitch’s v1.0 with no breaking changes) to create a custom control that resembles the LightSwitch listview.
    To use the app, you can use any of the online Menu buttons to enter Employee, Project, or To Do data in the usual way while connected.
      The Offline menu buttons are functional in either a connected or disconnected status, which can be tested by disabling your devices WiFi, for example. 
    This LightSwitch app does not work with all browsers, however. 
    Because the local database is stored using the Web SQL/sqLite JayData API, it is not supported by either IE or FireFox. 
    It is supported by Chrome, Safari, Opera, Android browsers, Kindle Fire, and iPad browsers
    (see link). 
    To see the local data stored in Web SQL while using Chrome, you can press F12, select Resources, and expand Web SQL to see the Table data updated with each transaction (see figure).
    After entering data using the Offline menu selections, you will want to synchronize your local data with the remote LightSwitch database, which is performed by clicking “Synchronize Offline to Online” on the Main Menu. 
    A success or error dialog message should follow, depending on the result of the sync. 
    The dates and times of the last synchronizations are displayed on the Main Menu. 
    With each online database transaction, including offline to online syncs, the offline database is updated to reflect the very latest LightSwitch application data. 
    This method attempts to have the LightSwitch online database as the “single source of truth” as much as possible while the user is online.
    Lastly (if anyone is still reading this far), note that by design there is no business logic programmed into this application; business logic is a separate issue to be addressed. 
    There can be as many incomplete To Does as you want, an Employee can be assigned the same Project many times, etc. 
    If your application requires business logic, you will have to program it into the client-side in order for the user to be prompted to follow it while offline.
    To experiment with LightSwitch OfflineToDoes app, go to:
    http://offlinetodoes.azurewebsites.net/htmlclient
    …and log in with username “testuser” and password “Testuser1!” 
    In a few days I will try to load the sample project code to MSDN for anyone to download and review if desired.
    TL;DR:
    JayData provides an attractive solution for creating online-offline LightSwitch HTML apps by automating a single codebase to carry out CRUD operations on both a local datasource and the remote LightSwitch database. 
    Integrating the offline portion of the app into the LightSwitch UI requires an individualized solution and is code-intensive, however.

    Thank you both for the input. Zardoz, I tried making a couple of updates to address items you mentioned.  I left unfixed the problem that occurs when editing an offline Project's budget item..this still does not work.  LightSwitch identifies this
    entity as a decimal, WebSql expects a plain number, but LightSwitch's post-processing business type formats it to currency (I see USD, you may see NZD, AUD, etc.)  In the console there is a "getModel() is undefined" in msls.js.  If I take
    out the Money business type to regular Text on the View, it works fine.
    I'm not sure if I understood your last item just right, but I tweaked the Add Edit Offline Project screen to prevent the Project from being null if the user only enters a new To Do. Not sure why the screen validation wasn't firing before.
    Regarding navigation, I don't wish to use the browser's back or forward buttons at all for the app, especially the Offline portion, only the LightSwitch menu navigation and command buttons. I know Xpert360 has shown how to put the former LightSwitch back
    button in the app which is useful too. Navigation, cacheing and disposing were some of the tricky parts getting to integrate between LightSwitch UI and offline custom controls.  Occasionally I felt like I was having to be "clever" at solutions,
    except that when it comes to programming, I'm not a fan of cleverness.
    The project is published
    here. Hopefully this serves as a good starting point for someone, and I look forward to seeing how it can be improved upon and used in practice.

  • Nested Navigation Menu, Pure CSS

    Argh! Can anyone help me perfect my nested navigation menu?? I had originally built it as a single level vertical menu, but now need to add 2 more levels. I got the second level working fine, except I can't get the rollover effect to line up correctly for the life of me!
    In Dreamweaver Live View, the highlighted effect (an image rollover) and the link text jumps up and to the left. When I test in IE8 or Firefox 3.5.7, the rollovers for the second level don't even appear.
    This is my first time using nested ul's for a menu, so I'm thoroughly confusing myself.
    Here's a page with the menu in place (left side):
    http://www.wdi-whq.com/pages/about-us.html
    And here's my css. The menu section rules are under "3. Navigation Code".
    http://www.wdi-whq.com/css/wdi-basic.css
    Any help is greatly appreciated!

    I tweaked with this some more yesterday. It seems to be working just fine today as far as my spacing and things lining up. I just need to shorten Black and White Copies to Black
    & White Copies so it will fit within the width of my background image. I think I simplified my rules, and changed the second-level hover rule to match the first-level one.
    Martyn, your rule helped me fix my problem with the highlight hover effect not working on the second and third levels. Yeah! I just didn't know how to target those nested levels. Thanks so much for your help!

  • Problem with jquery slide show conflict with vertical navigation menu in Firefox & Chrome

    Problem with jquery slide show conflict with vertical navigation menu in Firefox & Chrome. Works in IE. This is my first time trying to post a question - so please be kind. I am also not good with code and am finding css a real challenge after learning to design based on tables. I'm using CS5.
    The "test" page with the slide show is: http://www.reardanwa.com/index-slides.html   The same page without the slide show is http://www.reardanwa.com/
    I realize the images are not ideally sized - I'll fix those once I get the pages to function.  Maybe I need a different slide show? I would prefer a widget that I can modify to required size & postition. Again - I'm not good at building with code from scratch.
    The problem is the naviagation links that are directly next to the slide show do not work in Firefox of Chrome. They do work in IE.
    I've read about using jQuery.noConflict(); code but can't figure out the correct way to use it in my case or whether that's even part of the solution. I know my code is not well organized as I have cobbled together from various sources in an attempt to format the page the way the client wants it. Also, FYI, I will eventually try to make the page work in Surreal CMS.
    I've spent sevaral days over the last several weeks trying to solve sth slide show/navigation conflict - so any specific light you can shed will be much appreciated.
    Thanks in advance.
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Reardan Area Chamber of Commerce</title>
    <meta name="description" content="home page for Reardan Area Chamber of Commerce" />
    <meta name="keywords" content="Reardan WA, chamber of commerce" </>
    <script src="scripts/jquery-1.6.min.js" type="text/javascript"></script>
    <script src="scripts/jquery.cycle.all.js" type="text/javascript">  </script>
    <script type="text/xml">
    </script>
    <style type="text/css">
                                  #slideshow { 
                                      padding: 10px;
                                            margin:0; 
                                  #slideshow-caption{
                                            padding:0;
                                            margin:0;
                                  #slideshow img, #slideshow div { 
                                      padding: 10px;
                                      background-color: #EEE;
                                      margin: 0;
    body {
              font: 100%/1.4 Verdana, Arial, Helvetica, sans-serif;
              background: #004B8D;
              margin: 0;
              padding: 0;
              color: #000;
    /* ~~ Element/tag selectors ~~ */
    ul, ol, dl { /* Due to variations between browsers, it's best practices to zero padding and margin on lists. For consistency, you can either specify the amounts you want here, or on the list items (LI, DT, DD) they contain. Remember that what you do here will cascade to the .nav list unless you write a more specific selector. */
              padding: 0;
              margin: 0;
    h1, h2, h3, h4, h5, h6, p {
              margin-top: 0;           /* removing the top margin gets around an issue where margins can escape from their containing div. The remaining bottom margin will hold it away from any elements that follow. */
               /* adding the padding to the sides of the elements within the divs, instead of the divs themselves, gets rid of any box model math. A nested div with side padding can also be used as an alternate method. */
    .left
    position:absolute;
    left:0px;
    .center
    margin:auto;
    width:95%;
    .box
              position:relative;
              left:-90px;
              width:950px;
              height:350px;
              border-radius: 13px;
        -moz-border-radius: 13px;
        -webkit-border-radius: 13px;
              z-index:1000;
    .slide{
        position:absolute;
    a img { /* this selector removes the default blue border displayed in some browsers around an image when it is surrounded by a link */
              border: none;
    /* ~~ Styling for your site's links must remain in this order - including the group of selectors that create the hover effect. ~~ */
    a:link {
              color: #42413C;
              text-decoration: underline; /* unless you style your links to look extremely unique, it's best to provide underlines for quick visual identification */
    a:visited {
              color: #6E6C64;
              text-decoration: underline;
    a:hover, a:active, a:focus { /* this group of selectors will give a keyboard navigator the same hover experience as the person using a mouse. */
              text-decoration: none;
    /* ~~this fixed width container surrounds the other divs~~ */
    .container {
              width: 960px;
              min-height:900px;
              padding:5px 0px 0px 0px;
              background: #E8F8FF;
              margin: 0 auto; /* the auto value on the sides, coupled with the width, centers the layout */
    /* ~~ the header is not given a width. It will extend the full width of your layout. It contains an image placeholder that should be replaced with your own linked logo ~~ */
    .header {
              background: #E8F8FF;
              padding:10px 5px 0px 5px;
    .sidebar1 {
              float: left;
              width: 225px;
              margin: 60px;
              color: #FFFF0D;
              background: #595FFF;
              border-radius: 13px;
        -moz-border-radius: 13px;
        -webkit-border-radius: 13px;
              padding: 5px 5px 0px 5px;
        border: 3px solid #F7F723;
        z-index:-1;
    .sidebar2 {
              float: left;
              width: 275px;
              color: #FFFF0D;
              text-align: left;
              background: #595FFF;
              padding-bottom: 10px;
              border-radius: 13px;
        -moz-border-radius: 13px;
        -webkit-border-radius: 13px;
        border: 3px solid #F7F723;
        z-index:2;
    .sidebar3 {
              float: left;
              width: 275px;
              color: #FFFF0D;
              text-align: left;
              background: #595FFF;
              padding-bottom: 10px;
              border-radius: 13px;
        -moz-border-radius: 13px;
        -webkit-border-radius: 13px;
        border: 3px solid #F7F723;
        z-index:3;
    .content {
              padding: 0px 0px 0px 0px;
              width: 780px;
              float: left;
              background: #E8F8FF;
    /* ~~ This grouped selector gives the lists in the .content area space ~~ */
    .content ul, .content ol {
              padding: 0px 15px 5px 10px; /* this padding mirrors the right padding in the headings and paragraph rule above. Padding was placed on the bottom for space between other elements on the lists and on the left to create the indention. These may be adjusted as you wish. */
    /* ~~ The navigation list styles (can be removed if you choose to use a premade flyout menu like Spry) ~~ */
    ul.nav {
              list-style: none; /* this removes the list marker */
              border-top: 0px solid #FFFF66; /* this creates the top border for the links - all others are placed using a bottom border on the LI */
              margin-bottom: 50px; /* this creates the space between the navigation on the content below */
              font: Arial Black, Verdana, , Helvetica, sans-serif;
              font-size:1.3em;
              font-weight:bold;
              z-index:2;
    ul.nav li {
              border-bottom: 0px solid #FFFF66; /* this creates the button separation */
              font: 120%/1.4 Arial Black, Verdana, , Helvetica, sans-serif;
    ul.nav a, ul.nav a:visited { /* grouping these selectors makes sure that your links retain their button look even after being visited */
              padding: 3px 0px 5px 0px;
              display: block; /* this gives the link block properties causing it to fill the whole LI containing it. This causes the entire area to react to a mouse click. */
              width: 185px;  /*this width makes the entire button clickable for IE6. If you don't need to support IE6, it can be removed. Calculate the proper width by subtracting the padding on this link from the width of your sidebar container. */
              text-decoration: none;
              color: #FFFF0D;
              background: #595FFF;
    ul.nav a:hover, ul.nav a:active, ul.nav a:focus { /* this changes the background and text color for both mouse and keyboard navigators */
              background: #595FFF;
              font: 120%/1.4 Arial Black, Verdana, , Helvetica, sans-serif;
              color: #FFFFFF;
    /* ~~ The footer ~~ */
    .footer {
              padding: 10px 0;
              background:  #595FFF;
              color: #FFFF0D;
              position: relative;/* this gives IE6 hasLayout to properly clear */
              clear: both; /* this clear property forces the .container to understand where the columns end and contain them */
    /* ~~ miscellaneous float/clear classes ~~ */
    .fltrt {  /* this class can be used to float an element right in your page. The floated element must precede the element it should be next to on the page. */
              float: right;
              margin-left: 8px;
    .fltlft { /* this class can be used to float an element left in your page. The floated element must precede the element it should be next to on the page. */
              float: left;
              margin-right: 8px;
    .clearfloat { /* this class can be placed on a <br /> or empty div as the final element following the last floated div (within the #container) if the #footer is removed or taken out of the #container */
              clear:both;
              height:0;
              font-size: 1px;
              line-height: 0px;
    -->
    </style>
    </head>
    <body>
    <div class="container">
      <div class="header"><!-- end .header -->
      <a href="#"><img src="images/Chamber-Logo-2.gif" alt="Reardan Chamber Logo" width="187" height="163" hspace="10" vspace="5" align="top" /></a><img src="images/Reardan-Chamber-Title.gif" width="476" height="204" alt="Reardan Area Chamber of Commerce, Dedicated to Preserving and Enhancing Area Businesses" /><p></p>
      <p style="color: #F00">This Site is under construction! Please pardon our dust as we create!</p>
      </div>
      <div class="sidebar1">
        <ul class="nav">
          <li><a href="about.html">About Us</a></li>
          <li><a href="history.html">Reardan History</a></li>
          <li><a href="activities.html">Activities</a></li>
          <li><a href="business.html">Business<br />
            Directory</a></li>
          <li><a href="about.html">Join the<br />
            Chamber</a></li>
           <li><a href="links.html">Links<br />
      <span style="font-size: 85%">Tourism</span><br />
          </a></li>
        </ul>
         <!-- end .sidebar1 --></div>
    <br />
    <br />
    <br />
    <br />
    <div class="box" +"slide">
      <script type="text/javascript">
    // BeginOAWidget_Instance_2559022: #slideshow
                               slideshowAddCaption=true;
    $(window).load(function() {
      $('#slideshow').cycle({
                        after:                              slideshowOnCycleAfter, //the function that is triggered after each transition
                        autostop:                              false,     // true to end slideshow after X transitions (where X == slide count)
                        fx:                                        'blindX',// name of transition effect
                        pause:                              false,     // true to enable pause on hover
                        randomizeEffects:          true,  // valid when multiple effects are used; true to make the effect sequence random
                        speed:                              100,  // speed of the transition (any valid fx speed value)
                        sync:                              true,     // true if in/out transitions should occur simultaneously
                        timeout:                    5000,  // milliseconds between slide transitions (0 to disable auto advance)
                        fit:                              true,
                        height:                       '300px',
                        width:         '525px'   // container width (if the 'fit' option is true, the slides will be set to this width as well)
    function slideshowOnCycleAfter() {
              if (slideshowAddCaption==true){
                                  $('#slideshow-caption').html(this.title);
    // EndOAWidget_Instance_2559022
      </script>
      <div id="slideshow">
        <!--All elements inside this will become slides-->
        <img src="images/100_1537.jpeg" width="600" height="450" title="caption for image1" /> <img src="images/Parade-2011-2.jpg" width="300" height="225" title="caption for image2" /> <img src="images/100_1495.jpeg" width="600" height="450" title="caption for image3" />
        <div title="sample title"> Images for slide show will need to be re-sized to fit box to avoid distortion</div>
        <img src="images/beach4.jpg" width="200" height="200" title="caption for image4" /> <img src="images/beach5.jpg" width="200" height="200" title="caption for image5" /> </div>
      <!--It is safe to delete this if captions are disabled-->
      <div id="slideshow-caption"></div></div>
    <div class="sidebar2" "anotherClass editable"><p align="center"><strong>Chamber News</strong><br />
    Local News item
    <br />
    Another New item</p>
      <p align="center">lots of news this week<br />
        <br />
        <br />
        <br />
      </p>
    </div>
    <div class="sidebar3" "anotherClass editable"><p align="center"><strong>Upcoming Events</strong></p>
      <div align="center">    <a href="activities.html" style="color: #FFFF0D">Community wide yard sales</a><br />
        <br />
        <br />
        <br />
        <br />
      </div>
    </div>
    <div class="content"><br />
    <br />
    </div>
    <div class="footer">
            <p align="center"><span style="font-size: small">Reardan Area Chamber of Commerce</span><br />
              <span style="font-size: x-small">[email protected]  - 509.796.2102</span><br />
            </p>
            <!-- end .footer -->
    </div></body>
    </html>

    If you DO want the slideshow overlaping the navigation try the below css:
    .sidebar1 {
        float: left;
        width: 225px;
        margin: 60px 0px 60px 60px;
        color: #FFFF0D;
        background: #595FFF;
        border-radius: 13px;
        -moz-border-radius: 13px;
        -webkit-border-radius: 13px;
        padding: 5px 5px 0px 5px;
        border: 3px solid #F7F723;
    .box {
    float: left;
    margin-left:-60px;
    width:700px;
    height:350px;
    border-radius: 13px;
    -moz-border-radius: 13px;
    -webkit-border-radius: 13px;

Maybe you are looking for