Label of the choice of the user of an objectlistfield element control knob

Hello

I'm a beginner and this is my first BB app. I have a problem and I tried to do on my own, done quite a bit of research, but could not find any solution.

The thing is, I have a button on the main screen, was added by clicking this button, I push a popupscreen at the top of the stack that contains an ObjectListField. Now, I want to put the label of the button on the screen as the name of the selected field in the ObjectListField. I have attached my code on which I am experimenting and trying to learn (really enthusiastic about it ), so would appreciate any help in this regard. Thanks a ton

package mypackage;

import net.rim.device.api.ui.Field;
import net.rim.device.api.ui.FieldChangeListener;
import net.rim.device.api.ui.UiApplication;
import net.rim.device.api.ui.container.*;
import net.rim.device.api.ui.component.*;

public final class MyScreen extends MainScreen
{

    ButtonField btn;
    public MyScreen()
    {
        // Set the displayed title of the screen
        super();
        setTitle("MyTitle");

        btn=new ButtonField("Label",ButtonField.CONSUME_CLICK);
        btn.setChangeListener(new FieldChangeListener()
        {
            public void fieldChanged(Field field,int context){

                UiApplication.getUiApplication().pushScreen(new mypopup());

            }
        });

                add(btn);

    }

            /*public void inval(String lbl){

                this.btn.setLabel(lbl);
                this.invalidate();
            } */

}

class mypopup extends PopupScreen implements FieldChangeListener{

    String it;

ObjectListField obj=new ObjectListField(){

        public boolean navigationClick(int status,int time){

            int selectedindex=obj.getSelectedIndex();
             it=(String)obj.get(obj, selectedindex);

            UiApplication.getUiApplication().popScreen(UiApplication.getUiApplication().getActiveScreen());

        MyScreen my=new MyScreen();
             my.btn.setLabel(it);
            my.invalidate();

    UiApplication.getUiApplication().invokeLater(new Runnable()
            {
                public void run(){

                    Dialog.alert(it);

                }
            });

            return true;        

        }
    };

     public mypopup() {

         super(new VerticalFieldManager(VerticalFieldManager.VERTICAL_SCROLL|VerticalFieldManager.VERTICAL_SCROLLBAR), Field.FOCUSABLE);

         String[] type=new String[] {"a","b","c","d"};
            obj.set(type);
            add(obj);

     }

    public void fieldChanged(Field field, int context) {
        // TODO Auto-generated method stub

    }

}

Hi Simon, first of all thanks a ton for the answer.

I learned a lot by reading the documentation and links that you gave me.

But the thing is, I really want to use the class popupscreen instead of the dialog box. So (with assistance), I made small changes in my code, and it seems to work now.

I write changes in my code for other users who might have the same problem...

I created a setlabel method (* not to be confused with setLabel), in the class MyScreen and right where I implement anti-pop mypopup class, I did...

Scr Screen = UiApplication.getUiApplication () .getActiveScreen ();
If (instanceof MyScreen scr) {}
MyScreen my scr = (MyScreen);
My.setLabel (IT);
My.Invalidate ();

Finally, it seems to work now.

See you soon

Tags: BlackBerry Developers

