Control fields

What are the best practices for the control fields in a transactional system? Areas such as modified_dt, created_dt, user_id, etc..

What is the best way to fill in these fields? Through triggers?

When, or even not at all, has sense to store the modified_dt and the created_dt as dates with time zone?

There are two ways you can fill the columns - either in the application itself or through triggers. I would choose triggers for consistency, since in this way avoids the issue of developers forget to set values for each insert or update. There are a few disadvantages of having information on the changes in the tables - if the recording is updated there is no way to know which column is set to day or what were the old values and if deleted, there is no record of deletion, given that the line would have disappeared from the table.

The other way to save the changes by user/date is to capture the information a separate table (for example, table_name, action = insert/update/delete, column_name, user/date), using triggers. Have a single table to store all this information has certain advantages such as the ability to quickly summarize all the changes made to critical tables in a weekly/monthly report without analyzing hundreds of other tables individually to the user and the date. You can also develop the design of this change table to add columns new_value and old_value to capture the old and new values of the column has changed during the update.

Tags: Database

Similar Questions

  • Groovy - BC Business Rules control field value

    Hi all

    Version: 11.1.1.4

    I'm trying to figure out how I can add a business on my model layer rule to check a value. I don't see a Boolean selection in the groovy on the entity object attribute selections under compare?

    Not sure how I could achieve with the selections of available rules?

    Basically, I wanted to do something like this:

    if(StartDate == null)
    {
      return false
    }
    else
    {
      return true
    }

    If you need to create using validation complex groovy. Here are some links to start with:
    http://www.Oracle.com/technetwork/developer-tools/jdev/introduction-to-Groovy-128837.PDF
    http://download.Oracle.com/otn_hosted_doc/JDeveloper/11gdemos/ADF_Insider_Groovy/ADF_Insider_Groovy.html
    http://blogs.Oracle.com/raghuyadav/2010/06/groovy_samples.html

  • Images in the field of the list does not

    Hello

    I create a list field that contains 10 lines and four fields in each line. The first field is the field of the image. But the image does not come. Other three fields (label field) do very well. I use the simulator of 4.7 and 9530.

    I give my code here also. Please help me.

    class TaskListField extends ListField implements ListFieldCallback {
         private Vector rows;
         private Bitmap _mReceiveAmount;
         private Bitmap _mSentAmount;
        private boolean hasfocus=false;
    
         public TaskListField() {
          super(0, ListField.MULTI_SELECT);
          setRowHeight(60);
          setEmptyString("It is Empty!", DrawStyle.HCENTER);
          setCallback(this);
    
          String images[]={"amount_received.png","amount_sent.png"};
    
          _mReceiveAmount = Bitmap.getBitmapResource("amount_received.png");
          _mSentAmount = Bitmap.getBitmapResource("amount_sent.png");
          BitmapField bitmap;
    
          rows = new Vector();
    
          for (int x = 0; x < 10; x++) {
           TableRowManager row = new TableRowManager();
    
           // SET THE  BITMAP FIELD
           // if amount received, display bitmap
         //  if (x % 2 == 0) {
            //bitmap=new BitmapField(_mReceiveAmount);
            row.add(new BitmapField(Bitmap.getBitmapResource(images[0])));
          //}
           // if amount is sent, set bitmap
           //else {
           // bitmap=new BitmapField(_mSentAmount);
              // row.add(new BitmapField(Bitmap.getBitmapResource(images[1])));
          // }
    
           // SET THE DATE LABELFIELD
    //
           LabelField _mDateField = new LabelField("OCT 10,2010", DrawStyle.ELLIPSIS);
           row.add(_mDateField);
    
           // SET THE LIST NAME
           row.add(new LabelField("Details" ,DrawStyle.ELLIPSIS) {
            protected void paint(Graphics graphics) {
             graphics.setColor(0x00878787);
             super.paint(graphics);
            }
           });
    
           // SET THE DUE DATE/TIME
           row.add(new LabelField("$220",DrawStyle.ELLIPSIS | LabelField.USE_ALL_WIDTH | DrawStyle.RIGHT) {
            protected void paint(Graphics graphics) {
             graphics.setColor(0x00878787);
             super.paint(graphics);
            }
           });
           rows.addElement(row);
          }
          setSize(rows.size());
    
         }
    
         // ListFieldCallback Implementation
         public void drawListRow(ListField listField, Graphics g, int index, int y,int width) {
    
            // g.drawBitmap(0, 0, _mReceiveAmount.getWidth(), _mReceiveAmount.getHeight(), _mReceiveAmount, 0, 0);
             TaskListField list = (TaskListField) listField;
    
             TableRowManager rowManager = (TableRowManager) list.rows.elementAt(index);
             rowManager.drawRow(g, 0, y, width, list.getRowHeight());
         // g.drawBitmap(0, 0, _mReceiveAmount.getWidth(), _mReceiveAmount.getHeight(), _mReceiveAmount, 0, 0);
         }
    
         public class TableRowManager extends Manager {
          public TableRowManager() {
           super(0);
          }
    
          // Causes the fields within this row manager to be layed out then
          // painted.
          public void drawRow(Graphics g, int x, int y, int width, int height) {
           // Arrange the cell fields within this row manager.
           layout(width, height);
    
           // Place this row manager within its enclosing list.
           setPosition(x, y);
    
           // Apply a translating/clipping transformation to the graphics
           // context so that this row paints in the right area.
           g.pushRegion(getExtent());
    
           // Paint this manager's controlled fields.
           subpaint(g);
    
           g.setColor(0x00CACACA);
           g.drawLine(10, 0, getPreferredWidth()-10, 0);
    
           // Restore the graphics context.
           g.popContext();
          }
    
          // Arranges this manager's controlled fields from left to right within
          // the enclosing table's columns.
          protected void sublayout(int width, int height) {
           // set the size and position of each field.
           int fontHeight = Font.getDefault().getHeight();
           int preferredWidth = getPreferredWidth();
    
           // start with the Bitmap Field of the priority icon
           Field field = getField(0);
           layoutChild(field, 32, 32);
           setPositionChild(field, 10, 20);
    
           // set the task name label field
           field = getField(1);
           layoutChild(field, 120, fontHeight + 1);
           setPositionChild(field, 70, 3);
    
           // set the list name label field
           field = getField(2);
           layoutChild(field, 150, fontHeight + 1);
           setPositionChild(field, 190, 3);
    
           // set the due time name label field
           field = getField(3);
           layoutChild(field, 150, fontHeight + 1);
           setPositionChild(field, preferredWidth - 172, 3);
    
           setExtent(preferredWidth, getPreferredHeight());
          }
    
          // The preferred width of a row is defined by the list renderer.
          public int getPreferredWidth() {
           return Graphics.getScreenWidth();
          }
    
          // The preferred height of a row is the "row height" as defined in the
          // enclosing list.
          public int getPreferredHeight() {
           return getRowHeight();
          }
         }
    
         public Object get(ListField listField, int index) {
          // TODO Auto-generated method stub
          return null;
         }
    
         public int getPreferredWidth(ListField listField) {
          // TODO Auto-generated method stub
          return 0;
         }
    
         public int indexOfList(ListField listField, String prefix, int start) {
          // TODO Auto-generated method stub
          return 0;
         }
    
         public void onUnFocus(){
             hasfocus=false;
             invalidate();
    
         }
    
    }
    

    your code is quite a mess, and you probably have a misconception on the listfield.

    in drawListRow you paint directly the object to the line. no need to use fields or similar, graphics methods.

    If you have different objects in your listfield you need to branch in your drawListRow method (if bitmap instanceof object etc.).

    your brief description, it appears you want to have the bitmap in the same line as your other information.

    create a bean with the attributes class, that you need, including the bitmap.

    put objects of beans in your listfield and the data structure (vector).

    drawListRow check that it is a bean and draw it.

    for example (rough code, no control null etc.):

    drawBitmap (0, bean.getBitmap ());

    drawText (bean.getBitmap (.getWidth () + 5,) bean.getText ());

  • using a custom field - noob

    Hello

    I'm quite new to Java programming, I followed some of the guides provided on how to create Blackberry applications, though.  However I followed a pdf document called development, which describes how to create custom controls/fields.  The problem I have is once the class has been created, how to use it?

    I created a class called customButtonField.java, I try to call to create a new field as follows,

    customButtonField customButton = new customButtonField ("click me", "SQUARE", 0);

    The error I get is,

    cannot find symbol

    symbol: method customButtonField (java.lang.String, java.lang.String, int)
    Location: class mainScreenStyleScreen
    customButtonField customButton = new customButtonField ("click me", "SQUARE", 0);
    ^

    It is what is in the customButtonField class

    public customButtonField (label As String, int form, long style) {}
    Super (style);
    _label = label;
    shape _shape =;
    _font = getFont();
    _labelHeight = _font.getHeight ();
    _labelWidth = _font.getAdvance ("_label");
    }

    Any help would be appreciated!

    Hi mabs.

    A problem that I found with your code is that the average parameter set in the CustomButtonField constructor is 'int form'. However, when you call create your new instance with the "new" statement, you pass the value "SQUARE". 'SQUARE' is a string. If you pass a string as a parameter that requires an int.

  • The research of Web applications with fields of the Data Source that contains multiple values

    I have a Web application with a field that allows multiple values to be recorded similar to the list box. I need limit the allowed values for a large, over the list of the values currently stored in another Web application as a data source. I can not apply to the type of Data Source field that allows only single value selection. I also need to be able to use the search form Web App to search for items containing 1 OR more of the values in this field (a type of list control field search functionality). Here's what I tried to field types:

    • Text (String) or text (multi-line) field type - By saving a list of values separated by commas (outputs in the same way this list box) to an entry of text or textarea, the search only logic search exact string (including commas) and does not analyze individual values.
    • Type of list (checkbox) field - it allows me to search for multiple values using the logic of the GOLD, but the web application stores only the values that have been entered as an option in the field settings real web app. I tried to use a checkbox with minimal or empty options list, hoping that some values I sent more separate by a comma value chain would be still stored, but because the values come from my Web App data source and not stored with the field options list, they were not saved.

    Someone at - he found a way to do it?

    My other question is how can I use a multivalued field to similar as described above but return results containing the elements with ALL the values of this field (AND logic).

    Can someone enlighten me to the inner workings of the search BC logic web app?

    You don't need to use the predefined boxes or types of entries. Everything you can represent as a string (such as the values separated by commas in your example) can be saved in any field of webapp. The types of fields defined in the Web application are only used to translate internal representation (all channels) to the various user-friendly interpretations (checkboxes, radios, dates, links, etc.)

  • Text field problem

    Hi, who can help me with this

    I've done a few members bij field using insert-> control-> field = 1 domain name

    and I did I got the movie the following lines of script

    put vacuum in the field 1 = to start with a blank

    then I put this line for the random words

    put random word (5) of "open zien gaan few minute" in field 1

    the problem is that the field is not considered to be a field

    and so far there is no display text

    TIA

    Herman

    Assuming that really name you your field "Field 1" then try:

    put word at random (5) of "open zien gaan few minute" in the field "Field 1"

  • Enter the search AF pre-population fields: query on the workflow

    Hello.

    What is given:
    Trimmed with flow of task one with shared data control field. Workflow contains a fragment of a page with two components: < af:query > and < af:table >. A table object view only data reading b. < af:query > relate to the search for criteria in B. There are also several bind variables in B, which are used in the criteria.
    Task flow A is used in another workflow via < af:region >.

    What is needed:
    When entering bounded flow task first - show empty form search user and empty table.
    When entering bounded task flows next time and the user made no research yet (flow of task just left without hitting research first)-display empty form search user and empty table.
    When entering bounded task flows next time and the user made some search - engine search of filling with the last entered values, display the data in the table that is looking for values.

    What is the best/recommended approach for the implementation of such a feature?

    When debugging, I see on the tasks delineated stream input THAT VO B contains the last variable bind of previous run. But somehow, they are not reflected in the search form and are not applied when you use the automatically view key of the query criteria.

    I use JDeveloper 11.1.1.5

    Hello

    sounds like this use case: Re: try to keep the search criteria in the session and stubborn taskflow outside

    Frank

  • Field will not take or send data

    I have a form that I'm trying to update in some internal web application.

    My problem is that the first field of the form seems not to exist.  I can view the field and its properties in the designer and the associated XML source seems valid, but when I export or send shape data nothing gets exported or submitted for the first field.  If I try to open the PDF file with the data via a xdp file, the first field only fill up, but do the rest.

    It seems to me to be successful in deleting field and adding a new, but it seems to greatly increase the size of the file (90ko at least 133 KB, sometimes 300 KB).

    Have I missed something obvious that will make this field export and import its data?

    If not, is there a way to reduce the size of my PDF after that I have delete and re-create the field?

    Thank you
    Kyle

    Hello

    It is your bound control field or not. Maybebecause of bibding you can get posted data on the ground.

    Sometimes after copy/paste some elements on the form, the source xml of the form becomes little wrong, he begins to have a lot of lines like this:

    , due to this size form could be more than 1 MB, the solution is to remove the unnecessary lines.

    BR,

    Paul Butenko

  • CD/DvD button-satellite M - 40 X 105

    I have a problem making the CD/Dvd quick-buttons on the keyboard work with Windows Media Player. All the settings seem to be ok in Toshiba controls but it stil won't work! He drives me crazy! (it is not important sth, but... you know...)

    Any suggestions?

    Hello

    As much as I know that if you press the quick Windows Media Player supports only the Audio CD.
    This means that the audio CD should be in the driver before pressing the button.

    However, you can check the settings in the properties of controls on Toshiba.
    You can find them in the Panel--> Toshiba controls--> Aps Media tab.

    The Audio CD control field must be set to Windows Media Player.

    Good bye

  • How can I display this tab

    I have a "current control" and a "control field" tab. I can't understand what greatness lies the "control field", tab regardless of my actions.

    I'm sure it is an ID10T error, but if someone could show me what it does and how to reverse the trend, it would be greatly appreciated.

    Somehow, the second tab got his 'Page Visible' property set to False.  I don't know how do it interactively, but you can view it programmatically by obtaining a reference to the second page by using the 'Pages' property, then write true 'Page Visible' property.

  • Passing parameters to a reentrant Subvi

    Hello! I called a reentrant Subvi, as explained in http://digital.ni.com/public.nsf/allkb/9CE784F50F816EA18625751900775EBB. It works (I can start several instances of the Subvi), but for the good use, I need to pass the parameters to this sub - VI.

    I tried:

    (1) to use the limit to a data Jack - as seen, controls on the front panel of the show clone for a very short time, they were connected to the Jack, but after they are inactive and empty

    (2) to set the parameter of the vocation of the Subvi using 'Control Value.Set (Variant)'. In this case, I see fileds correctly initialized control on the front panel of the Subvi, but are not used - other control fields, which must be initialized with these starting values are empty.

    Before I called this "typed stricktly" Subvi, settings were connected to the inputs of the VI and everything went OK, except that I couldn't call the Subvi reentrant type stricktly - only an instance was active, then was opened when the previous one has been closed.

    What is the problem?

    Thank you in advance for the answers

    You are spawning the screw as it seems.

    The node "Call by reference" no do not work as you expect the reason is simple: the call of reference node of will end only if the VI called ended.

    I do not recommend to use datasocket for data transfer. Above, is that you don't need. You can always do it, but you must write the data to update the values. Just link it is not enough.

    Pass values using the VI Server (you must pass every parameter to a node) or using other transfermechanisms:

    -FGV, also known as AE

    -Notifier/tail

    -TCP based protocols such as STM

    hope this helps,

    Norbert

  • LaserJet Enterprise M577z MFP: LaserJet M577z MFP - how to set up SMTP account user individual device-based servers?

    Hello

    I have created multiple user accounts of device (local computer accounts) for different people who will use the scan-to-e-mail function on the M577z. Each person / user has a different e-mail provider (and the different e-mail address) and I need to enter different SMTP servers and ' from:' addresses to each device user account in the "Digital Scan / send - email setup" e-mail on the EWS (embedded Web server).

    However, so far I put servers SMTP configuration and only "of:" Correo electronico for all users, but not for each user individually. But this is not just because X user should not be able to scan and send from address of mail belonging to the user Y.

    How can I set up separate SMTP servers and ' from:' addresses in SAP for each user, individually?

    Thank you!

    In fact, I was able to fix it myself.

    In "Digital Scan / send - Email Setup ', under"Address and control field Message"I changed the option of ' of:' of ' default:' to ' address of the user (sign-in required).

    Thank you, in any case.

  • ListField and table LayoutManager

    Hello.

    I think that maybe that's my problem.

    I make use of this TableLayoutmanager (that I found on this site):

    public class TableLayoutManager extends Manager{ public TableLayoutManager(){ super(0); }     public void drawRow(Graphics g, int x, int y, int width, int height){ // Arrange the cell fields within this row manager. layout(width, height); // Place this row manager within its enclosing list. setPosition(x, y); // Apply a translating/clipping transformation to the graphics // context so that this row paints in the right area. g.pushRegion(getExtent()); // Paint this manager's controlled fields. subpaint(g); g.setColor(0x00CACACA); g.drawLine(0, 0, getPreferredWidth(), 0); // Restore the graphics context. g.popContext(); } protected void sublayout(int width, int height) { // TODO Auto-generated method stub int preferredWidth = getPreferredWidth(); int preferredHeight = getPreferredHeight(); Field field = getField(0); layoutChild(field, preferredWidth - 110, preferredHeight); setPositionChild(field, 35, 12); field = getField(1); layoutChild(field, 75, preferredHeight); setPositionChild(field, preferredWidth-75, 11); setExtent(preferredWidth, preferredHeight); } public int getPreferredWidth() { return Graphics.getScreenWidth(); } // The preferred height of a row is the "row height" as defined in the // enclosing list. public int getPreferredHeight() { return getContentHeight(); } }
    

    for this ListField:

    public class MenuListField extends ListField implements ListFieldCallback { /* * This code created based on rtm4bb HomeMenuListField.java */ private Font font; TableLayoutManager[] rows; public MenuListField(){ // this number should be the same with rows = new TableRowManager[7] // or list item in item field wont show super(9); setEmptyString("sorry, No Menu", DrawStyle.HCENTER); setCallback(this); // this row height to show the height setRowHeight(36); font = Font.getDefault(); rows = new TableLayoutManager[9]; // create a table row manager rows[0] = new TableLayoutManager(); // set the menu item name rows[0].add(new RichTextField("Computer Literacy", DrawStyle.ELLIPSIS)); // set the number of list items if there are any rows[0].add(new LabelField("All our Computer Literacy Options", DrawStyle.ELLIPSIS | Field.USE_ALL_WIDTH | DrawStyle.RIGHT)); rows[0].add(new LabelField("For All Prices and Course Content, Click Here!", DrawStyle.ELLIPSIS | Field.USE_ALL_WIDTH | DrawStyle.RIGHT)); // create a table row manager rows[1] = new TableLayoutManager(); // set the menu item name rows[1].add(new RichTextField("Office Assistant", DrawStyle.ELLIPSIS)); // set the number of list items if there are any rows[1].add(new LabelField("Secretarial Courses", DrawStyle.ELLIPSIS | Field.USE_ALL_WIDTH | DrawStyle.RIGHT)); rows[1].add(new LabelField("For All Prices and Course Content, Click Here!", DrawStyle.ELLIPSIS | Field.USE_ALL_WIDTH | DrawStyle.RIGHT)); // create a table row manager rows[2] = new TableLayoutManager(); // set the menu item name rows[2].add(new RichTextField("Pastel", DrawStyle.ELLIPSIS)); // set the number of list items if there are any rows[2].add(new LabelField("Pastel Options", DrawStyle.ELLIPSIS | Field.USE_ALL_WIDTH | DrawStyle.RIGHT)); rows[2].add(new LabelField("For All Prices and Course Content, Click Here!", DrawStyle.ELLIPSIS | Field.USE_ALL_WIDTH | DrawStyle.RIGHT)); // create a table row manager rows[3] = new TableLayoutManager(); // set the menu item name rows[3].add(new RichTextField("Technical", DrawStyle.ELLIPSIS)); // set the number of list items if there are any rows[3].add(new LabelField("Technical Courses", DrawStyle.ELLIPSIS | Field.USE_ALL_WIDTH | DrawStyle.RIGHT)); rows[3].add(new LabelField("For All Prices and Course Content, Click Here!", DrawStyle.ELLIPSIS | Field.USE_ALL_WIDTH | DrawStyle.RIGHT)); // create a table row manager rows[4] = new TableLayoutManager(); // set the menu item name rows[4].add(new RichTextField("Graphic Design", DrawStyle.ELLIPSIS)); // set the number of list items if there are any rows[4].add(new LabelField("Graphic Design Courses", DrawStyle.ELLIPSIS | Field.USE_ALL_WIDTH | DrawStyle.RIGHT)); rows[4].add(new LabelField("For All Prices and Course Content, Click Here!", DrawStyle.ELLIPSIS | Field.USE_ALL_WIDTH | DrawStyle.RIGHT)); // create a table row manager rows[5] = new TableLayoutManager(); // set the menu item name rows[5].add(new RichTextField("IT", DrawStyle.ELLIPSIS)); // set the number of list items if there are any rows[5].add(new LabelField("Our IT Options", DrawStyle.ELLIPSIS | Field.USE_ALL_WIDTH | DrawStyle.RIGHT)); rows[5].add(new LabelField("For All Prices and Course Content, Click Here!", DrawStyle.ELLIPSIS | Field.USE_ALL_WIDTH | DrawStyle.RIGHT)); // create a table row manager rows[6] = new TableLayoutManager(); // set the menu item name rows[6].add(new RichTextField("Web Design", DrawStyle.ELLIPSIS)); // set the number of list items if there are any rows[6].add(new LabelField("Web Design Courses", DrawStyle.ELLIPSIS | Field.USE_ALL_WIDTH | DrawStyle.RIGHT)); rows[6].add(new LabelField("For All Prices and Course Content, Click Here!", DrawStyle.ELLIPSIS | Field.USE_ALL_WIDTH | DrawStyle.RIGHT)); // create a table row manager rows[7] = new TableLayoutManager(); // set the menu item name rows[7].add(new RichTextField("Programming", DrawStyle.ELLIPSIS)); // set the number of list items if there are any rows[7].add(new LabelField("Our Programming Options", DrawStyle.ELLIPSIS | Field.USE_ALL_WIDTH | DrawStyle.RIGHT)); rows[7].add(new LabelField("For All Prices and Course Content, Click Here!", DrawStyle.ELLIPSIS | Field.USE_ALL_WIDTH | DrawStyle.RIGHT)); // create a table row manager rows[8] = new TableLayoutManager(); // set the menu item name rows[8].add(new RichTextField("Business Admin", DrawStyle.ELLIPSIS)); // set the number of list items if there are any rows[8].add(new LabelField("Business Oriented Courses", DrawStyle.ELLIPSIS | Field.USE_ALL_WIDTH | DrawStyle.RIGHT)); rows[8].add(new LabelField("For All Prices and Course Content, Click Here!", DrawStyle.ELLIPSIS | Field.USE_ALL_WIDTH | DrawStyle.RIGHT)); // create a table row manager rows[9] = new TableLayoutManager(); // set the menu item name rows[9].add(new RichTextField("Two Year", DrawStyle.ELLIPSIS)); // set the number of list items if there are any rows[9].add(new LabelField("Two Year Courses", DrawStyle.ELLIPSIS | Field.USE_ALL_WIDTH | DrawStyle.RIGHT)); rows[9].add(new LabelField("For All Prices and Course Content, Click Here!", DrawStyle.ELLIPSIS | Field.USE_ALL_WIDTH | DrawStyle.RIGHT)); } public void drawListRow(ListField listField, Graphics graphics, int index, int y, int width) { // TODO Auto-generated method stub MenuListField list = (MenuListField) listField; TableLayoutManager rowManager = list.rows[index]; rowManager.drawRow(graphics, 0, y, width, list.getRowHeight()); } public Object get(ListField listField, int index) { // TODO Auto-generated method stub return null; } public int getPreferredWidth(ListField listField) { // TODO Auto-generated method stub return Graphics.getScreenWidth(); } public int indexOfList(ListField listField, String prefix, int start) { // TODO Auto-generated method stub return -1; } protected boolean trackwheelClick(int status, int time) { int index = getSelectedIndex(); // Dialog.inform("Clicked " + Integer.toString(index)); /*if( index == 0 ) { new MenuCategoryController(); } */ switch(index) { case 0: UiApplication.getUiApplication().pushScreen(new ComputerLiteracyScreen()); break; case 1: UiApplication.getUiApplication().pushScreen(new OfficeAssistantScreen()); break; case 2: UiApplication.getUiApplication().pushScreen(new PastelScreen()); break; case 3: UiApplication.getUiApplication().pushScreen(new TechnicalScreen()); break; case 4: UiApplication.getUiApplication().pushScreen(new GraphicDesignScreen()); break; case 5: UiApplication.getUiApplication().pushScreen(new ITScreen()); break; case 6: UiApplication.getUiApplication().pushScreen(new WebDesignScreen()); break; case 7: UiApplication.getUiApplication().pushScreen(new ProgrammingScreen()); break; case 8: UiApplication.getUiApplication().pushScreen(new BusinessAdminScreen()); break; case 9:      UiApplication.getUiApplication().pushScreen(new TwoYearScreen());   break; } return true; } }
    

    And I call it like:

     MenuListField mylist = new MenuListField();
    

    Now my app keeps throwing errors IndexOutOfBounds.

    I've implemented the table layout manager properly?

    Hannes

    In your situation, I think that most of the BlackBerry users expect to see a drill down, where they see a list of courses in a ListField, then click on the course to see more detail for this course in a different window.

  • Cannot navigate back to the previous screen (screen cannot be closed with the ESC key)

    Hi all

    I create simple BB app with eclipse jde 4.6.1, here the code example.

    class myApplication extends UiApplication
    {
        // applicatione entry point
        public static void main(String[] args)
        {
            // create an instance of our app
            myApplication theApp = new myApplication();
            // "run" the app
            theApp.enterEventDispatcher();
        }
        // app constructor
        public myApplication()
        {
         myScreen screen = new myScreen();
            pushScreen(screen);
        }
    }
    

    where my screen is like this

    public class myScreen extends MainScreen implements ListFieldCallback {
    private Vector menu;
    private ListField menuList;
    private MenuItem menuItem = new MenuItem("Details",100,10){
    public void run(){
    int index = menuList.getSelectedIndex();
    if (index == 1){
    Dialog.alert("list  "+index+" selected");
    }
    }
    };
    public void drawListRow(ListField listField, Graphics graphics, int index,
    int y, int width) {
         ListField menulist = (ListField) listField;
         MenuRowManager rowManager = (MenuRowManager)menu.elementAt(index);
         rowManager.drawRow(graphics, 0, y, width, menulist.getRowHeight());
    }
    
    public myScreen(){
    super(DEFAULT_MENU|DEFAULT_CLOSE);
    setTitle(new LabelField("myScreen", LabelField.USE_ALL_WIDTH | DrawStyle.HCENTER));
    
    this.addMenuItem(menuItem);
    createListMenu();
    }
    
    public void createListMenu(){
    menu = new Vector();
    menuList = new ListField(){
    protected boolean keyChar(char key, int status, int time){
    if (key == Characters.ENTER){
    // open next window
    int index = getSelectedIndex();
    switch (index){
    case 0: //
    break;
    case 1: //
    break;
    case 2: //
    break;
    case 3: //
    break;
    default: // about
    break;
    }
    }
    return true;
    }
    };
    menuList.setCallback(this);
    menuList.setRowHeight(60);
    menuList.setBackground(BackgroundFactory.createSolidBackground(Color.BLACK));
    
    // first item
    BitmapField mIcon = new BitmapField(Bitmap.getBitmapResource("image1.png"));
    LabelField lblM = new LabelField ("First list item", DrawStyle.LEFT);
    lblM.setFont(Font.getDefault().derive(Font.BOLD));
    MenuRowManager menuM = new MenuRowManager();
    menuM.add(mIcon);
    menuM.add(lblM);
    menu.addElement(menuM);
    
    // 2nd item
    BitmapField tIcon = new BitmapField(Bitmap.getBitmapResource("image2.png"));
    LabelField lblT = new LabelField("Theater Near Me", DrawStyle.LEFT);
    lblT.setFont(Font.getDefault().derive(Font.BOLD));
    MenuRowManager menuT = new MenuRowManager();
    menuT.add(tIcon);
    menuT.add(lblT);
    menu.addElement(menuT);
    
    add(menuList);
    }
    
    }
    

    and the definition of menuRowManager is like that

    public class MenuRowManager extends Manager
    {
        public MenuRowManager()
        {
            super(0);
        }
    
        // Causes the fields within this row manager to be layed out then
        // painted.
        public void drawRow(Graphics g, int x, int y, int width, int height)
        {
            // Arrange the cell fields within this row manager.
            layout(width, height);
    
            // Place this row manager within its enclosing list.
            setPosition(x, y);
    
            // Apply a translating/clipping transformation to the graphics
            // context so that this row paints in the right area.
            g.pushRegion(getExtent());
    
            // Paint this manager's controlled fields.
            subpaint(g);
    
            g.setColor(0x00CACACA);
            g.drawLine(0, 0, getPreferredWidth(), 0);
            //g.drawLine(10, 0, 10, getPreferredHeight());
    
            // Restore the graphics context.
            g.popContext();
        }
    
        // Arranges this manager's controlled fields from left to right within
        // the enclosing table's columns.
        protected void sublayout(int width, int height)
        {
            // set the size and position of each field.
            int fontHeight = Font.getDefault().getHeight();
            int preferredWidth = getPreferredWidth();
    
            // start with the Bitmap Field of menu icon
            Field field = getField(0);
            layoutChild(field, 48, 48);
            setPositionChild(field, 0, 6);
    
            // set the menu title label field
            field = getField(1);
            layoutChild(field, preferredWidth - 16, fontHeight+1);
            setPositionChild(field, 55, 30-fontHeight/2);
    
            setExtent(preferredWidth, getPreferredHeight());
        }
    
        // The preferred width of a row is defined by the list renderer.
        public int getPreferredWidth()
        {
            return Graphics.getScreenWidth();
        }
    
        // The preferred height of a row is the "row height" as defined in the
        // enclosing list.
        public int getPreferredHeight()
        {
            return 60;
        }
    }
    

    the problem is, when the first screen showed (pushed), I cannot "navigate back (close) the screen with ESC, won't my code?" Am I missing something here?

    Thanks in advance

    You want to substitute keyChar() into your custom domain.

    Don't forget that you must re - delegate all keystrokes that you do not consume.

  • Implementing custom listener for ListField

    I'm trying to implement a listener for a custom field I created that would launch a new screen when you click on the field. However, nothing happens when I click on the custom field. I use BlackBerry Java plug-in for Eclipse, JDK 1.3 and JRE 6.0. All my code is attached. MyScreen.java contains the code where I'm trying to implement a function fieldChanged.

    //MyApp.Java
    
    package mypackage;
    
    import net.rim.device.api.system.CodeModuleManager;
    import net.rim.device.api.ui.UiApplication;
    
    /**
     * This class extends the UiApplication class, providing a
     * graphical user interface.
     */
    public class MyApp extends UiApplication
    {
        /**
         * Entry point for application
         * @param args Command line arguments (not used)
         */
        public static void main(String[] args)
        {
            CodeModuleManager.promptForResetIfRequired();
    
            // Create a new instance of the application and make the currently
            // running thread the application's event dispatch thread.
            MyApp theApp = new MyApp();
            theApp.enterEventDispatcher();
        }
    
        /**
         * Creates a new MyApp object
         */
        public MyApp()
        {
            // Push a screen onto the UI stack for rendering.
            pushScreen(new MyScreen());
        }
    }
    
    //MyScreen.java
    
    package mypackage;
    
    import net.rim.device.api.ui.container.*; //for vertical manager
    import net.rim.device.api.ui.Field;
    import net.rim.device.api.ui.FieldChangeListener;
    import net.rim.device.api.ui.Manager;
    //import net.rim.device.api.ui.Screen;
    import net.rim.device.api.ui.component.*;
    import net.rim.device.api.ui.Color;
    import net.rim.device.api.ui.decor.BackgroundFactory;
    
    /**
     * A class extending the MainScreen class, which provides default standard
     * behavior for BlackBerry GUI applications.
     */
    public final class MyScreen extends MainScreen
    {
        /**
         * Creates a new MyScreen object
         */
        private CustomField cField;
    
        public MyScreen()
        {
            // Set the displayed title of the screen
            setTitle("My New App");
    
            cField = new CustomField("4.PNG","This is my 4th custom field!!");
            ButtonClickListener listener = new ButtonClickListener();
            cField.setChangeListener(listener);
            add(cField);
    
        }//MyScreen function
    
        class ButtonClickListener implements FieldChangeListener
        {
            public void fieldChanged(Field field, int context)
             {
                  //we need to determine which button was clicked
    
                  if(field == cField)
                      new SpeedBumpScreen();
    
             }
    
        }//ButtonClickListener
    
    }
    
    //CustomField.java
    
    package mypackage;
    
    import java.util.Vector;
    
    import net.rim.device.api.system.Bitmap;
    import net.rim.device.api.ui.*;
    import net.rim.device.api.ui.component.*;
    
    class CustomField extends ListField implements ListFieldCallback {
        private Vector rows;
    
        public CustomField(String customImg, String customLabel) {
            super(0, ListField.MULTI_SELECT);
            setRowHeight(80);
            setEmptyString("Hooray, no items here!", DrawStyle.HCENTER);
            //setCallback(this);
    
            Bitmap p1 = Bitmap.getBitmapResource(customImg); 
    
            rows = new Vector();
    
            TableRowManager row = new TableRowManager();
    
            row.add(new BitmapField(p1));
    
            // SET THE item NAME LABELFIELD
            // if overdue, bold/underline
            LabelField item = new LabelField("item #" + customLabel,
                DrawStyle.ELLIPSIS);
    
            // overdue
            item.setFont(Font.getDefault().derive(
                Font.BOLD | Font.UNDERLINED));
            System.out.println("OVERDUE");
    
            row.add(item);
    
            // SET THE LIST NAME
            row.add(new LabelField("List Name #" + String.valueOf(1),
                DrawStyle.ELLIPSIS) {
                protected void paint(Graphics graphics) {
                    graphics.setColor(0x00878999);
                    super.paint(graphics);
                }
            });
    
            // SET THE DUE DATE/TIME
            row.add(new LabelField("Due Date #" + String.valueOf(1),
                    DrawStyle.ELLIPSIS | LabelField.USE_ALL_WIDTH
                    | DrawStyle.RIGHT) {
                protected void paint(Graphics graphics) {
                    graphics.setColor(0x00878787);
                    super.paint(graphics);
                }
            });
    
            rows.addElement(row);
    
            setSize(rows.size());
    
        } //end public CustomField()
    
        // ListFieldCallback Implementation
        public void drawListRow(ListField listField, Graphics g, int index, int y,
                int width) {
            CustomField list = (CustomField) listField;
            TableRowManager rowManager = (TableRowManager) list.rows
                .elementAt(index);
            rowManager.drawRow(g, 0, y, width, list.getRowHeight());
        } //end drawListRow()
    
        private class TableRowManager extends Manager {
    
            public TableRowManager() {
                super(0);
            } //end pulic TableRowManager
    
            // Causes the fields within this row manager to be layed out then
            // painted.
            public void drawRow(Graphics g, int x, int y, int width, int height) {
                // Arrange the cell fields within this row manager.
                layout(width, height);
    
                // Place this row manager within its enclosing list.
                setPosition(x, y);
    
                // Apply a translating/clipping transformation to the graphics
                // context so that this row paints in the right area.
                g.pushRegion(getExtent());
    
                // Paint this manager's controlled fields.
                subpaint(g);
    
                g.setColor(0x00CACACA);
                g.drawLine(0, 0, getPreferredWidth(), 0);
    
                // Restore the graphics context.
                g.popContext();
            }//end drawRow()
    
            // Arranges this manager's controlled fields from left to right within
            // the enclosing table's columns.
            protected void sublayout(int width, int height) {
                // set the size and position of each field.
                int fontHeight = Font.getDefault().getHeight();
                int preferredWidth = getPreferredWidth();
    
                // start with the Bitmap Field of the priority icon
                Field field = getField(0);
                layoutChild(field, 32, 32);
                setPositionChild(field, 0, 0);
    
                // set the item name label field
                field = getField(1);
                layoutChild(field, preferredWidth - 16, fontHeight + 1);
                setPositionChild(field, 34, 3);
    
                // set the list name label field
                field = getField(2);
                layoutChild(field, 150, fontHeight + 1);
                setPositionChild(field, 34, fontHeight + 6);
    
                // set the due time name label field
                field = getField(3);
                layoutChild(field, 150, fontHeight + 1);
                setPositionChild(field, preferredWidth - 152, fontHeight + 6);
    
                setExtent(preferredWidth, getPreferredHeight());
            }//end sublayout()
    
            // The preferred width of a row is defined by the list renderer.
            public int getPreferredWidth() {
                return Graphics.BLACK;
            }
    
            // The preferred height of a row is the "row height" as defined in the
            // enclosing list.
            public int getPreferredHeight() {
                return getRowHeight();
            }
    
        }// private class TableRowManager extends Manager 
    
        public Object get(ListField listField, int index) {
            // TODO Auto-generated method stub
            return null;
        }
    
        public int getPreferredWidth(ListField listField) {
            // TODO Auto-generated method stub
            return 0;
        }
    
        public int indexOfList(ListField listField, String prefix, int start) {
            // TODO Auto-generated method stub
            return 0;
        }
    
    } //end class CustomField extends ListField implements ListFieldCallback
    
    //SpeedBumpScreen.java
    
    package mypackage;
    
    import net.rim.device.api.ui.Field;
    import net.rim.device.api.ui.component.RichTextField;
    import net.rim.device.api.ui.container.MainScreen;
    
    public final class SpeedBumpScreen extends MainScreen
    {
        /**
         * Creates a new HelloWorldScreen object
         */
        SpeedBumpScreen()
        {
            // Set the displayed title of the screen
            setTitle("Speed bump screen");
    
            // Add a read only text field (RichTextField) to the screen.  The
            // RichTextField is focusable by default. Here we provide a style
            // parameter to make the field non-focusable.
            add(new RichTextField("This is the speed bump screen!", Field.NON_FOCUSABLE));
        }
    
    }
    

    In addition, there is nothing in the ListField that will actually generate an event.

    Here is a simple extension to the ListField which will make "clickable".  In your FieldChangeListener you can use getSelectedindex to determine which line has the focus.

    Please ask if this isn't clear:

    public class ClickableListField extends ListField {
    
        public ClickableListField(int numberOfRows) {
            super(numberOfRows);
        }
    
        protected boolean navigationClick(int status, int time) {
            this.fieldChangeNotify(2);
            return true;
        }
    
        protected boolean touchEvent(TouchEvent message) {
            int x = message.getX( 1 );
            int y = message.getY( 1 );
            if( x < 0 || y < 0 || x > getExtent().width || y > getExtent().height ) {
                    // Outside the field
                    return false;
            }
            // If click, process Field changed
            if ( message.getEvent() == TouchEvent.CLICK ) {
                this.fieldChangeNotify(2);
                return true;
            }
            return super.touchEvent(message);
        }
    
    }
    

Maybe you are looking for

  • Satellite Pro U200: unable to update BIOS to v.3.70 - WIN

    Model No.: Satellite Pro U200 PLUA1EOS: Vista Business SP2Current BIOS: v. 3.50 Try to update the BIOS to v3.70 When I run P0044v370, I get a Windows Script Host message: "Script:C:\ProgramData\Toshiba\Common\_cabBDF1.tmp\autoExe c.vbeLine: 2Char: 1E

  • Satellite M40-237: how to connect the mobile phone with Bluetooth

    I have a new Noki 62333 and I have a Toshiba Satellite M40 - 237. I have a big problem with the connection between them. I put t know how to turn on bluetooth on my pc. Can you help me???

  • X 1 carbon 2014 Sim tray

    Hi my micro SIM can not enter with the tray inside the opening at the back of my thinkpad. Also, it is very difficult to maintain the microsim inside the status bar that is very small. I had X 300 before and no pb with my micro SIM. X 1 carbon 20 has

  • Silverlight.exe, how did you?

    I want to install Netflix but I get a pop-up asking if I want to save Silverlight.exe to a binary file.  I downloaded silverlight.exe but I get the same window, I can't install the netflix because I can't have this window of silverlight.exe.  Any sug

  • Export logs events to another host

    Hello I'm looking to export-> Firesight events connection to another host. What would be the best way to do this? I can't find any clear option in the GUI to export information. This information is in mysql or it is in a text file in the clear on the