How i can check whether a component is being placed or it's being rendered during page load...

Hi,
I have a piece of code which needs to be triggered only when the component gets rendered.. and at the same time it shouldn't get trigerred when author places it in the page...
For an example, Consider i have a component called samplecomponent. Also i have a piece of code in samplecomponent.jsp which should get triggered only when the component is being rendered during page load and if author places that component in the page (ofcourse the samplecomponent.jsp will get triggered but my particular piece of code should not get triggered.. Is there any condition to check that..?
Thanks
Shankar .A

Hello Shankar,
I think this is very straight forward and you can set this condition based on any of the property of your component via check null/empty condition because when you will drop your component the properties of your component will be not initialized and you can check for at (let say you have a property which is mandetory so to instantiate that component you have to have at least that property)
And let say if above option doesn't work for you then there is one more option of checking the edit mode of the page and based on that you can differ your code. But edit mode code will not work until you will see the page in edit mode, the code will only work when you switch to preview mode (publish mode) of page from edit mode (from sidekick at bottom you have option to go to edit and preview mode).
WCMMode mode = WCMMode.fromRequest(request);
    if (!mode.equals(WCMMode.EDIT) && !mode.equals(WCMMode.DESIGN)) {
     //this part of code never execute when your page is in edit mode (dropped content or load the page in edit mode). but this part of code will run when you switch from edit mode to previe mode (in author node) or on  publish instance of Server because there will be no edit mode there.
Let me know if you need more information or it doesn't help you.
Thanks,
Pawan

Similar Messages

  • HT2311 I buy a copy of a Mountain Lion OS X 3 days ago, from iTune store, how I can check whether my copy is complete?

    Where I checked my new Mountain Lion OS X?

    Why would you think it wasn't complete? Just double-click the installer - if it opens it's OK. If it's an incomplete download it won't open and you will have to re-download it.

  • How i can check new storage after i add it, specially LDAP storage

    Hi
    Thank you for reading my post.
    is there any way that i can check whether new storages are configured correcyly inside sun access manager 7 or not?
    for example I have an LDAP storage and i want to check whether i have add it correctly or not.
    thanks

    Ah I see what it is you are doing!
    You are reintroducing unformatted text from the Sections.
    Sections in a Word Processing document are "Captured" templates of individual page layouts, which includes the formatting of those pages when they were captured. When you Save As Template you have to make sure that the Sections have been fixed and captured, not just the visible pages. It is all Pages' weird way of doing Master Pages.
    You will need to recapture the sections after you have changed the language to British English.
    See the following link which explains how capturing Sections works:
    http://www.freeforum101.com/iworktipsntrick/viewtopic.php?t=182&highlight=letter head&mforum=iworktipsntrick
    Peter

  • I have my iphone 5 but a lost. The box where it came  how i can check  of how many gb its ?

    I have my iphone 5 but a lost. The box where it came  how i can check  of how many gb its ?

    Tap settings
    General
    About
    this provides alist of everything you may need to know about your device

  • How i can check DB size

    How i can check the size of DB in 9i?

    I recall, you already ask it Re: Size of DB Check

  • How i can check my phone is under warrenty???????

    i want to know, how i can check my phone warrenty period and my phone originallty...........

    Hi krishanjaat
    It would help if you carry out *#0000# and post the results, if you want more help with this matter.
    Happy to have helped forum in a small way with a Support Ratio = 37.0

  • How I can check if my Imac is Intel Core Duo Extreme

    Hello All,
    How I can check if my Imac is truly Intel Core Duo Extreme from Leopard?
    thank you,
    JD

    JD,
    Welcome to Apple Discussions.
    Apple Menu>About This Mac>More Info...>Hardware>Hardware Overview>Processor Name:
    ;~)

  • How I can check this condition

    Hi,
    Through PLSQL code how I can check the following condition.
    I have two field column TEXT1 and TEXT2. Text2 contains total five item
    and text1 contain one item, how I can check Text1 against text2 its
    existing or not.
    :Text1 :='B1'
    :Text2 := 'A1,B1,C1,D1'
    I have tried the following way, but it is not working
    IF :Text1 IN (:TEXT2) THEN
    DISP_MSG('EXIST');
    END IF;
    Regards,
    Jen.

    Or
    sql>
    declare
    text1 varchar2(10) := 'B1';
    text2 varchar2(20) := 'A1,B1,C1,D1,E1';
    begin
    dbms_output.put_line(case when text2 like '%'||text1||'%' then 'Exists'
                               else 'Not exists'
                          end );
    end;
    Exists
    PL/SQL procedure successfully completed.
    jeneesh                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • How could I check whether Oracle Enterprise Manager is installed or not ?

    Customer uses Oracle DB 11g.
    How could I check whether Oracle Enterprise Manager is installed or not ?

    If you are using EM DB Control then you run this command,
    $ORACLE_HOME/bin/emctl status dbconsole
    HTH
    Mani

  • How I can check on the existence of a client ActiveX, so that if there is no download begins?

           
    How
    I can check on
    the existence of a client
    ActiveX, so that
    if there is no download begins?
    example:
    I want tocheck for:
    EditDocumentButton = new ActiveXObject "SharePoint.OpenDocuments.2");
    if (EditDocumentButton) {
    EditDocumentButton.EditDocument (strDocument);
    and ifthere is nowarning andlaunch aURLto startthe
    download
    as is?
    thanks

    Hello,
    This control is defined in the OWSSUPP.dll file, a dynamic-link library (DLL) that is installed in the %ProgramFiles%\Microsoft Office\Office14\ directory on the client computer during Microsoft Office Setup. (Read
    full article on MSDN)
    Based on my understanding this below link can help you to open file if activex is not found.
    http://blog.scosby.com/post/2011/08/22/Remotely-Opening-Office-Files-From-SharePoint-2010.aspx
    Now to detect the activex please look this code:
    http://www.andrewshough.com/sharepoint/multiple-office-version-support-in-sharepoint-services-3-0/
    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

  • HT4972 how i can check that my phone is factory unlock or not

    how i can check that my phone is factory unlock or not

    Look at the other thread you started.  Running two active threads is confusing, not only to you but to those who are trying to help.

  • Hey,how i can check if my iphone is NEVERLOCKED ?

    hey,how i can check if my iphone is NEVERLOCKED ? i`d be grateful...
    ps.i`m a romanian,sorry for my english.

    mitzzu wrote:
    i bought it from a guy...
    Well there's your answer...you buy from a non-official source, you take your chances with the veracity of the person you're buying from. If you have AppleCare where you live, you can try calling them. They will be able to tell you. If not...well, Good Luck!

  • How i can check last dialled numbers on my iphone?

    how i can check last dialled numbers on my iphone?

    It should be. When selecting Call for a number and the number starts ringing, the clock has started for being charged for that call. The clock doesn't start when the recipient answers the call as when dialing long distance with a landline.
    There is only one way to know and determine this for certain with your carrier and if your carrier includes such detailed info with your account - checking your online account with your carrier.

  • Hi i am from india and i am using iphone 5 but i have problem with charging last 20 % suddenly my phone switched off every day and som heating when i am using internate pls help me where i can check whether my phone waranty is valid on expire

    hi i am from india and i am using iphone 5 but i have problem with charging last 20 % suddenly my phone switched off every day and som heating when i am using internate pls help me where i can check whether my phone waranty is valid on expire

    https://selfsolve.apple.com/agreementWarrantyDynamic.do

  • How we can check unicode check for function-pool.

    hi experts,
    how we can check unicode check for function-pool.
    pls tell needy.
    regards,
    praveen

    You can check the Unicode in the function group or use transaction UCCHECK

Maybe you are looking for