Checking cell is null or not

Hi ,
Iam using poi to read excel sheet. Iam reading line by line of excel sheet using HssfUserModel.
Here is my code
int numberOfRows = sheet.getLastRowNum();
for (int i = 1; i <= numberOfRows; i++)
  HSSFRow row = sheet.getRow(i);
//  check whether row is null or not
  if (row != null)
    int numberOfCells = row.getLastCellNum();
     for(int j=0;j <= numberOfCells;j++)
         HSSFCell cell = row.getCell((short)j);
         short cellNumber = cell.getCellNum();
      //check whether cell is null or not
          if(cell!=null)
            if(cellNumber ==  myTradeConstants.scripCode_column_Number)
               cell =row.getCell(myTradeConstants.scripCode_column_Number);
               scripCode =cell.getStringCellValue();
               System.out.println("scripCode:"+scripCode);
        else
              System.out.println("nocellValue");
              break;
else
   System.out.println("rowBreak");
   break;
}My Excel sheet is also having so many number of rows. But it is displaying only first row of the excel sheet. n displaying "nullpointerException".
why iam getting nullPointer Exception.
I want to check whether a cell is having data or not.
can anybody guide me in right dircection.
regards,
ramu.

import java.io.FileInputStream;
import java.io.IOException;
import java.util.Iterator;
import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.poifs.filesystem.POIFSFileSystem;
public class cellCheck {
* @param args
public static void main(String[] args) {
          // TODO Auto-generated method stub
try {
    POIFSFileSystem fs = new POIFSFileSystem(new FileInputStream(
                         args[0]));
    HSSFWorkbook workbook = new HSSFWorkbook(fs);
    HSSFSheet sheet = workbook.getSheet("Main");          // HSSFRow row = sheet.getRow(1);
     int numberOfRows = sheet.getLastRowNum();
   System.out.println("numberOfRowsInThe Sheet" + numberOfRows);
     String scripCode = null;
    for (int i = 1; i <= numberOfRows; i++)
     HSSFRow row = sheet.getRow(i);
     if (row != null)
     int numberOfCells = row.getLastCellNum();
     for(int j=0;j <= numberOfCells;j++)
                              HSSFCell cell = row.getCell((short)j);
     short cellNumber = cell.getCellNum();
     if(cell!=null)
     if(cellNumber == myTradeConstants.scripCode_column_Number)
                              cell =row.getCell(myTradeConstants.scripCode_column_Number);
                                  scripCode =cell.getStringCellValue();
                                  System.out.println("scripCode:"+scripCode);
                              else
                                   break;
                    //else
                         System.out.println("rowBreak");
                         break;
          } catch (IOException ioe) {
               // TODO: handle exception
               System.out.println("IoException" + ioe.getMessage());
}

Similar Messages

  • How to check table is NULL or not when a form load?

    How to check table is NULL or not when a form load?
    I want to make the form when it load it check the data in table, if there are no data in table other form will be load.
    Sorry for bad English... 

    Maybe you can do this in form1's Form_Open event:
    if dcount("*", "table1") = 0 then
      Cancel = True
      Docmd.Openform "form2"
    end if
    -Tom. Microsoft Access MVP

  • Checking the long value is null or not

    Hi
    Can anybody help me how to check that a long variable is null ot not?

    karthikeyan.v wrote:
    its ok...but reply me that how to check a long variable contains any content?If your code compiles, it always has predictable "content" (value).
    class Foo {
      long z; // 1
      void bar() {
        long y; // 2
        // 3
        long x = y; // 4
    }Because of #1, every time you create a Foo object that object's z variable has a value of 0 after construction has finished. Member variables are initialized to 0/false/null before you can even see them.
    Local variables, however, do not have a value until you assign one to them. The compiler knows this, and will not let you use a local unless it has been "definitely assigned" (JLS term) at that point.
    Here, because we do not assign a value to y at #2 or any time after that, as of #3 and afterwards, it does not have a value as far as the compiler is concerned. That means when we get to #4, we'll get a compile-time error.
    If we get past #4 without a compile-time error, then it is guarnateed that y has been assigned a value by our code in the body of that metohd.
    If this does not answer your question, please clarify what you're asking with something more precise and descriptive than "how to check it contains any content", which means nothing.

  • ViewCriteriaRow attribute to check for null or not null

    I Want to apply a view criteria to check for null or not null on a column , i see examples on how to set for value like
    vcRow.setAttribute("Sal", "> 2500")but i need to check for Sal is null or not null ,
    tried vcRow.setAttribute("Sal", null) and it is not working
    and vcRow.setAttribute("Sal", "is null") gives me error .
    can somebody help with correct syntax for this
    Thanks for your time

    looks like vcRow.setAttribute("Sal", "null") works

  • Not Understanding the filter in Explain Plan - filter(NULL IS NOT NULL)

    Hi All,
    Request your help in understanding the below scenario. (I am not aware of teh application and table details. Just trying to help my friend)
    SQL> conn
    Enter user-name: [email protected]
    Enter password:
    Connected.
    SQL> select * from v$version;
    BANNER
    Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bi
    PL/SQL Release 10.2.0.3.0 - Production
    CORE    10.2.0.3.0      Production
    TNS for Linux: Version 10.2.0.3.0 - Production
    NLSRTL Version 10.2.0.3.0 - Production
    --Checking the count in PO_LINES
    SQL> select count(*) from po_lines;
      COUNT(*)
             0
    --PO_LINES is a synonym
    SQL> select object_type,owner from dba_objects where object_name = 'PO_LINES';
    OBJECT_TYPE         OWNER
    SYNONYM             APPS
    --The synonym is pointing to PO.PO_LINES_ALL
    SQL> select * from user_synonyms where synonym_name = 'PO_LINES';
    SYNONYM_NAME                   TABLE_OWNER                    TABLE_NAME                     DB_LINK
    PO_LINES                       PO                             PO_LINES_ALL
    --But when counting PO.PO_LINES_ALL I am getting different result
    SQL> select count(*) c from po.po_lines_all;
             C
          8828
    --Explain plan of teh original query is
    SQL> explain plan for
      2  select
      3  * from po_lines;
    Explained.
    SQL> select * from table(dbms_xplan.display);
    PLAN_TABLE_OUTPUT
    | Id  | Operation          | Name         | Rows  | Bytes | Cost (%CPU)|
    |   0 | SELECT STATEMENT   |              |     1 |   252 |     0   (0)|
    |*  1 |  FILTER            |              |       |       |            |
    |   2 |   TABLE ACCESS FULL| PO_LINES_ALL |  8796 |  2164K|   106   (4)|
    Predicate Information (identified by operation id):
       1 - filter(NULL IS NOT NULL)
    --Now the object PO.PO_LINES_ALL is TABLE, not an mview.
    SQL> select object_type,owner from dba_objects where object_name = 'PO_LINES_ALL';
    OBJECT_TYPE         OWNER
    TABLE               POSeek your help in understanding what is happening here.
    Thanks in Advance,
    jeneesh

    Next time, prefix with APPS. when you show us the explain plan:
    SQL> explain plan for
      2  select
      3  * from apps.po_lines;  -- added the prefix of owner.Just like you prefixed with PO. when you showed us the query on PO_LINES_ALL. It ensures that you are using the synonym which you showed us.
    Btw. PO_LINES_ALL, could still be a VIEW given your overview of the situation.
    Anyway a filter "NULL IS NOT NULL" is indicative that the optimizer performed something called semantic query optimization (SQO).
    SQO is the process of deducing new predicates based upon a) existing predicates in your query (which there is none), b) added predicates to your query (eg. by a VPD policy function), and c) declared constraints on the tables invovled in your query.
    A typical example of when a "NOT is NOT NULL" predicate will show up is when for instance in the EMP table there is a declared constraint on EMPNO like this:
    check(EMPNO > 0)And your query would hold a predicate that is inconsistent with the constraint, for instance like this:
    select *
    from EMP
    where EMPNO <= 0Oracle will deduce that EMPNO cannot be both greater than zero (constraint) as well as smaller than or equal to zero (your query predicate), and will transform the query into:
    select *
    from EMP
    where EMPNO <= 0
      and NULL is NOT NULLThus preventing accessing the EMP table all together, and immediately returning this query with no data found.
    Edited by: Toon Koppelaars on Mar 15, 2010 7:17 AM

  • Script or query to generate a report of null or not null columns

    I need a script/query it should pick up all the tables from user_tab_columns and produce a report for all the tables which are the columns are null and not null.

    As long as the columns were defined as NOT NULL on table create, or ALTERed NOT NULL, you can do this:
    SQL> CREATE TABLE t (id NUMBER NOT NULL, descr VARCHAR2(10));
    Table created.
    SQL> SELECT column_name, table_name, nullable
      2  FROM user_tab_columns
      3  WHERE table_name = 'T';
    COLUMN_NAME                    TABLE_NAME                     N
    ID                             T                              N
    DESCR                          T                              Y
    SQL> ALTER TABLE t modify (descr NOT NULL);
    Table altered.
    SQL> SELECT column_name, table_name, nullable
      2  FROM user_tab_columns
      3  WHERE table_name = 'T';
    COLUMN_NAME                    TABLE_NAME                     N
    ID                             T                              N
    DESCR                          T                              NNote that if you do:
    ALTER TABLE t ADD CONSTRAINT id_nn CHECK (id IS NOT NULL);then the nullable column in xxx_tab_columns will remain as Y.
    HTH
    John

  • Null keys not supported

    Hi. I have created a simple Entity Bean called User with just 2 fields and no business methods. I am using Personal Oracle8 database and sun's JdbcOdbcDriver. The connection pool is configured properly.
    When I try to deploy this bean, I get an error saying "Null keys not supported". I think it is a problem related to the driver. But is there any way to fix it without changing the driver.
    The detailed error message is as follows:
    Exception:weblogic.management.ApplicationException: activate failed for User Module: User Error: Exception activating module: EJBModule(User,status=PREPARED) Unable to deploy EJB: UserEJB from User.jar: Null keys not supported. Nested Exception: java.lang.IllegalArgumentException: Null keys not supported at weblogic.utils.collections.WeakConcurrentHashMap.get(WeakConcurrentHashMap.java:189) at weblogic.utils.wrapper.WrapperFactory.getCachedWrapperClass(WrapperFactory.java:51) at weblogic.utils.wrapper.WrapperFactory.getWrapperClass(WrapperFactory.java:183) at weblogic.utils.wrapper.WrapperFactory.getWrapperClass(WrapperFactory.java:171) at weblogic.jdbc.wrapper.JDBCWrapperFactory.getWrapper(JDBCWrapperFactory.java:146) at weblogic.jdbc.jts.Driver.newConnection(Driver.java:674) at weblogic.jdbc.jts.Driver.createLocalConnection(Driver.java:196) at weblogic.jdbc.jts.Driver.connect(Driver.java:154) at weblogic.jdbc.common.internal.RmiDataSource.getConnection(RmiDataSource.java:305) at weblogic.ejb20.cmp.rdbms.RDBMSPersistenceManager.getConnection(RDBMSPersistenceManager.java:2247) at weblogic.ejb20.cmp.rdbms.RDBMSPersistenceManager.verifyDatabaseType(RDBMSPersistenceManager.java:2459) at weblogic.ejb20.cmp.rdbms.RDBMSPersistenceManager.setup(RDBMSPersistenceManager.java:198) at weblogic.ejb20.manager.BaseEntityManager.setupPM(BaseEntityManager.java:253) at weblogic.ejb20.manager.BaseEntityManager.setup(BaseEntityManager.java:210) at weblogic.ejb20.manager.DBManager.setup(DBManager.java:154) at weblogic.ejb20.deployer.ClientDrivenBeanInfoImpl.activate(ClientDrivenBeanInfoImpl.java:1057) at weblogic.ejb20.deployer.EJBDeployer.activate(EJBDeployer.java:1322) at weblogic.ejb20.deployer.EJBModule.activate(EJBModule.java:610) at weblogic.j2ee.J2EEApplicationContainer.activateModule(J2EEApplicationContainer.java:3127) at weblogic.j2ee.J2EEApplicationContainer.activate(J2EEApplicationContainer.java:2081) at weblogic.j2ee.J2EEApplicationContainer.activate(J2EEApplicationContainer.java:2062) at weblogic.management.deploy.slave.SlaveDeployer$ComponentActivateTask.activateContainer(SlaveDeployer.java:2592) at weblogic.management.deploy.slave.SlaveDeployer$ActivateTask.doCommit(SlaveDeployer.java:2515) at weblogic.management.deploy.slave.SlaveDeployer$Task.commit(SlaveDeployer.java:2317) at weblogic.management.deploy.slave.SlaveDeployer$Task.checkAutoCommit(SlaveDeployer.java:2399) at weblogic.management.deploy.slave.SlaveDeployer$Task.prepare(SlaveDeployer.java:2311) at weblogic.management.deploy.slave.SlaveDeployer$ActivateTask.prepare(SlaveDeployer.java:2479) at weblogic.management.deploy.slave.SlaveDeployer.processPrepareTask(SlaveDeployer.java:798) at weblogic.management.deploy.slave.SlaveDeployer.prepareDelta(SlaveDeployer.java:507) at weblogic.management.deploy.slave.SlaveDeployer.prepareUpdate(SlaveDeployer.java:465) at weblogic.drs.internal.SlaveCallbackHandler$1.execute(SlaveCallbackHandler.java:25) at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197) at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
    [Deployer:149033]preparing application User on SamServer
    [Deployer:149033]prepared application User on SamServer
    [Deployer:149033]activating application User on SamServer
    [Deployer:149033]failed application User on SamServer
    [Deployer:149034]An exception occurred for task [Deployer:149026]Deploy application User on SamServer.: Exception:weblogic.management.ApplicationException: activate failed for User Module: User Error: Exception activating module: EJBModule(User,status=PREPARED) Unable to deploy EJB: UserEJB from User.jar: Null keys not supported. Nested Exception: java.lang.IllegalArgumentException: Null keys not supported at weblogic.utils.collections.WeakConcurrentHashMap.get(WeakConcurrentHashMap.java:189) at weblogic.utils.wrapper.WrapperFactory.getCachedWrapperClass(WrapperFactory.java:51) at weblogic.utils.wrapper.WrapperFactory.getWrapperClass(WrapperFactory.java:183) at weblogic.utils.wrapper.WrapperFactory.getWrapperClass(WrapperFactory.java:171) at weblogic.jdbc.wrapper.JDBCWrapperFactory.getWrapper(JDBCWrapperFactory.java:146) at weblogic.jdbc.jts.Driver.newConnection(Driver.java:674) at weblogic.jdbc.jts.Driver.createLocalConnection(Driver.java:196) at weblogic.jdbc.jts.Driver.connect(Driver.java:154) at weblogic.jdbc.common.internal.RmiDataSource.getConnection(RmiDataSource.java:305) at weblogic.ejb20.cmp.rdbms.RDBMSPersistenceManager.getConnection(RDBMSPersistenceManager.java:2247) at weblogic.ejb20.cmp.rdbms.RDBMSPersistenceManager.verifyDatabaseType(RDBMSPersistenceManager.java:2459) at weblogic.ejb20.cmp.rdbms.RDBMSPersistenceManager.setup(RDBMSPersistenceManager.java:198) at weblogic.ejb20.manager.BaseEntityManager.setupPM(BaseEntityManager.java:253) at weblogic.ejb20.manager.BaseEntityManager.setup(BaseEntityManager.java:210) at weblogic.ejb20.manager.DBManager.setup(DBManager.java:154) at weblogic.ejb20.deployer.ClientDrivenBeanInfoImpl.activate(ClientDrivenBeanInfoImpl.java:1057) at weblogic.ejb20.deployer.EJBDeployer.activate(EJBDeployer.java:1322) at weblogic.ejb20.deployer.EJBModule.activate(EJBModule.java:610) at weblogic.j2ee.J2EEApplicationContainer.activateModule(J2EEApplicationContainer.java:3127) at weblogic.j2ee.J2EEApplicationContainer.activate(J2EEApplicationContainer.java:2081) at weblogic.j2ee.J2EEApplicationContainer.activate(J2EEApplicationContainer.java:2062) at weblogic.management.deploy.slave.SlaveDeployer$ComponentActivateTask.activateContainer(SlaveDeployer.java:2592) at weblogic.management.deploy.slave.SlaveDeployer$ActivateTask.doCommit(SlaveDeployer.java:2515) at weblogic.management.deploy.slave.SlaveDeployer$Task.commit(SlaveDeployer.java:2317) at weblogic.management.deploy.slave.SlaveDeployer$Task.checkAutoCommit(SlaveDeployer.java:2399) at weblogic.management.deploy.slave.SlaveDeployer$Task.prepare(SlaveDeployer.java:2311) at weblogic.management.deploy.slave.SlaveDeployer$ActivateTask.prepare(SlaveDeployer.java:2479) at weblogic.management.deploy.slave.SlaveDeployer.processPrepareTask(SlaveDeployer.java:798) at weblogic.management.deploy.slave.SlaveDeployer.prepareDelta(SlaveDeployer.java:507) at weblogic.management.deploy.slave.SlaveDeployer.prepareUpdate(SlaveDeployer.java:465) at weblogic.drs.internal.SlaveCallbackHandler$1.execute(SlaveCallbackHandler.java:25) at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197) at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170) .
    Regards,
    Sameer

    This is definitely a problem related to setting up and using the JDBC driver. I'd check with the JDBC newgroup if you have not done so already (then support if that doesn't go anywhere).
    -thorick

  • SRM MDM, Error, "Table with Code 'null' does not exist in repository"

    Hi experts,
    We has SRM MDM scenario, while doing OCI settings, we are able to connect with MDM repository but getting follwoing error message in portal, "java.lang.IllegalArgumentException: Table with Code 'null' does not exist in the repository 'Repository' or is one of the system table (e.g. Workflows) that is not exposed in repository schema" 
    Can You please suggest,
    Thanks and Regards,
    Munish

    Hi everyone,
    Sudhanshu and Anshuk:- Thanks for your response, let me try and explain the real scenario in details:-
    We have deployed the SRM-MDM Catalog Search UI in Portal.
    We tried accessing the http://<Portal Host>:<Portal Port>/SRM-MDM/SRM_MDM
    Then we got a screen (Search UI App screen), where in we have provided the MDM Server name, then the MDM Server Password, then presses the Connect button, then below this, it displayed the Repository name created in the MDM. We have selected the Repository, then provided the Credentials of a User (Name: T_CORP) in MDM which has "Catalog Manager", and the "UI Configuration Manager" Roles. Please note that these Role names were created by us in MDM. Is it the right procedure or do we have any standard Roles delivered by SAP in MDM to map? If any standard Roles are available, where we need to check these.
    Once the Credentials of MDM User is provided, and then selected the "Login" button.
    Then we are getting the below error.
    "java.lang.IllegalArgumentException: Table with Code 'null' does not exist in the repository 'Repository' or is one of the system table (e.g. Workflows) that is not exposed in repository schema"
    Please clarify; we are not configuring any values in iViews. Where we need to do this, I mean name of the iView, and what values do we need provide generally? We are just running the Search UI App application; I don't think it is an iView, because the URL shows the Application name details, etc...
    Please guide us, how to fix this Error.
    Thanks and Regards,
    Munish

  • Oracle.jbo.NoDefException: JBO-25002: Definition oracle.webcenter.search.model.DataControls of type null is not found.

    Hi experts,
    I am trying to deploy a new version of a WC Portal application and when the deployment finishes successfully I cannot see the web page. The error is:
    Error 500--Internal Server Error
    oracle.jbo.NoDefException: JBO-25002: Definition oracle.webcenter.search.model.DataControls of type null is not found.
        at oracle.jbo.mom.DefinitionManager.findDefObjectUsingMetadataObject(DefinitionManager.java:2772)
        at oracle.adf.model.binding.DCDataControlConfigDef.findDefObject(DCDataControlConfigDef.java:32)
    Checking the output log I can see:
    <Jul 29, 2013 2:47:21 PM CEST> <Error> <HTTP> <BEA-101020> <[ServletContext@667149283[app:<App_name> module:<Module> path:/<Path> spec-version:2.5 version:V4.0]] Servlet failed with Exception
    oracle.jbo.NoDefException: JBO-25002: Definition oracle.webcenter.search.model.DataControls of type null is not found.
            at oracle.jbo.mom.DefinitionManager.findDefObjectUsingMetadataObject(DefinitionManager.java:2772)
            at oracle.adf.model.binding.DCDataControlConfigDef.findDefObject(DCDataControlConfigDef.java:32)
            at oracle.adf.model.binding.DCDataControlDef.findDefObject(DCDataControlDef.java:377)
            at oracle.adf.model.binding.DCDataControlReference.<init>(DCDataControlReference.java:55)
            at oracle.jbo.uicli.mom.JUApplicationDefImpl.loadDataControlUsage(JUApplicationDefImpl.java:1137)
            Truncated. see log file for complete stacktrace
    Caused By: oracle.mds.core.MetadataNotFoundException: MDS-00013: no metadata found for metadata object "/oracle/webcenter/search/model/DataControls.dcx"
    I have checked similar errors in the forums and tried the solutions purposed but with no success. I do not understand why the application is looking for the DataControls.dcx file inside a standard WC Search library.
    Any help would be much appreciated.

    Hi Dani,
    Eventually I found the problem, it is reported in Oracle Support as Doc ID 1503173.1.
    It seems jDeveloper is a bit special when adding Directories to the MAR file. If the whole directory "/oracle" is added, the adf-config.xml introduces the following line:
    namespace metadata-store-usage="WebCenterFileMetadataStore" path="/oracle"/
    As a result, this diverts all /oracle/... file and class requests to MDS, which causes failures.
    So when editing the MAR deployment profile be careful to select the sub-directories under /oracle/webcenter/portalapp/ one by one.
    Added to this, I had to perform the cleaning process you suggested to make it work too, otherwise I get a different error...
    Final steps are:
    1. Undeploy application.
    2. Delete MDS partition.
    3. Shutdown managed server.
    4. Delete /cache and /tmp content for the managed server.
    5. Start managed server.
    6. Exectute Clean all in jDeveloper.
    7. Create a new mar deployment as described in SR 1503173.1.
    8. Deploy to EAR file.
    9. Deploy new application to managed server using Enterprise Manager.
    And it works!
    Thanks for your help!

  • How to find out each Cell having Data or Not in Excel File by Using WDJ

    Hi Friends,
    I have one doubt on WDJ.
    I have to Upload Excel File. Click on Upload Button in Excel file Data will move to One Bapi. This is I was done. But my Requirement is if any empty Cell in Excel That File not uploaded it display one error message Please upload Correct Excel File
    How to find out each Cell having Data or Not in Excel File by Using WDJ. Please tell me.
    By Using this Code I have Upload Excel File
    InputStream text = null;
         int temp = 0;
         //wdComponentAPI.getMessageManager().reportSuccess("filePath Vijay:::");
         try
                   File file = new File(wdContext.currentContextElement().getResource().getResourceName().toString());     
    FileOutputStream op = new FileOutputStream(file);
                   if (wdContext.currentContextElement().getResource()!= null)
                          text = wdContext.currentContextElement().getResource().read(false);
                             while((temp=text.read())!= -1)
                                  op.write(temp);
                                  op.flush();
                                  op.close();
                                  path = file.getAbsolutePath();
                                  //wdComponentAPI.getMessageManager().reportSuccess("Path Name :::::"+path);
         catch(Exception ex)               
                   ex.printStackTrace();
    But my Requirement is If excel having any Empty Cell that excel file not uploaded.How to do this...
    Regards
    Vijay Kalluri

    Hi my friend
    I would like to share you some APACHE APi´s that i use when i have to read excel files in Web Dynpro.
    JAR = poi-3.2-FINAL-20081019.jar
    Some Example:
    POIFSFileSystem fs;
    HSSFWorkbook wb;
    HSSFSheet sheet;
    String myMexican_ValueFromExcelis = "";
    try {
             fs = new POIFSFileSystem(new FileInputStream();
             // and select the cell "y"
            cell = row.getCell( 0 );
            myMexican_ValueFromExcelis = cell.getCellValue();  
    }cach(Exception e){
    REgargds

  • Persistant Status Bar Notification ... error 'SP.UI.Status' is null or not an object

    I want to show a status bar that needs to be persistent on a page. for this I used the following in my master page
    function ShowStatusBarMessage(title, message)
    var statusId = SP.UI.Status.addStatus(title, message, true);
    SP.UI.Status.setStatusPriColor(statusId, 'yellow'); /* Set a status-color */
    HTML, call the JS method:
    <a onclick="ShowStatusBarMessage('Title'!','Awesome message!')">
    Display Status Bar message!
    </a>
    ref:
    http://www.zimmergren.net/archive/2010/03/17/sp-2010-dynamically-displaying-messages-to-your-users-with-the-notification-and-status-bar-areas-in-sharepoint-2010.aspx
    But what I want is
    to call the function on load. So I used pushed ny function to _spBodyOnLoadWrapper using _spBodyOnLoadFunctionNames.push("YourFunctionName");,
    it throws an error 'SP.UI.Status' is null or not an object
    Next I created and
    deployed a webcontrol and did a registerclientscript, that too gives me 'SP.UI.Status' is null or not an object
    // Define the name and type of the client scripts on the page.
    String csname1 = "AlertScript";
    Type cstype = this.GetType();
    // Get a ClientScriptManager reference from the Page class.
    ClientScriptManager cs = Page.ClientScript;
    // Check to see if the startup script is already registered.
    if (!cs.IsStartupScriptRegistered(cstype, csname1))
    StringBuilder cstext1 = new StringBuilder();
    cstext1.Append("<script type=text/javascript> alert('Hello World!');");
    cstext1.Append("var statusId = SP.UI.Status.addStatus('title', 'message', true);");
    cstext1.Append("SP.UI.Status.setStatusPriColor(statusId, 'yellow'); </");
    cstext1.Append("script>");
    cs.RegisterStartupScript(cstype, csname1, cstext1.ToString());
    What am I missing ?
    How can I get to show a status bar on load of any page, just as you get a health analyzer message when you get into the Central Admin?
    Thanks, Mano
    Mano Mangaldas | Blog : http://howtosharepoint.blogspot.com 

    Ok, for some reason, it is not working for me. Below are the code that didnt work for me
    <script type="text/javascript">
    function ShowStatusBarMessage(title, message)
    var statusId = SP.UI.Status.addStatus(title, message, true);
    SP.UI.Status.setStatusPriColor(statusId, 'red');
    ShowStatusBarMessage('Title!','Awesome message!');
    </script>
    This too didnt work
    <script type="text/javascript">
    function ShowStatusBarMessage()
    var statusId = SP.UI.Status.addStatus('Some title', 'Some message', true);
    SP.UI.Status.setStatusPriColor(statusId, 'red');
    _spBodyOnLoadFunctionNames.push("ShowStatusBarMessage");
    </script>
    I did try to register client script block programatically, that too didnt work
    String csname1 = "AlertScript";
    Type cstype = this.GetType();
    // Get a ClientScriptManager reference from the Page class.
    ClientScriptManager cs = Page.ClientScript;
    // Check to see if the startup script is already registered.
    if (!cs.IsStartupScriptRegistered(cstype, csname1))
    StringBuilder cstext1 = new StringBuilder();
    cstext1.Append("<script type=text/javascript>");
    cstext1.Append("var statusId = SP.UI.Status.addStatus('title', 'message', true);");
    cstext1.Append("SP.UI.Status.setStatusPriColor(statusId, 'yellow'); </");
    cstext1.Append("script>");
    cs.RegisterStartupScript(cstype, csname1, cstext1.ToString());
    Any help appreciated.
    But the below code works..
    <script type="text/javascript">
    function ShowStatusBarMessage(title, message)
    var statusId = SP.UI.Status.addStatus(title, message, true);
    SP.UI.Status.setStatusPriColor(statusId, 'yellow'); /* Set a status-color */
    </script>
    <a onclick="ShowStatusBarMessage('Title!','Awesome message!')" href="#">
    Display Status Bar message!
    </a>
    Thanks
    mano
    Mano Mangaldas | Blog : http://howtosharepoint.blogspot.com 

  • Apex 4.1 IR: $.datepicker._curInst' is null or not an object

    Funniest thing after upgrade from 4.0 to 4.1 - Getting page error on IR when trying to create filters:
    Webpage error details
    User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; GTB7.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)
    Timestamp: Mon, 26 Sep 2011 17:36:52 UTC
    Message: '$.datepicker._curInst' is null or not an object
    Line: 18
    Char: 130532
    Code: 0
    URI: https://xxxxxxxxxxxxx/i/javascript/apex_4_1.min.js
    Message: '$.datepicker._curInst' is null or not an object
    Line: 18
    Char: 130532
    Code: 0
    URI: https://xxxxxxxxxxxxx/i/javascript/apex_4_1.min.js
    Message: '$.datepicker._curInst' is null or not an object
    Line: 18
    Char: 130532
    Code: 0
    URI: https://xxxxxxxxxxxxx/i/javascript/apex_4_1.min.js
    Message: '$.datepicker._curInst' is null or not an object
    Line: 18
    Char: 130532
    Code: 0
    URI: https://xxxxxxxxxxxxx/i/javascript/apex_4_1.min.js
    Message: '$.datepicker._curInst' is null or not an object
    Line: 18
    Char: 130532
    Code: 0
    URI: https://xxxxxxxxxxxxx/i/javascript/apex_4_1.min.js
    And the problem solution:
    Check your IR columns. The problem occurs when column without heading exists. I had one column with &npsp; heading. I renamed that column and now IR works fine.
    Greetings from Slovenia,
    Mitja Mavrič

    I am unable to reproduce the issue from my side, since it is JavaScript issue, i would suggest to clear the browser cache, history, Temporary internet files and then try again.

  • Is null validation not working correctly

    I have an application in which I have created a data entry page. We are using apex version 3.0.1.00.08.
    I have an item whose source is a database column which has a select list associated with it, as I want to show the user that they have not yet picked anything from the select list i have the lov properties set as follows:
    display null = Yes
    null display value = Please select
    I also have a page processing validation to check that the user has entered a value. the code for this validation is as follows:
    if :P1_DATA_ITEM is null then
    return 'This value for this Item must be selected before this record can be saved to the database';
    else
    return null;
    end if;
    However on the save button if but the user not selected a value for P1_DATA_ITEM so it is still showing -- please select -- the validation does not fail and lets the user save the record. This is not the behaviour that I want as I am trying to trap the fact that the user has not selected a value.
    This seems to indicate that Apex thinks P1_DATA_ITEM is not null so i checked session state for this item and it is showing %null%.
    How can I get a select list to indicate that the user has not actually selected a value but also to validate correctly, how do I deal with items when their session state is %null%.
    The only way round this issue that I have found is to use a radio button because it is obvious that the user has not yet selected a value but I would prefer to use a select list as we will need to do the same thing for other fields where a radio button would be impractical. I also need to indicate to the user that they still have to pick a value for this field and if you do not set the proprerty display null to Yes then it looks to the user as though they have selected an item becuse the first value in the select list appears.
    Can anyone advise on this.
    Regards
    Kay

    Hi Kay...
    Patrick wolf came up with this excellent piece of code here on this forum (I'd reference it but I can't find it at the moment.
    Instead of checking for the %null% state of each select list item on every page you can use this application process to do the job for you...
    Create an Application process
    -) Name: APP_Remove_NULLS
    -) Sequence: 0 (should be a number before any of your page level processes)
    -) On submit: After Page Submission - Before Computations and Validations
    BEGIN
        FOR rItem IN
          ( SELECT ITEM_NAME
              FROM APEX_APPLICATION_PAGE_ITEMS
             WHERE APPLICATION_ID   = TO_NUMBER(:APP_ID)
               AND PAGE_ID          = TO_NUMBER(:APP_PAGE_ID)
               AND LOV_DISPLAY_NULL = 'Yes'
               AND LOV_DEFINITION   IS NOT NULL
               AND LOV_NULL_VALUE   IS NULL
        LOOP
            IF V(rItem.ITEM_NAME) = '%null'||'%'
            THEN
                Apex_Util.set_session_state(rItem.ITEM_NAME, NULL);
            END IF;
        END LOOP;
    /* if you have select lists in your page zero items, remove this comment
        FOR rItem IN
          ( SELECT ITEM_NAME
              FROM APEX_APPLICATION_PAGE_ITEMS
             WHERE APPLICATION_ID   = TO_NUMBER(:APP_ID)
               AND PAGE_ID          = 0
               AND LOV_DISPLAY_NULL = 'Yes'
               AND LOV_DEFINITION   IS NOT NULL
               AND LOV_NULL_VALUE   IS NULL
        LOOP
            IF V(rItem.ITEM_NAME) = '%null'||'%'
            THEN
                Apex_Util.set_session_state(rItem.ITEM_NAME, NULL);
            END IF;
        END LOOP;
    END;This is the first thing I do when I create a new application... It removes that whole '%null'||'%' can of worms in one go...
    Gus..

  • 'schInternalColumn' is null or not an object - Error in DIS

    Hi all..
    When I am going to paste any document in DIS, " 'schInternalColumn' is null or not an object " this error comes with check in page...
    What is the issue behind this...Please help me..
    Regards
    Yogita

    Hi Yogita ,
    This issue has got introduced from 0717 patchset that is provided for UCM server , it is already fixed and a patch will be released for the same soon .
    You can select OK (I think it shows up around 7 times) and continue with the operations on DIS . It does not break any functionality .
    Thanks
    Srinath
    Edited by: Srinath Menon on Sep 5, 2012 12:54 PM

  • Error 'this.node.parentNode is null or not an object' with search highlight in certain topics

    goto
    http://www.afas.nl/profithelp/2_8_2/SE/index.htm
    Click 'zoeken' (search)
    Be sure that 'Zoekresultaten markeren' (search highlight) is
    checked
    Type 'activa'
    Click the topic 'activa'
    An error is displayed in the bottom left corner:
    'this.node.parentNode is null or not an object'
    If search highlight is not used, the error is not displayed.
    Any ideas?

    I think I have it, but it's almost unbelieveable.
    In the activa topic, the word is highlighted up to a point.
    Coming to the next instance of activa, you have this code:
    <li class=p-BulletedList><p
    class=BulletedList><b><span style="font-weight:
    normal;">V:</b> v</span>aste activa waarop wordt
    afgeschreven (Dit is de standaard waarde) . . . </p>
    Note the superfluous <b> and </b> tags,
    especially with the <span> calling for normal font-weight.
    Suppose this is a valid string. Because the opening tags are
    <b><span . . .>,
    the closing sequence should be
    </span>...</b>
    I'm not sure exactly why the error does what it does.
    Perhaps this is a simple html error that happens to come in
    an awkward place, or
    Because the browser expects </span> first, it treats
    </b> as text, so the <b> never gets closed, which
    confuses the search highlight script.
    I've run into something like this before. Repeated
    application, changes and deletion of font attributes in
    approximately the same place sometimes results in confused tags.
    Similarly, when you apply a build tag to styled text, and perhaps
    change the font attribute, opening and closing tags get confused.
    It may depend on the precise locations where you started and ended
    your highlights during editing.
    You'd expect this to be a harmless html error, but in this
    case, it breaks the highlight code, I believe.
    You're in a better position to test this than I am, so I
    await your results.
    Harvey

Maybe you are looking for

  • My iphone 4s mails, safari, facebook and apps no longer work all of a sudden

    I got this problem from yesterday. When I open mails or safari or any applications they would close all of sudden. even my messages no longer works and I can't send a text to anyone. When I go to settings everything seems fine and ios 6 is up to date

  • Uploading in Typepad

    In the past, I uploaded pictures from my library, no problems. Now that I have the upgrade I can't find the file path to any of my photos. I hit a dead end at the library. My quick fix is to drag photos onto the desktop and download from there.

  • How to set the view privilege of a portlet?

    Dear all, I would like to ask how to set the view privilege of a portlet (which is located on the Intranet homepage) to only a group of users? As far as I know, I can create a tab with view privilege to address the about scenario. But is it possible

  • ENHANCEMENT-POINT / Enhancement in ECC 6.0

    Hi all! I have been searching for an answer.  I have yet to find anything. Anyway here's my question: I am using an SAP provided enhancement point.  (I think) It looks like this in the code: ENHANCEMENT-POINT me_print_po_01 SPOTS es_saplmedruck. $$-S

  • Is iMessage down in Canada? My messages are not delivering

    Someone help