Refresh the field label

Hi, I read many posts on the forum but I have not found any that solved my problem.

I'm new to the development of BB and I'm having a problem that I seem not to be able to untangle.

I have a main class and a class of the screen. I have a button that launches a datepicker. When the DatePicker is closed I need the label of the button to refresh with the selected value. How should I do?

I tried with invalidate, creating a CustomButtonField that implements different onFocus, onUnFocus and some other stuff, but I guess I have them implemented in a bad way...

My two classes are these...

public class TestClass extends UiApplication
{

public static calendar alarm1time = Calendar.getInstance (TimeZone.getTimeZone("GMT-3"));

Public Shared Sub main (String [] args)
{

TestClass testClass = new TestClass ();
testClass.enterEventDispatcher ();

}

Public TestClass()
{

pushScreen (new TestClassScreen());

}

}

/ public final class TestClassScreen extends screen
{

public TestClassScreen()
{

ButtonField alarm1 = new ButtonField ("alarm:" + TestClass.alarm1time.get (Calendar.HOUR_OF_DAY) + ":" + TestClass.alarm1time.get (Calendar.MINUTE), ButtonField.FOCUSABLE)

{

public boolean navigationClick (int status, int time)
{

datePicker (1);
Returns true;

}

};

setTitle ("Test alarm");
Add (new RichTextField(""));
Add (alarm1);

}

public void datePicker (mutable int alarmNumber)
{

UiApplication.getUiApplication () .invokeLater (new Runnable()
{

public void run()
{

DateTimePicker datePicker = null;
datePicker = DateTimePicker.createInstance (TestClass.alarm1time, null, "HH: mm");
If (datePicker.doModal ())
{

Calendar cal = datePicker.getDateTime ();
TestClass.alarm1time = cal.

Here I need the label to be updated, in the end the datePicker is Ok

}

}

});

}

}

Thank you

Alex

Welcome to the forums.

Here's one way:

public boolean navigationClick (int status, int time)
{

datePicker(1, this);
Returns true;

}

Public Sub switch of dates (alarmNumber final int, ButtonField buttonToUpdate final)
{

UiApplication.getUiApplication () .invokeLater (new Runnable()
{

public void run()
{

DateTimePicker datePicker = null;
datePicker = DateTimePicker.createInstance (TestClass.alarm1time, null, "HH: mm");
If (datePicker.doModal ())
{

Calendar cal = datePicker.getDateTime ();
TestClass.alarm1time = cal.

buttonToUpdate.setLabel (...)}

}

});

}

A more usual way of being having change listener listen to click on the button and perform a similar treatment in there.

Edit: The Code has been corrected.

Tags: BlackBerry Developers

