Label - field - Board labels

Hi all

JDev 11.1.1.5.0 & 11.1.1.6.0

We want to build a set in page where we once again a label, the field, and then on a label.
Ex: Max duration < field > years
Must see this in formatting, where we have different areas. Some of them have this second label, others not.
The farm I can uses a panellabelandmessage tag to include the second label.
          <af:panelLabelAndMessage label="Max Duration" id="plam1" showRequired="true">
            <af:inputText id="it5" required="true" showRequired="false"/>
            <f:facet name="end">
              <af:outputLabel value="years" id="ol1"/>
            </f:facet>
          </af:panelLabelAndMessage>
        </af:panelFormLayout>
The problem arises with the required fields. We can define the attribute showRequired of the panellabelandmessage to true, and that of the inputText to false.
But whenever the required of the inputText property is set to true, the required icon is always shown, even if the showRequired is set to false.
This makes the required icon is displayed twice.
How can hide us the required icon of the inputText field?

What are the possible solutions for this situation?

Thank you in advance.

Filip Huysmans.

Filip,

the following custom skin entry removes the icon required all input text labels so that they are defined on the component panelLabelMessage only

AF | inputText::label. AFRequiredIconStyle {display: none}

If you need to have more control, you can add a property styleClass as shown below

 
            
            
              
            
          

In this case, the following skin only removes this

.noRequiredIcon af | inputText::label. AFRequiredIconStyle {display: none}

If you need more dynamic event, use EL to set the styleClass value.

Frank

PS. : Is the question you may ask: why should I add the af | inputText::label to the skin if the style class determines the instance? The advantage you get from this is that it is the longets match, which means that if there are other components (no text input) that have similar requirements, you can manage them individually

Tags: Java

