How to differentiate design mode /running in extended component

Hi,
Is there a way to know if a component is render in the design
mode of FB3? (Another post was done more than one year ago but no
answer...)
Regards

Hi,
in your code you can:
boolean designtimeChecked = false;
boolean isDesigntime = false;
if (!designtimeChecked){
//prevent this code being executed in designtime
FacesContext fctx = FacesContext.getCurrentInstance();
HttpServletRequest rq = (HttpServletRequest)fctx.getExternalContext().getRequest();
isDesigntime = rq.getServerPort()==-1;
designtimeChecked=true;
later on you just call if (!isDesigntime){
// execute code
Frank

Similar Messages

  • Design mode troubles - "Error during component layout."

    Hi all.
    Since this is getting pretty annoying, I thought someone might know the right solution to this. Whenever I try to open Design mode on my AIR app (Spark + MX), I get:
    Design mode: Error during component layout. Choose Design > Refresh to refresh design mode.    MyTestApp.mxml    /MyTestApp/src    Unknown    Problem
    The MXML code for it is as simple as it can get:
    <?xml version="1.0" encoding="utf-8"?>
    <s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
                                xmlns:s="library://ns.adobe.com/flex/spark"
                                xmlns:mx="library://ns.adobe.com/flex/mx"
                                skinClass="spark.skins.spark.SparkChromeWindowedApplicationSkin"
                                >
    </s:WindowedApplication>
    And app descriptor XML only contains transparent set to true and systemChrome to none, even tho it shouldn't make any difference in the Design view anyway. Refresh doesn't solve the error, and sometimes the Design view itself goes into infinite loop of refreshing.
    However, if I remove the skinClass, it all works fine and Design view loads (but then I don't get the window chrome on run-time). Same goes if I declare the skin within <fx:Style /> tag, it only breaks when using skinClass attribute in the WindowedApplication declaration. And the same thing happens if I try to edit some of the Spark skins in the Design view.
    I've tried creating a new project, switching workspaces, building a blank workspace, switching from Flex SDK 4.1 to 4.0 - all to no avail, the same error always occurs and it never goes away.
    Any ideas?

    Instead of declaring the skin within the WindowedApplication tag, you have to call the Skin class from a Style tag right after you close your window tag:
    <?xml version="1.0" encoding="utf-8"?>
    <s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
    xmlns:s="library://ns.adobe.com/flex/spark"
    Xmlns:mx="library://ns.adobe.com/flex/mx"
    title="YOUR APP">
    <fx:Style>
    @namespace s "library://ns.adobe.com/flex/spark";
    s|WindowedApplication
    skinClass:ClassReference("spark.skins.spark.SparkChromeWindowedApplicationSkin");
    background-color:#999999;
    background-alpha:"0.7";
    </fx:Style>
    source: http://help.adobe.com/en_US/air/build/air_buildingapps.pdf

  • Logo Component - Design mode shows the edit component toolbar don't show "Edit" button

    I just created a Logo component on my website following the CQ "How to create a Fully Featured Internet Website" guide.
    I do create the logo component, edited the jsp page with the following code
    <%@include file="/libs/foundation/global.jsp"%>
    <%@ page import="com.day.text.Text,
                     com.day.cq.wcm.foundation.Image,
                     com.day.cq.commons.Doctype" %>
    <%  String home = Text.getAbsoluteParent(currentPage.getPath(), 2);
        Resource res = currentStyle.getDefiningResource("fileReference");
        if (res == null) {
            res = currentStyle.getDefiningResource("file");
        log.error("path is:" + currentStyle.getPath());
    %>
        <a href="<%= home %>.html"> <%
        if (res == null) {
            %> Home Page <%
        }else {
            Image img = new Image(res);
            img.setItemName(Image.NN_FILE, "file");
            img.setItemName(Image.PN_REFERENCE, "fileReference");
            img.setSelector("img");
            img.setDoctype(Doctype.fromRequest(request));
            img.setAlt("Home Page");
            img.draw(out);
        %>
        </a>
    Then, I created the tag "<cg:include>" in my jsp page, calling this jsp.
    After all that, I created the Design Dialog for my logo component, then a "items" node under the tab1 node of the design dialog.
    After this, finnaly, the widget node (absParent), under the items created before.
    A lot of propertys later, I got my Logo object in the page, but the toolbar with the "Edit" button on Design mode don't show me the "Edit button" 
    Someone can tell me how to get the button there?
    Is some property that I may have forgotten?
    Thanks.

    Basically, the edit toolbar has the same with as your component, which indeed is problematic for narrow components.
    But you can work-around that with a basic CSS hack:
    .cq-editbar {
        min-width: 200px !important;
        _width: 200px !important; /* IE6 */
    This seems to be fixed in CQ 5.5.

  • Flash IDE Components in Flex 3 Design Mode. Can they be visible there?

    Hi,
    Im exploring Flex to get a grasp on its concepts and am currently looking into building components in the Flash IDE. Though i guess its likely that when you're more familiar with Flex you build your components in Flex, like said Im exploring its concepts and like to know where and how the Flash IDE fits in its workflow.
    I made a simple Flex Component in the Flex IDE, which shows up fine when I run the Flex project. But it does not show in Flex Design Mode.
    I have exported the component from Flash as an SWC and added the SWC to the Flex library path. The symbol in the Flash IDE extends UIMovieClip. Now I read in 'Using Adobe FlexBuilder 3' (p.67) that the Flex Components panel only lists visible components, according to the documentation 'components that extend UIComponent'.
    Note that my question is about being visible on the stage in Design Mode, not in the component panel. As UIMovieClip doesnt inherit from UIComponent (and the UIComponent class doesnt seem to be available in the Flash IDE), is this also the cause that the Flash IDE component is not visible on the Flex stage in Design Mode?
    Can someone confirm, or deny this?
    Regards,
    Marcel

    Hi Latha,
    thanks for your feedback. Reading it back though, Im still not sure whether Flex components build in the Flash IDE (using the Flex Component Kit for Flash CS3) can be visible in Flex 3 Design Mode.Maybe you can be a bit more specific and save a lot of Flex beginners a lot of headaches.
    I understand that MXML components can be used in Design Mode. I also understand that if your component is AS you have to create a Library and link that to your project to make them visible in Design Mode. I also understand that Flash Builder 4 does "support rendering of UIMovieClip objects which are in library (swc) and added to the project build path"
    This actually doesnt answer my question really. Does this mean there is no way to render Flex components build in the Flash IDE (using the Flex Component Kit for Flash CS3)  in Flex 3 Design Mode?
    Regards,
    Marcel

  • How to order a query, in design mode?

    Hi,
    I work with the bex 3.x and I need to know how can I order a query by a ratio/s in the design mode (with the query designer)?
    Before running the query.
    Can anybody help me?
    Thanks in advance.
    Regards.

    Hi,
    refer below thread
    [http://help.sap.com/saphelp_nw70/helpdata/en/ba/45583ca544eb51e10000000a114084/content.htm]
    [http://help.sap.com/saphelp_nw70/helpdata/en/e7/47dd1613d14c449ce2a3f1461d8c87/content.htm]
    Thanks,

  • How to suppress the back-ground execution of a query in design mode

    hi guys,
    there is a bahaviour of the system, that I'd like to change. So, when we
    1. start EXCEL
    2. go to the designer mode to create a report
    3. first drop an InfoProvider (e query) into a cell,
    4. second - pull e.g a filter element into another cell, still being in the design mode.
    Just in this moment, the query itself has been already started in the back groud, aiming to fill the cache, I guess.
    Does anyone know how to suppress the back-ground execution? I'd like to control, when to start the reports execution.
    Thanks in advance.
    Neven

    Hello,
    There is no way to do that if you are creating thru BEx Analyzer.
    Instead use the BEx Analyzer, try to create using directly BEx Query Designer.
    In that way, the query will not be executed, until you want to...
    Thank you
    Edward John

  • DS SDK: How to check if plugin is called in "design mode" or in browser?

    Dear SDK experts,
    I just created a simple world-/europe map plugin based on Datamaps (http://datamaps.github.io/) which works fine when the dashboard is executed in the browser but crashs, when I drag my plugin into the design area (maybe it's called different) of design studio. As I found no easy way to debug my created js code directly in design studio, is there is simple check so I can call the "real" plugin code only when my dashboard is executed in the browser and for example display only a static image when it's called inside design studio?
    This check would also help a lot in my other plugins and I am sure, I already saw some coding somewhere -hopefully you remember where.
    Thank you very much in advance for answering my very first question here on SCN.
    Best regards,
    Oliver

    Hi Oliver,
    The approach for determining design mode is documented in this thread: SDK - how to control other objects
    Specifically, the code is:
    if (window.sap && sap.zen && sap.zen.designmode) {
    // Design time only code...
    Hope that helps.
    Regards,
    Mustafa.

  • Footer extends longer in Preview Mode then in Design Mode

    I have attached two JPEGS that show my footer in "Design" mode and in "Preview" mode. 
    In "Design" mode the footer is perfect.  It is the size and distance it needs to be at.  However, when viewing it in "Preview Mode", the footer extends downward farther then it should.  I've looked all over the page to see if there was something from another graphic or image or shape that could be extending downward and I don't see anything. 
    Take a look at both images and tell me why this is happening?  I did have a lightbox gallary on this page.  I thought that the gallery was extending it downward so I removed it to test my theory.  Even after removing it, it still does not work the way it should.
    Craig
    Message was edited by: MUSE Worker

    Like Vikas said:
    Check if you have Sticky Footer enabled:
    File > Site Properties
    Page > Page Properties (for master and child pages)
    Let me know if neither of those work, it could be that you just need to preview in browser to see what the true height will be in the footer.
    Hope this helps!
    Julia

  • Hi Guys 'n' Gals! I have a problem with my computer going into 'Display Sleep' mode and it actually goes into full sleep mode. anyone know how to keep my Mac running software and not go into full sleep after I have set it to 'Never go into computer sleep

    Hi Guys 'n' Gals!
    I have a problem with my computer not going into 'Display Sleep' mode but actually goes into full Computer Sleep mode. Anyone know how to keep my Mac running software and not go into full sleep after I have set it to 'Never' go into 'Computer Sleep' within the 'energy saving' section!
    Any ideas guys?
    Miffa!

    Reset SMC.     http://support.apple.com/kb/HT3964
    Choose the  appropriate method.

  • Gaming: How Did They Design Crysis and Maxed It to Run Future Hardware?

    Hi. If anyone has experience creating photorealistic games, how did Crytek design Crysis I to be maxed out for future hardware. What hardware were they using in the first place to run Crysis at max in their offices when it was developed if the hardware didn't exist yet? If they used a system with multiple systems on working in parallel, couldn't consumers copy that system to add to their existing ones (or pool systems with friends just run it at max while waiting for the hardware to do so. But so far at maximum resolution, 2000+ by 2000+, hardware today still struggles with it.). This question is also for Crysis 2. Thanks in advance.
    Gbu

    Hi. Interesting. They didn't have any special game farm parallel rig of some sort? When they tested it in it's maximum 2000+ x 2000+ resolution at very high settings, they were actually playing and testing it at slide show framerates of 1 or 2 fps in their offices then? That's a pain to develop.

  • How do Design Mode Settings get Packaged?

    Hi,
    I've got a question about packaging a Site's Design Mode settings.
    If I edit the Settings of a parsys in Design Mode (i.e. Anchors, or Allowed Components), where in the JCR do these settings get stored?  How do I ensure they are packaged?
    I'm sure this is a simple answer...
    Thanks!

    Hi Tim,
    If you are setting for example allowed components for a parsys and you have assigned to your page some custom design (not default) all configurations are stored under:
    /etc/designs/<name_of_design>/jcr:content/<name_of_template>/<name_of_parsys> in the components property
    Reagrds,
    kasq

  • In Muse Design mode, on one of my site pages there is an aqua colored line running horizontal & I can't slide my page up past it?

    In Muse Design mode, on one of my site pages there is an aqua colored line running horizontal & I can't slide my page up past it?

    Ok well I realise that my source code needs changing to match that of the working page as transplanting the source code of a non working page into a copy of the working page doesn't work.
    At least I have some sort of starting point now to work from.

  • How does DW 8 display divs in "design Mode"?

    Hi everyone,
    Question: How does DW 8 display divs in the design window?
    I ask this because I am trying to create a website entirely
    in divs (with divs inside divs), and when I see certain things in
    my "design mode", some divs show up directly underneath. Example: I
    have #cellA and #cellB. I want #cellA right next to #cellB inside
    of a #container. Instead, when I try to insert a Div tag (after end
    of tag) it places it right underneath it. So #cellB is right under
    #cellA, when all I want is for them to be side by side.
    Here is the link:
    http://www.helenbwilson.com/helen-css-test-01.html
    Is there a screen mode that I am not aware of?
    How do you guys look at how your divs are being displayed in
    the "design view" of dreamweaver.
    I have also just gone into the code and tried placing my divs
    there, but to no avail..
    Anyone have the same problem?
    Any help would be greatly appreciated.
    Thanks
    -psypent

    If you want divs side-by-side, you must float them.
    > How do you guys look at how your divs are being
    displayed in the "design
    > view"
    > of dreamweaver.
    They look right to me.
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.dreamweavermx-templates.com
    - Template Triage!
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    http://www.macromedia.com/support/search/
    - Macromedia (MM) Technotes
    ==================
    "psypent81" <[email protected]> wrote in
    message
    news:f1tgm4$6f9$[email protected]..
    > Hi everyone,
    >
    > Question: How does DW 8 display divs in the design
    window?
    > I ask this because I am trying to create a website
    entirely in divs (with
    > divs
    > inside divs), and when I see certain things in my
    "design mode", some divs
    > show
    > up directly underneath. Example: I have #cellA and
    #cellB. I want #cellA
    > right
    > next to #cellB inside of a #container. Instead, when I
    try to insert a Div
    > tag
    > (after end of tag) it places it right underneath it. So
    #cellB is right
    > under
    > #cellA, when all I want is for them to be side by side.
    >
    > Here is the link:
    >
    http://www.helenbwilson.com/helen-css-test-01.html
    >
    > Is there a screen mode that I am not aware of?
    > How do you guys look at how your divs are being
    displayed in the "design
    > view"
    > of dreamweaver.
    > I have also just gone into the code and tried placing my
    divs there, but
    > to no
    > avail..
    > Anyone have the same problem?
    >
    > Any help would be greatly appreciated.
    >
    > Thanks
    > -psypent
    >

  • How to edit text in design mode - i.e get an I cursor instead of arrow

    DW CS6 This is a very basic unclear on concept question. I normally work in code view and have no problems. Sometimes there is a large block of text within a paragraph which is in a div.
    I would like to correct a simple typo or insert some more text directly from the design mode display. However, almost all the time, when I click on the spot I want to modify, the cursor remains an arrow and the entire div gets a yellow border. I still have the select arrow, not the vertical bar I need to edit.
    Sometimes I seem to stumble onto the right set of clicks and get the edit bar.
    Thanks for any suggestions.

    Design View can get pretty cranky when your code has errors.
    Check the validator at http://validator.w3.org and make sure you're working with clean code before resorting to wiping preferences, config folders or reinstalling.
    If your code is clean and it's still not allowing you to click your text in Design View, you may have a z-indexing issue. I notice on pages that use a lot of positioning (APDivs) you can accidentally cover up your text boxes with blank/transparent areas of other elements and cause problems when trying to access that text at a later date.
    It's all guesswork though without seeing your actual page.
    Could you post a link?

  • Windows\system32\softpub.dll is either not designed to run on windows or contains an error. how do i fix this so i can launch my itunes app

    every time I try to open itunes i get this message, C:\windows\system32\softpub.dll is either not designed to run on windows or contains an error. what should i do to fix this problem.

    I suggest that you reinstall the Microsoft Visual Studio 2010 redistributable https://www.microsoft.com/en-us/download/details.aspx?id=5555
    If you are on a 64-bit system you should also install the x64 version http://www.microsoft.com/en-us/download/details.aspx?id=13523

Maybe you are looking for

  • HT1349 iTunes and Windows 8 will not work!!! Please help!!!

    I just purchased a new sony vaio laptop computer with Window's 8 and I have uninstalled and installed itunes over 5 times and it will not work. When attempting to open it, a box pops up that says "ITunes has stopped working: A problems caused the pro

  • Create an email in the viewer

    When i tap a button or link to write an email in the ipad viewer, this action automatically redirects me to the native iPad mail application, leaving the Adobe Viewer. Is it possible to execute this action (create an email) without leaving the Viewer

  • Getting rid of stupid animation

    Before I expire from old age I would love to know how to turn off that ridiculous animation whenever I browse for a file. You know that stupid, useless, horrible animation where the file list or whatever is conveyed to you via some Star Wars movie of

  • No Listener During Net8 Test

    Hi! i installed Oracle 8i Pe ver 8.1.6 on Win98. all went fine but the problem is on the connection part. When i tried to configure the service Net8 using Net8 Assistant, i just cannot connect to the database service with the error of "No Listener" (

  • TP ERROR

    Hi all, I am having a TP error in spam. I am trying to update spam version from 21 to 24. It stopped during the phase IMPORT_OBJECT_LIST. When I checked the TP connection in stms it gave the below info that TP is fine. RFC Link              tp was st