Kbase 17885: Apptivity: How to manipulate navigation toolbar buttons
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  10/05/1998 |
|
Apptivity: How to manipulate navigation toolbar buttons
DRAFT COPY - Currently under review and edit.
INTRODUCTION:
=============
This K-base shows how-to manipulate the buttons on a Standard
Apptivity Navigation Bar.
WHY YOU NEED TO KNOW THIS:
===========================
If you want to use this panel to manipulate the DataSource in a
different way and add your own functionality, you want to be able
to make the buttons sensitive or not (When on the first record you
would disable the First and Previous buttons).
PROCEDURAL APPROACH:
====================
This example will show some sections of code indicating how to
proceed. Please pay attention to the fact that there can be a focus
problem at the moment you disable a button that has the Focus.
Steps to take:
1) Create some abButtons to hold the references. This can be done at
the end of the Form.java file:
//$END_DECLARE_OBJECTS
//tbo
//Inserting extra buttons to identify the nav-buttons
abButton BT_FIRST = null;
abButton BT_PREV = null;
abButton BT_NEXT = null;
abButton BT_LAST = null;
//***************************************************
2) In the initialization of your Application you can add the following
//$END_INIT_OBJECTS
for(int j = 0; j < nav1.subviews().count();j++){
if ((View) nav1.subviews().elementAt(j) instanceof abButton ){
abButton initButton = (abButton) nav1.subviews().elementAt(j);
if( ((Button) initButton).command().equals("first")){
BT_FIRST = initButton;
}
if( ((Button) initButton).command().equals("prev")){
BT_PREV = initButton;
}
if( ((Button) initButton).command().equals("next")){
BT_NEXT = initButton;
}
if( ((Button) initButton).command().equals("last")){
BT_LAST = initButton;
}
}
}
3) From that moment on the reference to the buttons on the panel is:
BT_FIRST.enable(true);
TBO
04/30/98
Progress Software Technical Support Note # 17885