Community articlecreateCell method
Added by IBM contributorIBM on July 26, 2013
Rate this article 1 starsRate this article 2 starsRate this article 3 starsRate this article 4 starsRate this article 5 stars


Use this method to create a new cell item for a combobox, list, or popup. The createCell method adds one new cell to a group on a page in the form. Note that this method can only assign a name to the new cell; it cannot set the value of the cell. To set the value of a cell, you must use the setLiteralByRefEx method.
This method is called from a page level node, and creates the new cell in that page. Note that you cannot call this method from the global page node.


   public FormNodeP createCell (
      String theCellName,
      String theGroupName
   )throws UWIException;


Table 1. Method parameters
theCellNameStringThe name of the new cell being created.
theGroupNameStringThe name of the group option to which the new cell will be added.


A FormNodeP containing the new cell or throws a generic exception (UWIException) if an error occurs.


This sample code makes two calls to the createCell method to add two new cells to the same group:
   private static void addColorCells (FormNodeP theForm) throws Exception
   FormNodeP theCell;
   FormNodeP thePage;
   /* The FormNodeP called thePage contains the page in which the cell will
      be added. */
      thePage = (theForm.getChildren()).getNext();
      theCell = thePage.createCell("ORANGE_CELL","POPUP1_GROUP");
   /* The call to setLiteralByRefEx assigns the value Orange to the new cell.*/
      theCell.setLiteralByRefEx(null, "value", 0, null, null, "Orange");
      theCell = thePage.createCell("PURPLE_CELL ", "POPUP1_GROUP");
      theCell.setLiteralByRefEx(null, "value", 0, null, null, "Purple");

Parent topic:
FormNodeP class