Solved

Lightswitch

Posted on 2014-02-19
4
276 Views
Last Modified: 2014-02-24
Hi Experts,

I'm developing a LightSwitch application.
I have and add/edit screen where I would like to disable a drop down list(combo box) if it is in edit mode.

I know how to disable a control. But just don't know how to do it only in edit mode .

 screen.findContentItem("mycombo").isEnabled = false;
0
Comment
Question by:MrStevenWin
  • 2
  • 2
4 Comments
 
LVL 8

Accepted Solution

by:
Jean Marie Geeraerts earned 210 total points
ID: 39871122
Hi, to know if your screen is used to edit/add a new entity. You can check the EntityState on the Property used in the screen.

The code would look something like:

screen.findContentItem("mycombo").isEnabled =  NameOfYourEntityProperty.Details.EntityState != EntityState.Added;

Open in new window

Where "NameOfYourEntity" would be the name of the entity you used to generate the screen.
0
 

Author Closing Comment

by:MrStevenWin
ID: 39873413
Below solved the issue. Thanks for your help!

myapp.AddEditLoanMaster.created = function (screen) {
    // Write code here.

   
    if (screen.myscreen.details.entityState != msls.EntityState.added) {
        screen.details.displayName = "Details Edit ";
        screen.findContentItem("mycontrol").isEnabled = false;
    }
 
};
0
 
LVL 8

Expert Comment

by:Jean Marie Geeraerts
ID: 39876249
You're welcome.
0
 

Author Comment

by:MrStevenWin
ID: 39882940
Hi Jerrith,

Could you pls. help me with my lightswitch question below?

www. experts-exchange .com/ Web_Development/WebApplications/Q_28372843.html

Thanks.
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

In this Article, I will provide a few tips in problem and solution manner. Opening an ASPX page in Visual studio 2003 is very slow. To make it fast, please do follow below steps:   Open the Solution/Project. Right click the ASPX file to b…
I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now