Using Code Behind Technique and Popups

I am starting to use the code-behind technique a bit more
lately and have run into a problem.
If I try to open a popup using a class that has a separate
mxml and backing .as file, I get a null object reference.
var pu : PopupClass =
PopupClass(PopUpManager.createPopUp(this, PopupClass, true))
where PopupClass.mxml extends PopupClassCode.as (which in
turns extends BaseForm which extends DragPanel)
Has anyone successfully done what I'm trying to do? It seems
that it should be easy.
Tony

I am starting to use the code-behind technique a bit more
lately and have run into a problem.
If I try to open a popup using a class that has a separate
mxml and backing .as file, I get a null object reference.
var pu : PopupClass =
PopupClass(PopUpManager.createPopUp(this, PopupClass, true))
where PopupClass.mxml extends PopupClassCode.as (which in
turns extends BaseForm which extends DragPanel)
Has anyone successfully done what I'm trying to do? It seems
that it should be easy.
Tony

Similar Messages

  • AdvancedDataGrid ItemRenderer Issue using code behind method

    I have been trying to get an itemrenderer to correctly work in an advanveddatagrid. I've used several itemrenderers in the past so this is pretty basic. I haven't however tried to attach to a grid that is inside a page using the code behind method. My issue is that the grid breaks if I try to put more than one visual component on the renderer. See the images below:
    Here is an example with a plain canvas itemrenderer:
    As you can see the scroll bar appears and everything looks normal.
    Here is the behavior if I add a label inside this component:
    The scroll bar disappears and I'm unable to close the itemrenderer correctly.
    Has anyone come across this issue before? Thanks for any help on this one!

    I can't post all of the code since it's on a much larger page but hopefully this gives you an idea:
    <custom:ClientPlans xmlns:mx="http://www.adobe.com/2006/mxml" width="920" height="550" xmlns:flexlib="http://code.google.com/p/flexlib/"
            fontFamily="HelveticaNeue Condensed" fontSize="11"
            xmlns:components="components.*"
            disabledColor="#FFFFFF"
            themeColor="#FFFFFF"
            horizontalScrollPolicy="off"
            verticalScrollPolicy="off" 
            backgroundColor="#ffffff"
            cornerRadius="10"
            borderStyle="solid"
            borderThickness="0"
            horizontalCenter="0" verticalCenter="0" color="#808080">
    <mx:AdvancedDataGrid id="adgPlans" width="100%" height="497" selectionMode="singleRow" editable="false"
                            color="#000000" fontSize="14" selectable="true"
                            liveScrolling="false"
                            showHeaders="false" variableRowHeight="true"
                            disclosureOpenIcon="@Embed(source='/images/gridMinus.png')"
                            disclosureClosedIcon="@Embed(source='/images/gridPlus.png')"
                            folderOpenIcon="@Embed(source='/images/folderOpenIcon.png')"
                            folderClosedIcon="@Embed(source='/images/folderclosedIcon.png')" borderThickness="1" borderStyle="solid">
                              <mx:dataProvider>
                                     <mx:GroupingCollection id="gcGroup">
                                            <mx:grouping>
                                                <mx:Grouping>
                                                    <mx:GroupingField name="ClientName"/>
                                                </mx:Grouping>
                                            </mx:grouping>
                                     </mx:GroupingCollection>
                              </mx:dataProvider>       
                            <mx:columns>
                                <mx:AdvancedDataGridColumn id="clientNameColumn" dataField="clientName" headerText="Client" sortable="true" width="200" />
                            </mx:columns>
                            <mx:rendererProviders>
                                <mx:AdvancedDataGridRendererProvider
                                    column="{clientNameColumn}"
                                    columnSpan="0"
                                    depth="2"
                                    renderer="components.subcomponents.clientRenderer3"/>
                            </mx:rendererProviders>
                        </mx:AdvancedDataGrid>
    </custom:ClientPlans>
    Code-Behind:
    // ActionScript file
    package com.name
            import mx.controls.AdvancedDataGrid;
        public class ClientPlans extends Canvas
            public var adgPlans:AdvancedDataGrid;
         public function ClientPlans ()
                super();
                this.addEventListener(FlexEvent.CREATION_COMPLETE, creationCompleteHandler);
            private function creationCompleteHandler (event:FlexEvent):void
                  trace("cc");
    Item Renderer:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml"
        width="100%" height="150" borderStyle="solid" borderThickness="2" borderColor="#56ACD1" cornerRadius="8"
        fontFamily="HelveticaNeue Condensed" color="#000000" backgroundColor="#FFFFFF" backgroundAlpha="1.0">
        <mx:Label text="Hello!?"/>
    </mx:Canvas>

  • Is there anywhere where Apple describes the function and use of every field and popup and checkbox in the email setup "panes"???

    So you call up an account in email
    Account Information is selecgted in the 3-choice menu-bar/button (what is that thing called, anyway? An "inspector"? (frown).
    Then check "enable this account"--is selectable
    Then Account type: iCloud IMAP or example--this is NOT selectable.
    Then "Description field" What's it for, where does it show up, especially if it shows up in other "related" or "integrated" programs?
    Alias popup: What's this for? How do you use it. What approaches, strategies, effects might one employ?
    Email address is pretty straight forward--but see "user.name" in the "server sub-box/sub-pane" below.
    Full Name:  What full name? Where does it appear in use? I cannot access it from the pane/panel, so how do I set it, or who/what sets it?
    Outgoing mail server (SMTP): OK, here's a popup that isn't congruent with "account type" in the first sub-pane. Or is IMAP only an extroverted function/setting, and (SMTP) is a introverted one (IMAP for outbound, SMTP for inbound)?
    Now comes Confusion: Outgoing Mail Server popup menu, which leads you off to a wholenother pane that lets you create new/delete old incoming server names.
    There's a Description (what's that for, what does it do?  Ditto Server name--I get than's something like smtp.ISP.Com or IMAP.ISP.com). You can set those fields in the + menu Account Information Pane, with its blank text fields. And you can also "double-click to enter" that field in the list itself. Why is that?And then I can select Advanced, and get another batch of checkboxes, fields, and popups.
    But I left the Account Information pane before asking, What is this Thread-Lock Stitching Certificate thing? (Or is that Transport Layer Secrecy Sertificate, what?  None is displaying now, but if I popup what's beneath it a humongously long "ID" string, which I take to be, what, my Apple ID? A public key/ provate key encryption string/key? How do I use it if I'm trying to keep the National Surveillance Agency from eavesdropping, "in the clear," my every blessed keystroke, "phrase-stroke" (think VoIP), and if I use the thing, can the president just press a button and send a drone to blow me off the planet (and anyone near me at the time--always great fun for friends and family)?
    And never mind router and FiOS, etc., modem settings. and the Network settings outside of email....
    I guess my bottom line is, the user is presented with a rich smorgasbord of significant choices by all of the panes and panels, etc., on the mac, iMac, iPad-Phone-Watch real soon now, mac pro, macbook pro, etc.  But the specific description of the proper use of these description/instruction on their use and function is impoverished.  I think manuals used to handle some of these issues. But where are the manuals? Or am I just so overwhelmed by the complexity of what was once a simple user interface that I can't see pointers (in light grey type on lighter grey backgrounds--what the heck is wrong with black type, I'd like to know!) staring me in the phiz. Oh, help.

    Hi Cff7dxp,
    I am glad to hear that your issue has been resolved from the provided troubleshooting steps. Please feel free to post in Lenovo Community Forums if you have any further queries!
    Did someone help you today? Press the star on the left to thank them with a Kudo’s!
    Cheers!
    Hemanth Kumar
    Did someone help you today? Press the star on the left to thank them with a Kudo!
    If you find a post helpful and it answers your question, please mark it as an "Accepted Solution"! This will help the rest of the Community with similar issues identify the verified solution and benefit from it.
    Follow @LenovoForums on Twitter!

  • Slide Show using code behind

    Hi,
    How can i get pictures list from some library using web part code behind?
    Lazar
    Zarla

    The default picture web part only supportes the picture size that are
    stored in the library. You need to write your own custom web part to embed the images in a larger size. You might do some tricks using CSS or Javascript to strech the
    images but then your images will look blurry.
    http://social.technet.microsoft.com/Forums/sharepoint/en-US/537501eb-0c39-440a-b26b-78fb48092e5f/sharepoint-foundation-2010-picture-library-slideshow-webpart-fit-to-webpart?forum=sharepointgeneralprevious

  • How To Force Open Document In Edit Mode From Code-Behind (Chrome and Firefox)?

    Hello,
    Currently I am developing an IHttpHandler which at the should redirect the user to an Edit mode of a document located in a Document Library.
    The Problem is that in Firefox and Chrome it downloads the document in the temp folder. In IE it works as expected.
    The following code is used for the redirection:
    SPUtility.Redirect(urlOfTheNewDocument, SPRedirectFlags.Trusted, context);

    Hi,
    Please try to use IE Tab.
    Chrome IE Tab:
    https://chrome.google.com/webstore/detail/ie-tab/hehijbfgiekmjfkfjpbkbammjbdenadd?hl=en 
    Firefox IE Tab:
    https://addons.mozilla.org/en-us/firefox/addon/ie-tab/
    Here is a similar thread for your reference:
    http://stackoverflow.com/questions/14455212/how-to-open-sharepoint-files-in-chrome-firefox
    Thanks,
    Dennis Guo
    TechNet Community Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Dennis Guo
    TechNet Community Support

  • Customize Access Requried page with code behind attached to it in sharepoint 2010

    Hi,
    I have modified default AccessDenied page to my custom accessdenied.aspx page and put Request Access button on it and javascript client side redirection to my requestaccess (reqestaccess.aspx, reqestaccess.aspx.cs) application page.
    Here the problem is whenever i try to redirect to custom requesaccess page in _layouts it again shows me accessdenied page since user is not having access.
    I changed requrestaccess to my custom requestaccess through Powershell command (UpdateMapping - 5). I can only modify the UI part of requestaccess.aspx and can not bind code behind where i want user to select combination of what access is required
    on the site, there are lots of controls on requestaccess page e.g. dropdown that fetches data from list\external list and so on.
    I tried many things to attach code behind to requestaccess page e.g. <%@ Page Inherits="codebehind.cs" /> and all.
    Q - How can i redirect user to custom request access page (includes both aspx, aspx.cs) and allow user to interact with custom page? Is there any way OR WORKAROUND to do this in Sharepoint 2010?
    OR
    Can we overide with ElevetedPermissions in UI\CodeBehind and show the application page to user?
    OR
    Can user access application page even though they donot have rights to access site? Anything will do.
    OR
    In short, I need to redirect a user to some .aspx\.aspx.cs page from AccessDenied page, irrespective of user having access or not. 
    I hope question is clear enough to understand the issue. :)
    Regards,
    Rahul

    Hi,
    According to your post, my understanding is that you had an issue about the custom Access Required page.
    Microsoft supported using code behind, but for these pages it seemed some difference.
    However, as a workaround, we can put all the functionality to the aspx page directly.
    http://umbraes-tower.blogspot.com/2011/10/custom-request-access-page-in.html
    More reference:
    http://onlinecoder.blogspot.com/2011/05/how-to-customize-requestaccess.html
    http://oszakiewski.net/eric/customizing-the-access-request-page-in-sharepoint-2010
    Thanks & Regards,
    Jason
    Jason Guo
    TechNet Community Support

  • Code-behind + Design Mode = ... ?

    Hello everybody
    I'm trying to step into the Flex world from the right side. That's why I started using Code-behind pattern right away (in a search for info I've also foundCode-in-Front pattern... anyone interested? ). Well, the problem is - I create the combined element with it's logic and then extend it through MXML, and then I instantiate it in the main MXML file. So far everything good, but Design Mode now shows a white box with a red cross inside instead of my custom coded component with it's buttons, combos, etc. Is there any solution to that?

    Ouch...
    I have no problem with compiler. The App runs and works fine
    Is MVC approach compatible with design mode?
    Can you point me to some good MVC framework? Maybe PureMVC?

  • How to display a popup window (DialogMessage) via code behind c#?

    hi all,
    How to display a popup window (DialogMessage) via code behind c#?
    I use sp 2013, in else case I want show the DialogMessage:
    if(condition)
    else
      HttpContext.Current.Response.Redirect(SPContext.Current.Web.Url+"/_layouts/TestError/ErrorDueDate.aspx");
    the above Redirect work good but I want show the error in a DialogMessage its better because of Usability and not redirect the user to new page...
    if not via code behind is there a better way to do it?
    thanks in advance
    Ahmad
    SP 2013 & SPD 2013 & VS 2013 & MSSQL 2012

    thanks for you answer,
    And yes I includ them via CDN, like below:
    <script
    type="text/javascript"
    src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
    <script
    src="http://ajax.aspnetcdn.com/ajax/jquery.ui/1.8.9/jquery-ui.js"
    type="text/javascript"></script>
    <link
    href="http://ajax.aspnetcdn.com/ajax/jquery.ui/1.8.9/themes/start/jquery-ui.css"
    rel="stylesheet" type="text/css"
    />
    But I get still the above error in my previes post.
    SP 2013 & SPD 2013 & VS 2013 & MSSQL 2012

  • "Object Required" error when using the script block from the code behind

    I try to use the following script block on the code behind page
    <script defer='true' id='NavID' type='text/javascript'>Nav();</script>
    and the function Nav() is on the .aspx page. It gives me the "Object Required" error message. BUT if I add an alert("hello!!!") line inside of the Nav() function, it works fine after the user closes the alert box. Has anyone experienced a similar problem? Please help. Thanks.

    There is no way to troubleshoot this by looking at a picture of the diagram. LabVIEW 6 is almost prehistory and many things have changed, especially the file IO all looks different so it is impossible to tell what you are doing.
    Error 7 is file not found, so most likely your string operations are not correct. What are the full strings? What is the final file name (maybe you are missing a "\" or maybe you are on a different OS type). Put an indicator at the path wire to see what's happening!
    Is this a datalog file?
    (Overall, the code is a bit suspect. Nobody needs a seven frame flat sequence. ) Why do a control and an indicator have the same label?)
    LabVIEW Champion . Do more with less code and in less time .

  • How to Get Resource value which are referred in code behind file using IResourceProvider

    Hi Everyone,
    Currently I'm working on moving the Resource file from "App_GlobalResources" to Database by using IResourceProvider. I created a CustomResourceProvider project using ResourceProviderFactory and able to get the resource values from DB which
    are used in aspx page.
    But i'm not able to get the values which are referring from code behind file.
    Ex: Label1.Text = Resources.Common.Car; // This is still coming from resx file.
    Can any one please let me know how to get the value from DB instead of resx file which are referred in cs file.
    Appreciate your help. 
    The below code uses the ResourceProviderFactory which calls this method and gets it from DB. Please let me know if you need any more info.
    public class DBResourceProviderFactory : ResourceProviderFactory
            public override IResourceProvider CreateGlobalResourceProvider(string classKey)
                return new DBResourceProvider(classKey);
            public override IResourceProvider CreateLocalResourceProvider(string virtualPath)
                 // we should always get a path from the runtime
                string classKey = virtualPath;
                if (!string.IsNullOrEmpty(virtualPath))
                    virtualPath = virtualPath.Remove(0, 1);
                    classKey = virtualPath.Remove(0, virtualPath.IndexOf('/') + 1);
                return new DBResourceProvider(classKey);
    Regards, Ravi Neelam.

    Hi Ravi Neelam.
    >>Currently I'm working on moving the Resource file from "App_GlobalResources" to Database by using IResourceProvider.
    Based on this message, your issue related to web application, questions related to Asp.Net should be posted in
    Asp.Net forum.
    Please reopen a new thread in that forum. You will get more efficient response.
    Regards,
    Kristin
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How to execute SQL Query in Code behind Using infopath 2010?

    Hi,
    I've repeatable on infopath form, and want bind it throuth code behind from SQL table. My question is that how to execute SQL Query in code behind from infopath as well as how would get Query result to bind repeatable control?
    Thanks In Advance
    Shoeb Ahmad

    Hello,
    You first need to add new SQL DB connection then you need execute connection from code behind.
    See below link to create new connection
    http://office.microsoft.com/en-in/infopath-help/add-a-data-connection-to-a-microsoft-sql-server-database-HP010092823.aspx:
    http://www.bizsupportonline.net/infopath2010/connect-infopath-2010-sql-server-2008-table.htm
    Then use below code to execute this connection:
    AdoQueryConnection conn = (AdoQueryConnection)(this.DataConnections["Data connection name"]);
    string origCommand = Select * from tablename;
    conn.Command = origCommand;
    conn.Execute();
    Finally bind your table:
    http://www.bizsupportonline.net/infopath2007/4-way-programmatically-add-row-repeating-table.htm
    http://stevemannspath.blogspot.in/2010/09/infopath-20072010-populate-repeating.html
    Hope it could help
    Hemendra:Yesterday is just a memory,Tomorrow we may never see
    Please remember to mark the replies as answers if they help and unmark them if they provide no help

  • SQL Server 2008 Reporting Project - Invoke/Consume Web Service and Return Dataset in C# Code-Behind

    Hello,
    I have a Visual Studio 2010 C# class with a method that invokes/consumes a web service and returns an XML dataset. I am traversing through the parent/child nodes and parsing out the data then inserting it into a SQL Server 2008 R2 table for a join within
    another stored procedure. 
    Instead of using a 3rd party API to generate the PDF for this data, I am creating an SSRS report. The formatting will be easier and I can do a RenderFormat directly to PDF.
    Can I expect to be able to transfer the code-behind method to this report and have it be able to work with the web service the same way? It is a SOAP-based web service returning parent nodes and two levels of nested child nodes.
    I have also been researching the approach of calling the web service in the same stored procedure that is currently querying the physical tables (which is used to populate a gridview and PDF) but it looks like it may only be possible with a CLR stored procedure.
    Is it possible to implement a CLR stored procedure within an SSRS report? 
    Hope this makes sense. Any help, suggestion or point in the right direction would be greatly appreciated.
    Thanks,
    Buster

    Hi Buster,
    SSRS supports web service data source, we can call the SOAP-based web service in SSRS report directly. Then, we can use custom code in SSRS to parse the XML data. However, we won’t be able to join another data in SQL Server database.
    Reference:http://technet.microsoft.com/en-us/library/aa964129(v=sql.90).aspx#repservxmlds_topic3
    We cannot implement a CLR stored procedure within an SSRS report directly. In order to execute the CLR store procedure in a SSRS report, we have to execute it as text using the following code:
    Exec <stored procedure name>
    Reference:
    http://dotnetslackers.com/Community/blogs/bmains/archive/2009/01/15/executing-a-clr-stored-procedure-in-reporting-services.aspx
    Hope this helps.
    Regards,
    Alisa Tang
    Alisa Tang
    TechNet Community Support

  • Updating a Label content from code behind using dispatcher

    hi,
    I am trying to update a label's content from code behind.
    This part of the code is running in background worker. I wrote the following code to update a label's content:
    volumecontrol.Dispatcher.BeginInvoke(new Action(() =>
    volumecontrol.Content = volumeupdate;
     i tried using both BeginInvoke and Invoke but the application exits with the error:
    System.InvalidOperationException' occurred in WindowsBase.dll
    Using Invoke works when updating the UI from another thread but it not working in this case:
    Pls help.
    Thanks,
    Shaleen
    TheHexLord

    When you do that new action stuff you're capturing variables.
    If that means you grab a control's value across from outside the {} then you're trying to capture the variable on the background thread.  If that's some sort of control you're messing with then that will cause a problem as they have thread affinity.
    Because you don't want to be blocking the UI thread at all you should use BeginInvoke rather than Invoke.
    To explain this clearly - and provide a way you could use to explore what's going on and learn  - we need a separate thread which can be done using Task.Factory.StartNew.
    This bit of code allows you to put code onto a background thread:
    Task.Factory.StartNew(() =>
    // On a separate thread to the UI here
    Create a new solution, add a textBlock and Button:
    <StackPanel>
    <TextBlock Name="tb"/>
    <Button Name="btn" Click="btn_Click">Change the text</Button>
    </StackPanel>
    Then in the button click you can play around with what's going on.
    Just to be clear.
    That textblock is a control and it is created on the UI thread.
    To get from that task thread back to the UI thread you should use Dispatcher.BeginInvoke.  With no control name.
    Let's start with a broken piece of code:
    private void btn_Click(object sender, RoutedEventArgs e)
    Task.Factory.StartNew(() =>
    string thingummy = tb.Text + "Banana";
    Dispatcher.BeginInvoke(new Action(() => { tb.Text = thingummy; }));
    When you click the button it'll error because when you access tb.Text there you do so on a background thread and tb has thread affinity.
    This, however, will work OK.
    Task.Factory.StartNew(() =>
    Dispatcher.BeginInvoke(new Action(() => { tb.Text = tb.Text + "Banana"; }));
    That's OK because the Action runs on the UI thread where tb was created and all is good.
    Anonymous methods and actions capture variables ( you can google that for more info ).
    If you wanted to use a variable which was created on the background thread you can set it here:
    Task.Factory.StartNew(() =>
    string thingummy = "banana";
    Dispatcher.BeginInvoke(new Action(() => { tb.Text = thingummy; }));
    or here
    string thingummy = "banana";
    Task.Factory.StartNew(() =>
    Dispatcher.BeginInvoke(new Action(() => { tb.Text = thingummy; }));
    They both work.
    They are not accessing properties of a UI control because you're just setting the variable to a string.
    All of which means you could have a variable in your code which is set to volume or whatever that is from your control  ON THE UI THREAD and then modify that variable on the background thread.  Variables do not have thread affinity.  A
    double, string or whatever isn't a control.
    And this approach might well be more convenient.
    Hope that helps.
    Recent Technet articles:
    Property List Editing ;  
    Dynamic XAML

  • Different GL Codes for export and domestic behind account key ERL

    Hi all,
    I have created separate pricing procedures for export and domestic sales. The issue is that condition type PR00 is used in both procedures and the acount key behind PR00 is ERL. Now the issue is that from finance side, if i have to segregate revenue from export sales and revenue from domestic sales then how can i do that as the gl code is same in both procedures.
    Please respond.
    Best Regards,
    AI.

    Hi
    In account determination procedure you could use two different access sequence such that for domestic revenues 1st access will come into picture while for export the other one.
    try and revert

  • How to display or generate PDF417 barcode dynamically in PDF form? I am using Acrobat XI Professional and there is a Bar Code Field in the same through which I generated the same. But I want to generate the same dynamically.

    How to display or generate PDF417 barcode dynamically in PDF form? I am using Acrobat XI Professional and there is a Bar Code Field in the same through which I generated the same. But I want to generate the same dynamically.

    What do you mean by dynamically? When yo set up a 2D bar code field you specify which field name/value pairs you want to include, along with other parameters. But be aware that they won't work with Reader unless you Reader-enable the document with LiveCycle Reader Extensions and include the bar code usage right. It will work with Acrobat Standard/Pro.

Maybe you are looking for