Similar Questions

  • How many fields have horizontally with a label at the beginning of each line

    jdev12c

    I'm trying to implement search criteria screen myself.

    When I select a lookup field in a drop-down list, this field is added to the screen. It has a label, a text field and a selectOneChoice of the operator (with value of begin, end, especially, between the two, etc.).

    When to choose another field of research in the list, a new line is added to the screen.

    I want all tags must be aligned to the right, text boxes are aligned and the selectOneChoice is just after the text box.

    I tried to generate PanelFormLayout for each line, with lines of property = 1 and argument maxcolumns = 3.

    The problem I have with this approach is: labels for each line don't align. Also, I have data recovery problem within each PanelFormLayout. The mother of PanelFormLayouts, he sees several PanelFormLayout. But the returned value of the first PanelFormLayout.

    Please advice what kind of layout that I use. Thank you.

    You can do this using af: panelLabelAndMessage,.

    just surround all your filed with the horizontal band layout and simple true set for all fields, then surround group layout with an element of label and message board

    Source XMl-

    
    
                       
    
                            
    
                            
    
                           
    
                                                        
    
                      
    
                    
    

    It will look like this - https://drive.google.com/file/d/0B0Usl2n1Wz8vUEtPdnVtUC1mcjA/edit?usp=sharing

    See - http://jdevadf.oracle.com/adf-richclient-demo/docs/tagdoc/af_panelLabelAndMessage.html

    -Ashish

  • Possibility to make labels, rather than fields, flashing?

    Is it possible to do just a blink of field labels?  How can I get the properties to do?  My boss is looking for something more subtle that flashing fields.

    I can only think that it can be done programically by changing color

  • Publish in the title bar and scroll field label

    Hi all

    I have a title bar and just below that I have a label field, I am facing a problem like as and as I scroll the lable field 'timezoneTitle' is not visible. His only visible when I scroll to the top. I want to keep it fixed even if the user scrolss up and down, how to handle this?

    LabelField title = new LabelField ("Welcome", LabelField.FIELD_RIGHT);

    HFM. Add (title);

    zone title
    LabelField timezoneTitle = new LabelField ("", LabelField.ELLIPSIS)
    | LabelField.USE_ALL_WIDTH | LabelField.FIELD_HCENTER) {}
    {} public void paint (Graphics graphics)
    graphics.setColor (Color.WHITE);
    graphics.setBackgroundColor (Color.BLUE);
    Graphics.Clear;
    Super.Paint (Graphics);
    }
    };

    setTitle (vm);

    Add (timezoneTitle);

    I'm not sure that I understand the question, or that the code you provided is complete, but if my interpretation is correct, then try this

    VFM VertticalFieldManager = new VerticalFieldManager();

    LabelField title = new LabelField ("Welcome", LabelField.FIELD_RIGHT);

    VFM. Add (title);

    zone title
    LabelField timezoneTitle = new LabelField ("", LabelField.ELLIPSIS)
    | LabelField.USE_ALL_WIDTH | LabelField.FIELD_HCENTER) {}
    {} public void paint (Graphics graphics)
    graphics.setColor (Color.WHITE);
    graphics.setBackgroundColor (Color.BLUE);
    Graphics.Clear;
    Super.Paint (Graphics);
    }
    };

    VFM. Add (timeZoneTitle)

    setTitle (vm);

    If this does not solve you problem, and in fact even if it is the case, I recommend that consult you this:

    http://supportforums.BlackBerry.com/T5/Java-development/MainScreen-explained/Ta-p/606644

  • Label field do not align right

    Hello

    The label field is not aligining to the right. Here is my code

    Container {
                            id:database_search_top_container
                            leftPadding: 20.0
                            rightPadding: 20.0
                            preferredHeight: 110.0
                            preferredWidth: 720//displayInfo.pixelSize.width
                            background: recent_container_bg.imagePaint
                            verticalAlignment: VerticalAlignment.Fill
                            horizontalAlignment: HorizontalAlignment.Fill
    
                            layout: StackLayout {
                                orientation : LayoutOrientation.LeftToRight
                            }
                            Label {
                                verticalAlignment: VerticalAlignment.Center
                                horizontalAlignment: HorizontalAlignment.Right
                                id:recent_label_name
                                objectName:"recent_label_name"
                                preferredWidth: 720//displayInfo.pixelSize.width
                                preferredHeight: 110.0
                                text:"Dummy Data"
                                textStyle.color: Color.White
                                textStyle.fontSize: FontSize.Large
                            }
    
                        }
    

    There is a bug in the API. But you can align it to the right this way.

    Container {
        id:database_search_top_container
        leftPadding: 20.0
        rightPadding: 20.0
        preferredHeight: 110.0
        preferredWidth: 720//displayInfo.pixelSize.width
        background: recent_container_bg.imagePaint
        verticalAlignment: VerticalAlignment.Fill
        horizontalAlignment: HorizontalAlignment.Fill
    
        layout: StackLayout {
            orientation : LayoutOrientation.LeftToRight
        }
        Label {
            verticalAlignment: VerticalAlignment.Center
            horizontalAlignment: HorizontalAlignment.Right
            id:recent_label_name
            objectName:"recent_label_name"
            preferredWidth: 720//displayInfo.pixelSize.width
            preferredHeight: 110.0
            text:"Dummy Data"
            textStyle.color: Color.White
            textStyle.fontSize: FontSize.Large
    
            layoutProperties: StackLayoutProperties {
                spaceQuota: 1.0
            }
            textStyle.textAlign: TextAlign.Right
        }
    }
    
  • Highlight a text of label field

    Hello

    I have a label field that is added inside the VerticalFieldManager I have set the length and height of the label field in which area I want to display the text.

    now, I want my text to scroll inside the labelfield.

    Here is my code please help...

    VerticalFieldManager vf = new VerticalFieldManager (Manager.VERTICAL_SCROLL);

    LabelField history = new LabelField (story_data.elementAt (0) m:System.NET.SocketAddress.ToString (), FIELD_HCENTER |) FOCUSABLE) {}
    {} public void paint (graphics net.rim.device.api.ui.Graphics)
    graphics.setColor (Color.BLACK);
    graphics.setFont (net.rim.device.api.ui.Font.getDefault () .derive (net.rim.device.api.ui.Font.BOLD, 10));
    Super.Paint (Graphics);
    }
    Protected Sub layout (int width, int height) {}
    Super.Layout (width, height);
    this.setExtent ((MyApp.width) - 30, 300);
    }
    };
    story.setBackground (BackgroundFactory.createSolidBackground (Color.WHITE));
    story.setMargin (10, 15, 15, 15);
    story.setPadding (5, 5, 5, 5);
    story.setFont (Resize.getFirstFont ());
    VF. Add (Story);
    VerticalFieldManager temp = new VerticalFieldManager();
    Temp.Add (VF);
    Add (temp);

    Thanx

    Thanks peter... my problem is solved... Here's my code for update... VerticalFieldManager vf = VerticalFieldManager(Manager.VERTICAL_SCROLL | nouveau Manager.VERTICAL_SCROLLBAR |) Manager.VERTICAL_SCROLL_MASK | Manager.VERTICAL_SCROLLBAR_MASK) {' protected void sublayout (int width, int height) {super.sublayout (width, height); this.setExtent ((MyApp.width)-20, (MyApp.height)-(MyApp.height)/4) ;}};}} LabelField history = new LabelField (story_data.elementAt (0) m:System.NET.SocketAddress.ToString (), FIELD_HCENTER) {public void paint (graphics net.rim.device.api.ui.Graphics) {graphics.setColor (Color.BLACK); super.paint (graphics) ;}};} story.setBackground (BackgroundFactory.createSolidBackground (Color.WHITE)); story.setMargin (10, 15, 15, 15); story.setPadding (5, 5, 5, 5); story.setFont (Resize.getSecondFont ()); VF. Add (Story); Add (VF);

  • 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.

  • Label field

    Hello

    I need a label field that when clicked should push a new screen. So I wrote a label custo field but am not able to understand how to perform the action.

    I write the code below, please tell me where I'm wrong.

    It's the customlabelField

    / public final class CustomLabelField extends LabelField {}
    public m_cKeyListener KeyListener;
    Private GlideApplication _app.
    String strCheckInURL ="";
    private int horMargin = 8; final int innerMargin = 5; / / Adding dembele January 11 for more details
    private police objBigFont = Font.getDefault () .derive (Font.BOLD, 23); Are subject
    private police objMediumFont = Font.getDefault () .derive (Font.BOLD, 17); Are subject
    private police objSubTitleFont is Font.getDefault (.derive(Font.BOLD,16));.
    private police objSmallFont = Font.getDefault () .derive (Font.BOLD, 13); Are subject
    final int fieldWidth = ((Display.getWidth (-(horMargin*3))) > 1);

    public interface KeyListener {}
    public abstract void PerformAction (CustomLabelField pCustomLabelField);

    }
    Public Sub paintBackground (Graphics g)
    {
    XYRect xyrect = this.getExtent ();
    g.setFont (objSubTitleFont);
    g.setColor (0x0060AAF0);
    g.fillRect (0, 0, xyrect.width + 450, xyrect.height + 450);
    g.setColor (Color.DARKGRAY);
    g.drawLine (0, 0, xyrect.width, 0);
    g.setColor (Color.WHITE);
    g.drawText ("more details", innerMargin, (xyrect.height > 1)-(objSubTitleFont.getHeight () > 1) ');
    g.drawText (' > ', (xyrect.width - objSubTitleFont.getAdvance (">")-innerMargin), (xyrect.height > 1)-(objSubTitleFont.getHeight () > 1));
    }
    Protected Sub layout (int width, int height) {}
    width = fieldWidth;
    Height = objSubTitleFont.GetHeight () + 14;
    Super.Layout (width, height);
    super.setExtent (width, height);
    }

    public void SetKeyListener (KeyListener pKeyListener) {}
    m_cKeyListener = pKeyListener;
    }
    {public boolean trackwheelClick (int status, int time)
    Boolean lRetVal = false;
    If (null! = m_cKeyListener) {}
    TSTC objAirportInfo = new FlightInfo();
    _APP.pushScreen (objAirportInfo);
    m_cKeyListener.PerformAction (this);
    lRetVal = true;
    }
    return lRetVal;
    }
    }

    and this cusomlabel, I add in another page, the code for this is also attached below,

    Please tell me if I am wrong anywhere, I'm new to the blackberry development, for help, it's urgent. Thank you in advance.

    VerticalFieldManager vfmMoreDetails = new VerticalFieldManager();
    CustomLabelField lfAirportInfoMoreDetails = new CustomLabelField();

    HorizontalFieldManager hfmRow2 = new HorizontalFieldManager (Manager.HORIZONTAL_SCROLL);

    hfmRow2.add (lfAirportInfoMoreDetails);

    hfmRow2.setMargin (0,0, 0, 15);

    SF SpacerField = new SpacerField (0.20);

    hfmServices.setMargin ((subTitleFont.getHeight ()) + (bigRowSpace * 3), 0, 0, 0);
    vfmServices.add (hfmServices);
    vfmServices.setMargin (0, 0, 0, 15);
    vLayout.add (vfmServices);
    vLayout.add (sf);
    vLayout.add (hfmRow2); tmp commented
    Add (vLayout);

    My requirement is clicked, the label field, more details, will take you to a new screen flight info.

    Please help me

    Hi, thanks friends, I could implement the listener of the field with the code below, and less when I removed sublayout and changed the layout, he began to work, here are the labour code

    LabelField lfMoreDetails = new LabelField "(more Details", Field.FOCUSABLE)
    {
    protected void paintBackground (Graphics g)
    {
    XYRect xyrect = this.getExtent ();

    g.setColor (0x0060AAF0);
    g.fillRect (0, 0, subTitleFont.getHeight () + 350, subTitleFont.getHeight ());
    g.setColor (0xffffff);
    g.setColor (0xffffff);
    g.setFont (subTitleFont);
    int y = bigRowSpace;
    g.drawText ("more details", 10, y, Graphics.ELLIPSIS, xyrect.width-(10 + 10) ');
    g.drawText (' > ', (xyrect.width - objSubTitleFont.getAdvance (">")-innerMargin), (xyrect.height > 1)-(objSubTitleFont.getHeight () > 1));
    y += (subTitleFont.getHeight ()) + (bigRowSpace * 2);
    }
    protected void layout (int width, int height)
    {
    width = Display.getWidth ()-(10 + 10);
    height = serviceSectionHeight;
    setExtent (width, height);
    }

    protected boolean navigationClick (int final status, time final int) {}
    net.rim.device.api.ui.UiApplication.getUiApplication () .pushScreen (new FlightInfo());

    fieldChangeNotify (0); / / See the difference here.
    Returns true;
    }

    };
    lfMoreDetails.setChangeListener (this);

  • Highlight a label field.

    I have a label field on a screen that can hold a large amount of text which will disappear from the screen, how can I make cela scrollable?

    I tried to put the label in a VerticalFieldManager, but without success.

    Thank you

    First of all, please learn how to use the search box on the top of the screen.  If you are looking for 'LabelField' returned this thread as the first among others:

    LabelField Scrollable

    The thread gives a solution similar to swati srivastava's.  morpheusghost gives a slightly different resulting in almost the same visual appearance.

    However, none of these solutions is perfect.

    If the text in the field is greater than 2 screens (or the field Heights), jumping from the beginning to the end (that's what happens when divert you attention from the NullField first to the last NullField) never allow see her in the middle of your LabelField.  Consider using a TextField for longer texts.  Make it FOCUSABLE and READONLY and add it to a VerticalFieldManager with VERTICAL_SCROLL (and possibly VERTICAL_SCROLLBAR).  TextField and his descendants may have the focus within the field (the cursor).  That's how you let the user scroll.

    Otherwise, you can have no field focusable and manage the movements of navigation, using setVerticalScroll of the VerticalFieldManager containing your LabelField.  But that would require more code and is less intuitive.

  • Different thread field label update

    Hello

    I need to update the label on a buttonfield.  It's pretty simple to do when it is selected.  The problem is this: I want to trigger a web update, which runs on its own thread.  When the update is complete, I need to change the label field once again, this time by the new thread (which makes the update).

    I could be missing something really simple here. Any help would be appreciated.

    In General, you get eventlock of the application when you perform the update of the screen.

    for example:

    Thread t = new Thread (new Runnable()

    {

    public void run()

    {

    updateLabel();

    }

    });

    Private Sub updateLabel()

    {

    {Synchronized (application.getEventLock)}

    mybutton.setText ("new Text");

    }

    }

    Cheers.

  • 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);
    }
    };

  • How can I set the width of the part of the label of an edit field?

    Anyone know how I can configure the width of the part of the label of an edit field?  that is, I want to have my line to edit until a fixed width field labels.

    It is not possible to set the width of the part of the label of an editfield.

    In this case, you can use a LabelField with fixed width (the substitution of layout() method) and an EditField and add then both a HorizontalFieldManager.

    Concerning

    Bika

  • to align the label Center field in horizontalfield Manager

    Hello world

    I have three field label inserting in horizontal field Manager, by default, it is show laft alignment.

    But I need to put all the Center horizontally.

    someone can help me.

    My code is given below

    HorizontalFieldManager curencyPrice = new HorizontalFieldManager (HorizontalFieldManager.FIELD_HCENTER |) Manager.USE_ALL_WIDTH)
    {
    public int getPreferredHeight() {}
    Return ((int) ((30 * screenHeight) / totalHeight));
    }

    public int getPreferredWidth() {}
    Return ((int) ((200 * screenWidth) / totalWidth));
    }

    protected void sublayout (int maxWidth, maxHeight int) {}
    Super.sublayout (getPreferredWidth (),
    getPreferredHeight());
    setExtent (getPreferredWidth (), getPreferredHeight());
    }
    };

    value = new CustomLabelField_Land ("" + ht.get ("currencySymbolLeft") +"", 12389754, 25, 0,)
    // 0);
    curencyPrice.add (value);

    String s = ht.get ('price') m:System.NET.SocketAddress.ToString ();

    Value1 = new CustomLabelField_Land (s, 1521508, 25, LabelField.FIELD_HCENTER, 0);

    curencyPrice.add (value1);
    value11 = new CustomLabelField_Land ("" + ht.get ("currencySymbolRight"), 12389754, 25, 0, 0);

    curencyPrice.add (value11);

    Thanks in advance

    By default, a LabelField will only the space he needs.  And a HFM will also take only the horizontal space he needs.  You can add your HFM to a VerticalFieldManager and ensure that the HFM says FIELD_HCENTER and it focuses, as a value for money defaults across the width.

  • 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.

Maybe you are looking for