Similar Questions

  • Setting the width of the field label

    I have a form on which I have two of my fields (columns) in the same row, using the start on new line = No and field = No parameters for the second field. However, this second field label is has no spacing at each end, so that it starts really close to the value for the first column area and really ends close to the area of the value of its own column. I want to add a bit of space, perhaps to increase the width of the cell holding the 2nd label.

    The first obvious option did not work: add empty spaces to the label itself.

    I tried to enter s tyle = "width: 275px" and width = 275px in the field attributes of HTML table cell, but none who does nothing.

    Running on 4.1.0.00.28.

    Any thoughts?

    Mark T. says:
    Any thoughts?

    Providing the following information always helps:

  • Full version of APEX
  • Edition and the full version of DB
  • (EPG, SST or APEX listener) Web server architecture
  • Browser (s) / version (s) used
  • Theme
  • Model (s)
  • Region (s)

    Just like any code published in packaging tags\

    ...\
    

    Tags to preserve the formatting and special characters

    Creating an example of apex.oracle.com is the best way to present a problem, especially those related to the HTML structure, page layout and form, the visual style and JavaScript.

    I tried to enter s tyle = "width: 275px" and width = 275px in the HTML table cell attributes field, but none of these makes anything.

    Which HTML attributes table cell? With start on new line = No and field = no. 1 point of control, the point label 2 and the 2nd point control will appear in the same cell, with only the attributes of the 1st checkpoint applied.

    width=275px 
    

    The width for cells in a table attribute is deprecated: use CSS instead. "275px" is also an invalid value for this attribute: value is a number that represents the width of the cell in pixels or percentage.

    The first obvious option did not work: add empty spaces to the label itself.

    Specification HTML load user agents to collapse the white space characters, so several areas will be grouped together in a single space.

    Round this is to use the non-breaking space character entity & nbsp; instead of standard spaces:

    {noformat}&{noformat}nbsp;{noformat}&{noformat}nbsp;Foo{noformat}&{noformat}nbsp;
    

    Another approach would be to apply CSS padding to the label by wrapping it in a spanstyle:

    Foo
    
  • The field label to show the red asterisk to required field (graphic) dynamically

    Hello

    We have a form that uses the value of the element of an application to determine what fields are required. Using the validation of the page, we are able to enforce these mandatory fields.
    The problem is to get the chart of required field asterisk to conditionally display the label of the field.

    We tried the suggestion by Re: how to handle the label of the field to display red asterisk (required)
    It works but displays an asterisk in the text. We need to display the graph for the asterisk.

    To describe assume them have the following:
    APP_1 (point of application)
    P1_A_ASTERISK
    P1_A

    The default value for the P1_A_ASTERISK is a pl/sql function that checks APP_1 and affects P1_A_ASTERISK ' < img src = "" #IMAGE_PREFIX #requiredicon_status2.gif ' alt = 'Required field' / > "If P1_A should be required.


    If P1_A_ASTERISK is defined as hidden we get the html text < img_src... in the P1_A label.

    If P1_A_ASTERISK is defined as the display text, we see the graphic symbol in the P1_A label... it's good. But we also see the point of P1_A_ASTERISK that we do not want.

    Any suggestions on a way to dynamically display the graph of the mandatory field in some field labels?
    Thank you
    NANN

    Hello:

    You can try the following

    Create a copy of the label specified for P1_A model
    Change the section "before the label" of the template as shown below. Essentially, add you an id and set the visibility style attribute to the tag. You can get a graph of the image of your choice.

    
    

    Create a page with a point of process process of "On Load - footer after" with code similar to

    if :p1_asterisk='Show Asterisk Value'  then
       htp.p('
    
      ');
    end if;
    

    CITY

  • The field label text...

    Hello..

    I have a LabelField that i shave of the text, but in the filed I should show ' - '.

    LabelField label = new LabelField ("some text here that should be displayed in the form of (-) '");

    But when I access the labelField which label.getText () I need to get the text that is associated with but not «-»

    is it possible to do...

    Thank you cordially yakoub Pasha...

    I got it..

    I used cookies... it is the right way to store additional information...

  • conditionally display name of the field page apex LABEL in the email of the Apex.

    Hello
    I'm using Apex email process.

    I have a page where I have check conditions. ONLY WHEN the checkbox is enabled in the 'yes', I need to display this field in emails.
    Please notify

    field 1-birthday card order YES NO
    field 2-marriage card order YES NO



    If 1 is checked YES and 2 - is checked that NO, I need to insert only

    The NAME of the field LABEL 1. like...

    * 1 - birthday card order *. How? Please notify.

    Thank you
    KP

    Published by: user8612301 on March 7, 2013 13:47

    You can query the integrated views apex

    select LABEL from apex_application_page_items
    where application_id =110
    and page_id = 18
    //OR
    where ITEM_NAME = 'PX_ITEM_NAME'
    
  • field label and text field editing in vertical field Manager

    Hi, am new to the blackberry development. Developing an application in which I placed the field label and modify the field in the Manger of two vertical field and place them in a horizontal field Manager, but when run the present I don't see the label text field I see am doin BB 4.7, following is my code

    LabelField name = new LabelField ("first name :")
    {
    public void paint (Graphics g)
    {
    Super.Paint (g);
    g.setColor (Color.BLACK);
    Do police = this.getFont (.derive(Font.DROP_SHADOW_RIGHT_EFFECT |)) Font.ENGRAVED_EFFECT, h);
    this.setFont (do);
    }
    };
     
    FirstName = new EditField ("Name", "", 25, EditField.FILTER_DEFAULT |) FIELD_RIGHT) {}
    {} public void paint (Graphics g)
    getManager () .invalidate ();
    Do police = this.getFont () .derive (Font.DROP_SHADOW_RIGHT_EFFECT |) Font.ENGRAVED_EFFECT, h);
    this.setFont (do);
    g.drawRect (6, 0, (int) (Display.getWidth()/1.8), getHeight());
    Super.Paint (g);
    }
    };
    HorizontalFieldManager hrMgr = new HorizontalFieldManager();
    final VerticalFieldManager vfMgr2 = new VerticalFieldManager();
    VerticalFieldManager vfMgr1 = new VerticalFieldManager()
    {
    protected void sublayout (int width, int height)
    {
    int w = (int) (Display.getWidth () - vfMgr2.getPreferredWidth () - 20);
    Field field;
    int fieldCount;
    int x = 0;
    int y = 0;

    fieldCount = getFieldCount();
    int d = (int) ((Display.getWidth()/4.5));
    for (int i = 0; i)< fieldcount;="">
    {
    field = getField (i);
    setPositionChild (field, x, y);
    layoutChild (field, w, height);
    y += field.getContentHeight ();
    }
    setExtent (d, a);
    }
    };
    vfMgr1.add (Name);
    vfMgr2.add (FirstName);
    hrMgr.add (vfMgr1);
    hrMgr.add (vfMgr2);
    Add (hrMgr);

    The same a s job well if put a choice field of object instead of text edit field is I see the field and choice of subject field in a single line, but is not in the case of text editing field, please help me on this point, Thanhs beforehand.

    Thanks for your valuable reply Mr.simon,

    But I have reached my goal by adjusting the width of vertical field nursery and got a solution... These are the changes I made in my sublayout...

    protected void sublayout (int width, int height)
    {
                    int w = (int) (Display.getWidth()/1.3);
    Field field;
    int fieldCount;
    int x = 10;
    int y = 0;

    fieldCount = getFieldCount();
                  int d = (int) ((Display.getWidth () / 3));
    for (int i = 0; i)< fieldcount;="">
    {
    field = getField (i);
    setPositionChild (field, x, y);
    layoutChild (field, w, height);
    y += field.getContentHeight ();
    }
    setExtent (d, a);
    }
    };

  • Try to remove the field from the presence of MOM BP but has failed to deploy

    I'm trying to re - customize the Minutes of meeting BP to meet a client procedure but failed when I deleted the participating field & gives me the following error when checking before deploying:

    < Participating > field is used as the e-mail item, but it is not in the top form < VF 01 >.

    What does this mean?

    BR

    Mohamed Hussein

    Help, locate the item you email:

    To select the fields for a notification by e-mail

    1. Open the display form that contains the fields you want to include in the email notification.
    2. On the view menu, choose elements of Notification Email. uDesigner opens a window of data items in the Notification Email.
    3. Use the information in the following table to complete this window.

    TO:

    Follow these steps:

    Add fields in the display screen to email

    1. click on add to open the add data items.

    2. click on the arrow next to the field label of the item, and then choose the field you want to include in the notification email.

    Note: Do not choose which fields are images or images; they will not appear on the email.

    3. click on OK.

    4. Repeat steps 1 to 3 to add more fields, if necessary.

    Remove fields you don't want to include in the email

    1. turn highlight the data item, then click on remove.

    2. Repeat this step to remove other fields, if necessary.

    3. click on OK.

    Put fields in a different order for e-mail

    1. turn highlight the data item, and then click the move up or move down.

    2. Repeat this step until you organize the fields in the order you wish to e-mail.

    3. click on OK.

  • 11 GR 2 IOM show dynamically executing custom field label

    First of all, I understand how simply (statically) to change a field in OIM 11 g 2 label. This is a great step forward and I am amazed at how simple and intuitive, it is.

    I look at it is possible, when running, to show the labels of different field to the same field for different users based on the value of another field in the user profile. For example, if the user is "ABC" then I would I want the field label of connection of the user to be "User login", but for the 'DEF' organization that the user login field label to be "User ID". I can't glean the developer's guide how to be treated this case, but I guess if I had a better understanding of EL expressions I could see how it's possible. Can someone tell me if this is possible using EL Expressions, if I have to use "managed beans" to achieve? Is there another approach that would be better, or is - this all simply not possible? Any comment you have is appreciated.

    Thank you
    Ryan

    Yes, this should be achievable using an EL on the label, for example #{(oimcontext.currentUser['Organization nom '] eq «ABC»)?} {'User login': 'User ID'}
    For more information on how to write ELs, see http://docs.oracle.com/cd/E27559_01/dev.1112/e27150/uicust.htm#BABHBFGH

    For conditions that are more complex and require Java code, you can create a managed bean as described in http://docs.oracle.com/cd/E27559_01/dev.1112/e27150/uicust.htm#BABFFACA.

  • How to remove the focus from the field of the custom label

    Hello

    I have a question on the subject to focus on fields. I did a registration form and added a label + image and text box on a vertical field Manager. but when I scroll through image and text box get the focus and disappear from my label.
    I took the custom label field and the custom text box.
    Help, please...

    protected void drawFocus(Graphics graphics, boolean on){paint(graphics);}
    
  • Label, change the field and the button on the problem of a line

    Hi all

    I was pulling my hair out on this and could really do with some tips. I'm putting a label, a text field and a button of bitmapfield on the same line, but for the life of me I can't work that way round. If I put the front button to the text box field, it works.

            // TEST 3 CONTROLS ON A ROW
    
            final Bitmap imgCalc = Bitmap.getBitmapResource("bgCalc.png");
    
            LabelField lb = new LabelField("0.00");
            EditField ef = new EditField();
            BitmapField  bf = new BitmapField(imgCalc, BitmapField.FOCUSABLE){
                protected void paint(Graphics g) {
                    // Draw text on button image
                    super.paint(g);
                    g.setColor(Color.WHITE);
                    int x = (40 - Font.getDefault().getAdvance("Go"))/2;
                    int y = (imgCalc.getHeight() - Font.getDefault().getHeight())/2;
                    g.drawText("Go", x, y);
                }
    
                public int getPreferredWidth(){
                    return 40;
                }
            };
    
            HorizontalFieldManager row0 = new HorizontalFieldManager();
    
            row0.add(lb);
            row0.add(ef);
            row0.add(bf);
    

    Excuse the code, but it's test code to make it work. As mentioned above, if I add that Label, Edit, Bitmap controls it only shows the label field and edit. If I swap the text field and the field bitmap around so that the text field is the last one, it works.

    What I am doing wrong?

    Thanks for looking

    Paul

    EditField always takes all of the width available to it.

    You must override its layout (width, height) and pass below the width values to leave space for the BitmapField. Something like

    protected void layout(int width, int height)
        {
            super.layout(width * 60 / 100, height);
            // sets width of this field to 60% of the total available width
        }
    

    would do.

  • Listeners of change of the field on the label

    Hello

    I get a list of objects from json url and display as a list by adding a label field and a separator. Now I want each clickable label so that each label makes a redirect to a separate url. By clicking on the label a separate screen should open with the corresponding url json data. So, can anyone tell me how to get there. I wil be really grateful if I get sample code showing how do... An example of code here that I did...

    public VerticalFieldManager showShoppingList(){
            try {
                jsArrShpList=new JSONArray(strShopping);
                totalList= jsArrShpList.length();
                for(int i=0;i			 
    LabelField shops  = new LabelField(shoppingList);
    shops.setFieldChangeListener(this);
    

    What should you index? The index of the field in the vfmShopList?

    Because you must implement fieldChanged in your class for the FieldChangeListener interface, you will always have a reference to the field when it is called.

    You can check if the field is not type labelField and then cast and check the text and do any action on this basis.

    In addition, could keep track of all LabelFields secondary data structure as has been pointed out by Simon.  This can be useful if you also another LabelFields on the screen so that you do not act on a LabelField which should not have any action associated with it.

  • How can we add a text field on the stage, but without the text label?

    How can we add a text field on stage, but without the left text label by default?  I want just the field.

    I thought about it.  Go to the page layout palette and change the options of caption for the text box.

  • Modify the ADF search form fields labels

    Data control , I drag and drop a few criteria appointed as Panel request ADF with Table. How to change the labels of fields in the search form. The search form shows the same label in the Object View which is not easy to use. for example, the table in Employee. Instead of (Fname) I need to have on the label (name). Notice, I could change the names of fields in the Table , but not in the search form . I use Jdeveloper 11.1.2.3

    To change the component af:query labels, you must change the Text property of the label for the object in view (tab tips UI) attributes

    Dario

  • Easy way to change the label of the field for all user interfaces?

    How a client would change a label field for all user interfaces that use this field or attribute, which is not really a translation?

    What I have found seems to be that we would need to edit Resource Bundles and it will be much easier in version 8:

    1. the information on Resource Bundles in https://blogs.oracle.com/fadevrel/entry/translating_your_customizations section has this key passage:

    It is a standard open sector (OASIS) XML file with the extension .xliff format and store translated values for strings used by the ADF running. The general process is that these values are exported from the MDS, modified manually and then imported into the new repository. This must be done by an administrator, either via Enterprise Manager or WLST orders according to the screenshot below. It is detailed on the merger application Extensibility Guide.

    2. this blog announcement also says that it will be easier in version 8:

    Currently planned for version 8 is what we call the UI (UI) text editor. This tool will allow the mounting of all the text on the pages and merge request forms. This will provide a search based on an expression or a Word, say 'Worker' and will allow it to be adjusted, tell 'Employee', which then updates all the resource bundles that contain.

    3. I found video, How to customize field labels , but it seems that it is a label of the user interface at the same time...

    WIlliam, Yes, and we have a documentation and/or videos on this feature when R8 is available.

  • Can I customize the size of the field on a field of choice.  I want to get 10 everywhere and even with the label 1, 2, 3, etc.

    Can I customize the size of the field on the unique choice fields.  I want to get 10 everywhere and even with the label being small, i.e. 1, 2, 3, etc. I can't get to fit on a single line.

    Hi restorechiropractic,

    You can resize a single choice form field by dragging the right side of the form field item. However, even by doing this I was able to get eight choices by line. I don't think that there is no way to work around the limitation of the size of the form.

    Please let us know if you have any additional questions.

    Best,

    Sara

Maybe you are looking for