Similar Questions

  • Check if the user has selected box element apex before the loading of the page

    4.2.1

    THM:2

    Hello world

    I have two classic reports with different conditions but even select the columns based on a sql that uses the apex_item.checkbox2 element that allows users to select the lines and run some process. I also have a radio unit that hides and shows these two reports. However, it is possible that the user select a few lines and without doing anything click on the radio button that will present the page and all the lines that earlier he had chosen will be lost. I want that we should be able to pop an alert if there are checkboxes checked and the user tried to hit the button of the radio looks like the APEX_APPLICATION. G_F01. Count is not available at the time the page is submitted. We thought to use a pl/sql to see if APEX_APPLICATION DA. G_F01. Count > 0 then trigger an alert to confirm.

    Any ideas on how to do this?

    Thank you

    ryansun wrote:

    Hi FAC586 - basically, there are two parts of the report, were grouped products consolidated (as master) and the other report has all the products of the child. So based on the option the user selects that he sees who discovers and processes information.

    I tried to create the DA, but he does not seem to fire and I'm sure it would be because I have something wrong.

    No, in this case, there was a typing error in my JS expression above (this is what happens when there is no example in the trial against...)

    Must be:$('td[headers="COL_ALIAS"] input:checked').length > 0

    I have page submit on the evolution of radio, given that other elements of the actual application, don't do with this feature which is filled on the loading of the page.

    It does not work. If the present radio on the presentation changes group cannot be controlled by the dynamic action to confirm that it has already been committed before the confirmation message is displayed. Presentation must be made by further action of real on the DA. By the way other values is possible by using dynamic actions or region to submit elements of Page properties.

    But here it is necessary, if the user has activated all the lines, then changes the selection of the radio, it should show an alert to confirm. In addition, what happens if we have a very select in the box by a header label already. Can I use the same label to identify the COL_ALIAS?

    Do not understand the question.

    Don't know what I'm doing wrong.

    As I noted above, an important part of your problem is that you asking what amounts to a series of questions XY rather than the big picture given by presenting the necessary resources. You have been really good on the creation of examples on apex.oracle.com, but they are all fragments of the righteous, which makes things difficult when you try their synthesis in something that works as a coherent whole. Various bits and pieces that have been revealed in recent weeks, it seems like this could be treated using dynamic measurements without having to send the page until the final choice has been made.

  • Cannot read the labels in the user of LR interface!

    I am a user of LR long tried items during the time of the party. It is almost impossible for me to read the black text on a dark gray background, which is used on most controls. Is it possible to change to a user interface with a bit more contrast? Thank you.

    I use Color Munki to calibrate my screen and my prints match the screen very well. This isn't a problem of monitor and it is not unique to LR. Adobe Digital Editions has the same problem. For example, I can't see the thumb on the vertical scroll bar in Digital Editions.

    The good news is that the text, I can barely see in LR is for items that are disabled. The elements that are activated are readable, so the problem is not serious because I first thought. Thanks for the reply and suggestion.

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

  • Erase the name on the user files after

    I have a laptop with windows 7 installed second hand. After getting it, I immediately deleted this users account in Control Panel our association and created my own but now their name appears before the name of the file and the label of the user such as Maggie/Robert. I have tried everything I can think off except completely wipping summer car.

    They easiest way to solve this problem is to create a new account of a user with administrator privileges.

    You cannot delete the name.

    When you have set up the way you want to and copied the data files you want, you can delete the old user.

    See this.

    http://Windows.Microsoft.com/en-us/Windows7/fix-a-corrupted-user-profile

  • Difficulty the front Dimension of the array, but allow the user to change the size of the array

    Hello

    I know there are a few other posts on table and scroll bars but mine is a little different. I want to have the physical size of the fixed table control and allow the user to change the size of the array as required and a scroll bar if the number of elements exceeds the specified physical dimension. I wouldn't mind if, at the end of the scroll bar, the user sees an uninitialized element.

    Thank you very much

    Hello

    The problem I have with the property Num Row node is it seems to replace the scroll bar. Whenever I try to change the line number, the table automatically resizes its physical size on the front and the scroll bar has no effect.

    However, I solved the problem by taking row completely digital. I just said if the table size is > to a constant value (i.e. 3), add a scroll bar and my front panel dashboard to be a size larger than what the value of this constant is size. Once I begin to add values in sequential order and I get to the fourth value, the scroll bar is added and the scroll bar has a feature where it adds an element of null for you, so if I fill this null element I just increased the size of the table and another null element appears underneath.

    Thanks for the help

  • Problem with the use of disabled form elements

    I have a simple form with a file input element and a "submit" button.
    When I hit submit I want to disable the input file so I call a javascript function on the "onClick event" to do.

    The problem is when the javascript disables the file entry, then subsequently Coldfusion cannot use the value of the input file to download the file that he don't think that there is...

    Does anyone know a simple way around this?
    Merci )

    It was a requirement of the user to disable form elements, even if a file has been downloaded.
    I disabled the Send button by using a hidden field as suggested. That should be enough, because even if a user searches for a file to download, they can not cocoralie the form.
    Thanks for your help...

  • How to present the user programmatically with different input parameters based on the choice of the Group of entry?

    I have an array of items that represent the inputs to an operation.  The user is allowed to choose a random order for entries to assemble in the table.  Each element, however, requires different input associated parameters that are used by the operation to define each choice.  I realize that, for an array of clusters, the individual cluster array element must all have the same format, that is, they must all have the same type and number of the cluster inputs or outputs.

    Ideally, I would like to have a picture of the clusters, where each cluster has a different set of inputs.  Does anyone have ideas for a solution of programming would be to approach or to simulate such a structure?

    Thank you

    Mike H.

    Hello

    I tried soemthing and attached the VI (LV 2010)

    develop something similar to what is in the attached VI and then package clusters for which the user enters the parameters... I prefer the tabs page, more than the cluster "all settings".

  • How to distinguish between Save and throw the choice by the user?

    How in a Java application I distinguish the user on 'Save' or 'RID' choice (on screen closely)? Both super.onSavePrompt () super.onSave () return true for both choices. Any help is appreciated.

    'Save' calls onSave. 'Cancel' doesn't do nothing, just the guest closes. "Unravel" closes the screen without call onSave.

    Implement your own dialog box and take action based on the user's response.

  • I need to create a complex scenario that results represent the user choices

    Here's the scenario:

    The user answers 20 questions that offer every three choices (not a quiz).  Based on collated responses, a 'score' or 'level of advancement' leads to a specific page.

    So, if they answered questions and the "score" indicates they are a beginner on average, a page will load with links to resources for a beginner.

    If they are advanced, an advanced results page will load etc.

    The problem is that there is no right or wrong answer, these are attitudinal and behavioural issues.

    I want to also create five categories with a percent complete when they arrive at the page "score" relevant to their level there are five bars indicating their level of development in each of the five categories, and if they are at beginner level into three categories, intermediate to that and advance to one pictured, but the collective means of 'mark' are a way of "Beginner".

    I have never attempted anything of this complex, would appreciate an overview.

    I don't really agree with rod that questions could not be used at all the. I used MCQ to create sort of a survey measuring more than once. Here is an example of a different use case, but perhaps you will see the link to what you want to achieve:

    Classified the investigation? -Captivate Blog

    With the help of some system of quiz variable to store the results in variables user is another tip.

    Secrets of cpQuizInfoAnswerChoice and... - Captivate blog

    This conditional logic card is in fact the first thing I would say to create. And take into account all possible situations and combinations. This is certainly the first step.

    Remember that Captivate comes with training interactions that might be useful if you decide to create also custom questions: buttons, checkboxes, drop-down list. They could save you time.

    You don't say if you have marked you quiz in different parts that you want to branch to (beginner, intermediate, advanced)?

  • I have a HTML5 form that sends a null (%) if the user does not have a choice. It works fine, but I get an error of W3c on the value of '% '. Is there another way to send a NULL value?

    I have an HTML5 form that allows the user to select 1 of 6 provinces of Costa Rica. If they do not select a Province, I use php code to send a NULL value and the other selections research of the form looking for all Provinces. If they choose a province, we are looking for database records that are found in this province.  Currently I use the value = '%' as the selected value if the user does not have a choice. It works and looks in all provinces, but I get an error of W3c checking on the value = '% '. Y at - it another way to send a NULL value. PS: I have the same problem on the following form which allows you to select the Business category. The page is http://www.yellowpagescr.com

    Here is a copy of the code. The RED line works but gets a W3c issue error of the test page. :

    < form = class "navbar-form Center navigation bar" role = "Search" action = "#searchresults" method = "get" name = "selectterms" id = "selectterms" title = "" >

    < select name = "province" autofocus class = 'copyright' title = "Click to select a Province (optional)" >

    < option value = '%' selected = "selected" > all Provinces < / option >

    < option value = "alajuela" > Alajuela < / option >

    < option value = "cartago" > Cartago < / option >

    < option value = "Guanacaste" selected > Guanacaste < / option >

    < option value = "heredia" > Heredia < / option >

    < option value = "Limon" > Limon < / option >

    < option value = "Puntarenas" > Puntarenas < / option >

    < option value = "San Jose" > San Jose < / option >

    < option value = "Other" > other < / option >

    < / select >

    The correct way.

    Nancy O.

  • Display image based on the value of the variable of the choice by the user

    Hi all, I hope someone can help with what I think is a simple request. Ive only been using Captivate 7 for a few days and still feeling my way around things.

    I installed a question multiple choice quiz that has 4 possible answers (correct 1: incorrect 3.)

    It works fine out of the box, and when a user presses the button send the response box appears showing if the user responded to this correctly or not.

    What I want to do, that is forward a bit, and if the user gets the answer wrong I would a small image of a check mark appears next to the correct answer.

    I have included my image on the stage, he gave an alpha of 0 to hide effectively.

    In interactions in advance, I created a variable called showImage with an initial value of 0

    What I am struggling with now is how to increase the value of the variable to 1 when a user selects a wrong answer and change the alpha of 0 to 100 for show the image illustrating the choice of the correct answer.

    I know that what I have described, is essentially what is happening at the end of the quiz, if a user has access to review their answers but I would like to be able to do as they progress through the questions.

    Thanks a lot for your help

    D

    Hi D,

    What you need to do is rather than make his alpha 0. It completely hide the scene until the user gives the correct answer.

    So, I want you.

    (1) insert a picture

    2) go to image and all properties panel up - untick 'Visible output.

    (3) open properties Quiz, select under Actions failure level 1/2/3

    (4) select 'Last attempt' as 'Show' and the image you you inserted

    This way the image will appear if the user selects an incorrect answer.

    I hope this helps.

    See you soon,.

    Anjaneai

  • Toggle the fields based on the choice of the user

    Hello!

    I need to create a form in which it fields should be enabled based on the user's choice in a previous question (with radio buttons).

    Please, where can I find the info to learn how do?

    Thak you responsible for any idea!

    Here's the Script Editor of screen capture...

    Once the script editor opens, then edit the event click in the menu on the left corner.

    Thank you

    Srini

  • Save the choice by the user in the menu drop-down

    Hey guys

    How is everyone today? I hope you are all okay

    I am facing a problem, I made a menu drop-down with 2 options, each option changes something in the way of the application of notification showing, once the application is closed, it returns by default (no selected value... which makes sense, because I do not know how to record yet)... so is there anyway to save the user's selection in the menu?

    Here is the code

         DropDown {
                id: drop
                enabled: false
                Option {
                    text: "Every 15 minutes"
                    value: 1
                }
    
                Option {
                    text: "Every 30 minutes"
                    value: 2
                }
                onSelectedValueChanged: {
                    if(selectedValue == 1){
                        //because it's milliseconds
                        timer.interval = 900000
                        timer.start();
                    }
                    if(selectedValue == 2){
                        //because it's milliseconds
                        timer.interval = 1800000
                        timer.start();
                    }
                }
            }
    

    Thanks a lot guys

    Hi Alem... from your code snippet:

    if (theOptions[count].value == settings.getUserSelectDrop)
    {
        drop.selectedIndex = count;
    }
    

    The problem I see here is that getUserSelectDrop is a function, not a variable, and so he needs parenthesis after it else Qt will stop execution of JavaScript as soon as he's trying to run it.

    Try this:

    if ( theOptions[count].value == settings.getUserSelectDrop() )
    {
        drop.selectedIndex = count;
    }
    

    The other thing I would say is that getUserSelectDrop() reads the value of the settings file every time through the loop, who has a bit of a drop in performance. I recommend to save the value of a local variable only once before the loop, then use for comparisons instead:

    var userSelectDrop = settings.getUserSelectDrop();
    for(var count = 0; count < theOptions.length; count++)
    {
        if (theOptions[count].value == userSelectDrop)
        {
            drop.selectedIndex = count;
            break;
        }
    }
    

    Note also in this last code that I added a break statement, if the value matches to avoid the loop to test all the values more unneccesarily.

  • change the setting of the user's choice to a query

    I have a CFSELECT on form and the link to a query.

    I want to show the details information when the user select thew.

    The option is on the client side, since the user select the option I need to pass my request for information to fill in on the form details on the same form.

    I tried to use the suite JavaScripts which indicate information about the details, but the browser navigates to the page I want to fill in the details of informaiton on the same form.

    function FillInfo()
    {
    / * Fill details information * /.

    var url = ' ccdDetailsInfo.cfm? MyAccount = "+ document.getElementById('frmEntry').lstNumber.value;
    }

    I tried to use the iFrame, it works and filling in the same form, but all under iFrame disappear as a footer, and all other controls in the table.

    < iframe id = "DetailsFrame" src = "ccdDetailsInfo.cfm" < / iframe >

    I tried to use CFINCLUDE the file, but do not have the setting on the client side.

    The problem is that the query parameter is query server-side.

    I'm looking for a way can pass the data client the server setting to run the query and to fill the MSDS.

    I did some searching for this on Google, but not luck.

    If you can give me a link about passing parameters between customer and CF server would be appreciated.

    Kind regards

    Iccsi,

    jQuery ("#product_id"). val() -is the value of the selected option.

    The value is concatenated to the ' get_detail.cfm? product_id = '.

    When get_detail.cfm is called, it returns a string as a 'result' in jQuery. Then, the result is inserted into the div that is 'product_detail '.

    Go to the jQuery documentation to learn more about ajax(), val() and html(). The doc says very clearly, and there a few examples of how to use them.

Maybe you are looking for