Item Event - BeforeAction - true or false?

Hi,
Is there a basic rule for BeforeAction?
I know you can play with BeforeAction for personal use; but it is there a basic rule like:
et_CLICK: then it is BeforeAction == false
I like to know for following event:
et_CLICK
et_COMBO_SELECT
et_MATRIX_LINK_PRESSED
et_MATRIX_LOAD
et_CHOOSE_FROM_LIST
et_MENU_CLICK
Is there a Pattern for BeforeAction for ALL Item Events?
Thank you,
Rune

Hi Rune,
there's no real rule, because the events are different.
but usual it is before/after displaying or before/after mouseup
EventType | beforeaction = true | beforeaction = false
et_CLICK | before you release the mouse button/Button is pressed | after you release the mousebutton
et_ITEM_PRESSED | before you release the mouse button | after you release the mousebutton
et_COMBO_SELECT | Selection has not changed | Selection has changed
et_MATRIX_LINK_PRESSED | before you release the mouse button/Button is pressed | after you release
et_MATRIX_LOAD | matrix is empty | matrix is loaded
et_MENU_CLICK | Button is pressed/before release on menu item (without submenus)  | after release
et_CHOOSE_FROM_LIST | before the Choose From List form is displayed | displayed
any other questions ?
greetings to montreal
David

Similar Messages

  • How to hide text field item based on true or false cases in oracle apex

    Hi,
    I have a set of text Field items in oracle apex:
    Order Number
    Revision Number
    When we open the report, revision should be hidden.
    Only when the user enters unique order number (non-duplicate order numbers), revision number should be visible.
    If he enters duplicate order number, revision number should be hidden.
    Please help.

    Hi 2932464,
    2932464 wrote:
    Hi,
    I have a set of text Field items in oracle apex:
    Order Number
    Revision Number
    When we open the report, revision should be hidden.
    Only when the user enters unique order number (non-duplicate order numbers), revision number should be visible.
    If he enters duplicate order number, revision number should be hidden.
    Please help.
    Giving you example how to achieve this.
    Step 1. Create three Page Items
        1) P1_ORDER_NO - Text Field
        2) P1_REVISION_NO - Text Field
        3) P1_ENABLE_DISABLE_REVNO  - Hidden,Value Protected - No
    2. Create 3 Dynamic Actions
    1) Disable revision number on page load
        Event - Page Load
        Action - Disable
        Fire When Event Result Is  - True
        Selection Type - Item
        Item - P1_REVISION_NO
      2) Check duplicate order number
        Event - Change
        Selection Type - Item(s)
        Item(s) - P1_ORDER_NO
        Condition - is not null
        Action - Execute PL/SQL Code
        Generate opposite false action - Unchecked
        Fire When Event Result Is  - True
        Fire on page load - Unchecked
        Stop Execution On Error - Checked
        Wait for Result - Checked
        PL/SQL Code -
    declare
    l_count number;
    begin
      select count(*) into l_count
        from emp
       where empno = :P1_ORDER_NO;
    if l_count > 0 then
      :P1_ENABLE_DISABLE_REVNO := 1;
    else
      :P1_ENABLE_DISABLE_REVNO := 0;
    end if;
    end;
    Page Items to Submit = P1_ORDER_NO
    Page Items to Return  = P1_ENABLE_DISABLE_REVNO
    3 ) Enable and Disable Revision Number
        Event - Change
        Selection Type - Item(s)
        Item(s) - P1_ENABLE_DISABLE_REVNO
       condition - greater than or equal to
       value  - 1
       Action - Disable
       Fire on Page Laod - Unchecked
       Generate opposite false action - checked
       Selection Type = Item(s)
       Item(s) - P1_REVISION_NO
    Hope this helps you,
    Regards,
    Jitendra
    DER_NO

  • ItemPressed Event ActionSuccess is always false when in Add Mode

    Hi experts,
    i have a question regarding the ActionSuccess property in the ItemPressed Event.
    When working with a UserForm and an Ok Button (ID = 1) then the ActionSuccess never gets true when pressing the Button when the UserForm is in Add-Mode.
    Is this normal behaviour or a bug?
    Thank you for your help
    Matthias

    Hi Edy,
    yes, the form was in add mode.
    I'm in the ItemPressed Event, BeforeAction=true.
    There the addon does it's work and after that I set the FormMode to OK.
    This closes the form!
    Why I'm in BeforeAction=true? Because i have to know if the form is in add mode or in update mode, because I do different things regarding to the form mode.
    @Eric:
    That's halfway true. B1 sets the FormMode to OK when the form was in update mode, but not, when the form was in the add mode.
    Thank you
    Matthias

  • ItemPressed Event ActionSuccess=True is not firing

    Hi,
       I have written code in one of my addons to Capture the ActionSuccess=True part of the ItemPressed event of the "Add" button on the Delivery Note window. This event works perfectly fine when I launch the window from the "Delivery" menu item under Sales A/R.
    However, I cannot this event does not fire when the Delivery note is launched from the "Pick and PAck manager" under the Inventory menu.
    If pVal.ItemUID = "1" And pVal.ActionSuccess = True And pVal.BeforeAction = False Then
    ' DO some ACTION
    End if
    I would appreciate it if you could provide some ideas on whether this a know SAP issue or provide some ideas on how I can fix this issue.
    Thanks,
    Gopal

    The FormDataEvent solved my problem in both cases since I only was interested in doing an action after the delivery was updated/added.
    Se VB6-code below to implement this event :
    (Events filters added when the addon starts.. :
        Set oFilter = oFilters.Add(et_FORM_DATA_ADD)
        oFilter.Add 140 'Delivery
        Set oFilter = oFilters.Add(et_FORM_DATA_UPDATE)
        oFilter.Add 140 'Delivery
    Private Sub m_conApp_FormDataEvent(ByRef BusinessObjectInfo As SAPbouiCOM.BusinessObjectInfo, ByRef BubbleEvent As Boolean)
    On Error GoTo ERROR_HANDLER
        If (BusinessObjectInfo.BeforeAction = True) Then 'Before Event
        'Do something
        Else 'After event
            Dim Form As SAPbouiCOM.Form
            Set Form = m_conApp.Forms.Item(BusinessObjectInfo.FormUID)
            Dim bisObj As SAPbouiCOM.BusinessObject
            Set bisObj = Form.BusinessObject
            Dim uid As String
            uid = bisObj.Key
            If (BusinessObjectInfo.Type = "15" And (BusinessObjectInfo.EventType = et_FORM_DATA_ADD Or BusinessObjectInfo.EventType = et_FORM_DATA_UPDATE)) Then
               If uid <> "" Then
                Select Case BusinessObjectInfo.Type
                Case 15 ' Delivery document
                    Dim strBpCode As String
                    Dim strDocNum As String
                    Dim strDocEntry As String
                    strDocNum = Trim(Form.DataSources.DBDataSources.Item("ODLN").GetValue("DocNum", 0))
                    strBpCode = Trim(Form.DataSources.DBDataSources.Item("ODLN").GetValue("CardCode", 0))
                    strDocEntry = Trim(Form.DataSources.DBDataSources.Item("ODLN").GetValue("DocEntry", 0))
                    Debug.Print strDocNum + " " + strDocEntry + " " + strBpCode
                    Select Case BusinessObjectInfo.EventType
                        Case et_FORM_DATA_UPDATE
                        'DO SOMETHING AFTER DELIVERY-UPDATE
                    Case et_FORM_DATA_ADD
                        'DO SOMETHING AFTER ADDING DELIVERY
                    End Select
                End Select
               End If
            End If
        End If
    Exit Sub
    ERROR_HANDLER:
        Debug.Print CStr(Err.Number) + " " + CStr(Err.Description)
    End Sub

  • Formatted Search and Item Events

    Hi,
      I am having a huge problem with using Formatted Search and Add-Ons.
    On the Sales Order Form I have a Formatted search Setup on the Customer Reference Number, it is set to Auto-Refresh when the CardCode changes.  This is the only Formatted search on this form and it works fine.
    However, when I run my Add-On, and enter an Item Code it takes about 30 seconds to display the Item Description. In tracing my Add-On it appears to call the Item Event et_GOT_FOCUS on the Item Code Column I just entered over 50 times.  I don't use other events, but for testing I did turn on all events and the only other event it occured with was et_LOST_FOCUS.
    If I turn off my Add-On or turn off Auto Refresh on the Formatted search everything runs as it should.
    I figure the Auto Refresh of the Formatted search has something to do with this, but I need to have this turned on.  Another thing is that it only seems to call this event when Before Action = false, It does not seem to be called on Before Action = True. 
    Can I disable the Formatted search temporarily from within my add-on or is there something else I need to do to keep this from happening.
    Thanks for Any Help
    Paul

    Hi Alfredo,
      Thanks for the suggestion, that sounds like it might be what I am looking for. But I am confused on trying to visualize how this would work. Do I need to duplicate the entire logic that Business One already does or are there some functions in the DI/UI that I can call that does the functions.  Since I am doing this from a System(Sales Order) not User Defined Form, does that change anything.  I did see the FormattedSearches Object to add a Formatted Search through the DI, but that seems like it will just create the Object and not help me execute it from my Add On.
    Is there some code snipits you could provide or get me going in the right direction on how to implement the formatted searches from within my Add-On. 
    Thanks Again,
    Paul

  • AddOn Item Event Problem

    Hi @all,
    I have created an AddOn that adds an additional menu and loads a new form from XML.
    The form has two buttons for different functionalities. During the development the AddOn works without problems and all events are captured correctly.
    Now, I created the AddOn setup with the Simple AddOnInstaller Wizard form the B1DE and installed it as a new AddOn <b>(System: SBO 2005 SP01 PL11)</b>.
    The AddOn starts correctly, creates the menu and opens the form from XML but when I press one of the buttons nothing happens.
    I used the following code to capture the item event:
    If pVal.ItemUID = "btnSelect" And _
                (pVal.EventType = SAPbouiCOM.BoEventTypes.et_ITEM_PRESSED) And _
                (pVal.BeforeAction = True) Then
              End If
    Perhaps someone can help me with that problem??

    I profiled my addon wiht the B1 .NET Profiler and I receive the following exceptions when I click on a button in the new form:
    System.IO.FileNotFoundException
    System.IO.FileNotFoundException
    System.Reflection.TargetInvocationException
    Unfortunately I don't know which file is meant because all needed files (XML, DLL) exist in the addon directory.

  • Item event handler executed twice

    SAP BO 2004A, C#, UI+DI
    Hi,
    inside an item event handler, a piece of code stores some data in database using RecordSet.Query( "INSERT INTO ..." )
    Running the application, the insert statement is executed twice, what I don't expect.
    If I add a messagebox after the Query()-statement, the code is executed only once.
    Also if I set a breakpoint in debugger, the code is executed only for one time.
    I checked allways the following things:
    1) itemEvent.beforeAction == true
    2) the SAPbouiCOM.Application object is instanciated only for one time.
    Any ideas? Thank you!
    Peter

    Are you filtering?
    It's imperitive that you filter your events. This way your add-on will only receive the events you are interested in...
    This will also allow the SBO -> add-on communication to be more efficient and faster...

  • TRUE or FALSE if cell contains number value

    I'm looking for the equivalent of the NUMBERVALUE function in Excel.
    My equation in excel is:
    =IF(AND(NUMBERVALUE($I8),NOT(NUMBERVALUE($C8)),NOT(NUMBERVALUE($D8)),NOT(NUMBERV ALUE($E8)),NOT(NUMBERVALUE($F8)),NOT(NUMBERVALUE($G8))),"ERROR","")
    Reworking it to use ISBLANK, or a combination of EVEN and ODD doesn't work because it interprets blank cells as even (blank = 0) and spaces as not being blank (makes sense as it does have a length the the string instead of it just being length=0).
    So I want to find a function that will tell me whether or not there is actual numerical data (integer between 0-1000) in a cell.

    Tan-Tan wrote:
    I'm now using checkboxes in a True or False 10-item test. I once used buttons, but I gave up and went to checkboxes. I managed to display them using this:I'm confused. So does your code use JRadioButtons (like your code says), or JCheckBoxes (like this sentence says)?
    I intentionally just have 2 groups of radio button displayed to test if I could tally the right answer. No luck.How did you attempt to tally the right answer? How do you have the right answers stored? How were you getting the status of each JRadioButton?
    So how do I tally the right answer upon clicking 'submit'. I know you have to have a new frame for that, but it's about tallying. Like the right answer for number 1 is false, for number 2 is true. If you click Submit, I should be able to show "You got 1 correct answer".Worry about how you display the tally later. For now just use a System.out.println. I'd use a for loop to get the status of each JRadioButton or JCheckBox, and check that against an array of correct answers.

  • True or False - re $99 Triple Play

    Simple question, but I have gotten conflicting answers from VZ reps:  For the current "triple play" promotion that includes "$150 Cash Back" (and is being aggresively promoted in my neighborhood, where virtually everyone already has Verizon phone service only), is it true or false that a current Verizon phone-only customer (not Fios, just copper POTS) is ineligible for the full $150 but will get instead a "pro-rated" $100 cash back?
    I cannot find this referenced in *any* of the promotional materials, even in the fine print.  Is it true, and if so, why is it not documented anywhere?
    Thanks,
    Jerry

    This is what I see for the current offer and is in the fine print at the bottom. If you are a copper subscriber and enroll for all three
     services you must commit to the terms of the contract.
    This it what it shows in my area. It may depend on your area. If you do not have FIOS or never had it it should apply to you. Perhaps one of the good Verizon people here will confirm this.
    http://www22.verizon.com/residential/bundles/veriz​onbundles/
     SPECIAL OFFER:Order online and get $125 Back for Double Play and $175 Back for Triple Play!
    Plus, order online and take $5 off the monthly rate for the first year. HURRY! Offer ends soon.
    ** $125 and $175 provided via prepaid bank card. Card can be used where prepaid bank cards are accepted. To obtain cash from your card, visit a participating bank and present your card and ID. Must be enrolled in service for 31 days to receive card which will be sent within 60 days of in-service date. Must reimburse total value of card if service is canceled within 6 months. Prepaid bank card delivery may be delayed or withheld in the event of suspected fraud. Valid 2/22/09 through 4/18/09. Must install by 6/18/09.
    Sorry but FIOS bundle does show this.
     SPECIAL OFFER:ACT NOW AND GET $150 Back. Plus, order online and take $5 off the monthly rate for the first year.
    HURRY! Offer ends soon.
    * $150 provided via prepaid bank card. Card can be used where prepaid bank cards are accepted. To obtain cash from your card, visit a participating bank and present your card and ID. Must be enrolled in service for 31 days to receive card which will be sent within 60 days of in-service date. $179 early termination fee applies. Prepaid bank card delivery may be delayed or withheld in the event of suspected fraud. Price Guarantee applies to base monthly rate only and is void if changes are made to the service plan. Valid 2/22/09 through 4/18/09. Must install by 6/18/09. 
    Message Edited by prisaz on 04-10-2009 08:09 AM
    Message Edited by prisaz on 04-10-2009 08:09 AM

  • Selectedcolor, true to the text true or false in the false print text

    Selectedcolor, true to the text true or false is false text into print.
    colorPicker component in, I select Export to a selected color, the color value myMC texte into summer, but accuracy can not control.
    If you'll be glad to help in this regard.
    yours truly
    Below is the AS3 code
    var myColorPicker:ColorPicker = new ColorPicker();
    myColorPicker.editable = false;
    myColorPicker.visible = false;
    myMC.visible= false;
    myColorPicker.addEventListener(MouseEvent.CLICK, clickHandler);
    myColorPicker.addEventListener(ColorPickerEvent.CHANGE, changeHandler);
    myColorPicker.move(20, 20);
    addChild(myColorPicker);
    function clickHandler(event:MouseEvent):void {
    event.currentTarget.open();
    var colorTransform:ColorTransform = myMC.transform.colorTransform;
    function changeHandler(event:ColorPickerEvent):void {
    colorTransform.color = myColorPicker.selectedColor ;
    myMC.transform.colorTransform = colorTransform;
    switch(myMC.colorTransform)
                case 1:
       myMC.colorTransform== 0xff0000;
                   break;
                case 2:
    myMC.colorTransform == 0x0000ff;
                              break;
                case 3:
    myMC.colorTransform == 0x00ff00 ;
                                 break;
    btn.addEventListener(MouseEvent.CLICK, butonClickHandler);
    function butonClickHandler(e:MouseEvent):void{
    if( myColorPicker.selectedColor == myMC.colorTransform ) {                
    text2.text="tebrikler doğru renk seçtiniz";trace(text2.text);}else{
    text2.text="yanlış tekrar deneyiniz";

    there's something wrong with that code either because you're nesting named functions or because of this forum.
    and that switch-statement makes no sense.
    and a colorTransform has a color property but it's not a color.
    and your last if-statement will always be false because movieclips don't have a colorTransform property.  they have a transform property and that has a colorTransform propery.
    and then you should be comparing your color picker's selectedColor with myMC.transform.colorTransform.color.
    copy and paste your code and make sure it's formatted so it's readable.

  • Programatic item events in JComboBox

    I have three JComboBoxes. Each has an ItemListener which calls setCustomerFields.
    public void setCustomerFields(ItemEvent e)
    JComboBox aComboBox = (JComboBox) e.getSource();
    int aIndex = aComboBox.getSelectedIndex();
    myAddressComboBox.setSelectedIndex(aIndex);
    myCustNameComboBox.setSelectedIndex(aIndex);
    myCustNumComboBox.setSelectedIndex(aIndex);
    Each JComboBox looks something like:
    myAddressComboBox = new JComboBox(myAddresses);
    myAddressComboBox.setEditable(true);
    myAddressComboBox.addItemListener(new ItemListener() {
    public void itemStateChanged(ItemEvent e) {
    setCustomerFields(e); } } );
    The purpose is to have all three JCombBoxes stay in sync. When the user selects a value in one setCustomerFields will set the value in the others. The API documentation for JComboBox.addItemListener states addItemListener Specified by: addItemListener in interface ItemSelectable. ItemSelectable Method Details for addItemListener says "Adds a listener to receive item events when the state of an item is changed by the user. Item events are not sent when an item's state is set programmatically. If l is null, no exception is thrown and no action is performed."
    This tells me that "item events are not sent when an item's state is set programmatically." So calling setSelectedIndex in setCustomerFIields should not send an Iterm event. BUT IT IS. And thus I get an endless loop.
    My work around is to call removeItermListener in setCustomerFields.
    I have looked through the forum and found some similar questions but no definitive answer (except call removeItemListener) Also I see reference to a bug http://developer.java.sun.com/developer/bugParade/bugs/4664606.html which is similar but not directly related.
    So my questions:
    1) Am I using ItemListener correctly?
    2) If so why is the Item Event occurring in setCustomerField?
    3) Is the documentation wrong?
    4) I choice ItemListener over ActionListener because ItemListener "isn't" supposed to fire when the state changes programatically. Was that the correct choice?
    Thanks
    Brad

    ItemEvent should send when ever setSelectedIndex call, but you can do one thing :
    public void itemStateChanged(ItemEvent e) {
    if( e.getStateChange() == ItemEvent.SELECTED ){
    setCustomerFields(e); }
    may be this will work from your situation, or i guess you can use some flags type too for checking which one combobox changed then do appropriate action for this.

  • True or false game problem

    hey all, its me, the java noob!
    i've been trying to make a true or false game in which the user has to do the obvious with two of the buttons and press go to start the whole thing.
    however, my program has seriusly gone fooba, it says the wrong wrong answere statements, it jumps to another question whe i give an answere and soemtimes says i'm wrong when i'm not. what am i doing wrong?
    i'm seriusly confused about what i did wrong. here's the code:
    import java.util.Random;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import javax.swing.*;
    import java.awt.FlowLayout;
    class TF extends JFrame implements ActionListener{
         public static void main(String args[]){
              new TF();
         int otherNum = 0;
         int TFnum = 1;
         JButton t = new JButton("true");
         JButton f = new JButton("false");
         JLabel tf = new JLabel();
         JButton BUtton = new JButton("go!");
         public TF(){
         setDefaultCloseOperation(EXIT_ON_CLOSE);
         setLayout(new FlowLayout()) ;
         add(tf);
         tf.setVisible(false);
         add(BUtton);
         BUtton.addActionListener(this);
         add(t);
         t.addActionListener(this);
         t.setEnabled(false);
         add(f);
         f.addActionListener(this);
         f.setEnabled(false);
        pack();
        setVisible(true);     
         public void actionPerformed(ActionEvent e){
         if(e.getSource() == BUtton){
              t.setEnabled(true);
              f.setEnabled(true);
              tf.setVisible(true);
              BUtton.setEnabled(false);
        int tfr = new Random().nextInt(10) + 1;
         switch (tfr) {
         case 1:
         TFnum = 2;
         otherNum = 1;
         tf.setText(" chess was first invented in India");
         break;
         case 2:
         otherNum = 2;
         TFnum = 0;
         tf.setText("Calvin and hobbes were both names of people in the past one was named Jhon Hobbes and the other named Thomas Calvin t/f");
         break;
         case 3:
         otherNum = 3;
         TFnum = 2;
         tf.setText("a microphone needs a windscreen which is usually made of polyster t/f");
         break;
         case 4:
         otherNum = 4;
         TFnum = 0;
         tf.setText("octopus's ink squirt is a good defense, however, the smell the ink lets off creats a direct path towards the octopus t/f");
         break;
         case 5:
         otherNum = 5;
         TFnum = 2;
         tf.setText("Monty Python and the holy grail planned to have a sequal in 1990, but that idea was posponed t/f");
         break;
         case 6:
         otherNum = 6;
         TFnum = 0;
         tf.setText("the molecules of water are structiored so that the o is in the middle and the 2 H's are either sides at 180 degrees. t/f");
         break;
         case 7:
         otherNum = 7;
         TFnum = 2;
         tf.setText("the famous series Doctor who first started in 23 November 1963 t/f");
         break;
         case 8:
         otherNum = 8;
         TFnum = 0;
         tf.setText("the oldest known dice is 5500 years old and was found in russia, it was made from the hoof of an animal t/f");
         break;
         case 9:
         otherNum = 9;
         TFnum = 2;
         tf.setText("the yumi longbow was designed to be easilly fired from horseback t/f");
         break;
         default:
         otherNum = 10;
         TFnum = 0;
         tf.setText("Albert Einstien invented the first laser, albeit only a maschine which caught and concentrated sunlight.");
         break;
         if(e.getSource() == t) {
              t.setEnabled(false);
                 f.setEnabled(false);
            if(TFnum == 0) {
                 t.setEnabled(false);
                 f.setEnabled(false);
                  if(otherNum == 2){
                   tf.setText("you lose, it was Jhon Calvin and Thomas Hobbes (I switch names around)");
                  if(otherNum == 4){
                   tf.setText("you lose, the ink blocks all sense of smell");
                   if(otherNum == 6){
                   tf.setText("you lose, the H's are at 104.45 degrees, so nearly a triangle shape");
                  if(otherNum == 8){
                   tf.setText("you lose, actually, its 5000 years old and was discovered in eastern Iran as part of a backgammon set");
                  if(otherNum == 10){
                   tf.setText("you lose, he set the principal but never invented it.");
             } else {
             tf.setText("you win!!!");
        if(e.getSource() == f) {
            t.setEnabled(false);
                 f.setEnabled(false);
        if(TFnum == 2){
          tf.setText("you lose");     
          } else {
          tf.setText("you win");
      }i get absolutely no error messages but everything does exactely what its NOT meant to do
    if you help me : THANK YOU VERY MUCH !!!!! :)

    well, it vary's, but the overall picture is that when i get
    A) the true button when its false, it gives a Random answere instead of the one i need e.g. when i say that Einstien did invent the first laser (which is bollucks) it says "you lose, the anlgles at which the H's stand to the o is 104.45 degrees" which is not whatits meant to do because that was the answer for a chemical question.
    B) when its false and i click false, it goes perfect!
    C) when i click true and it is true,it goes completely and uterly mad and tells me some sort of "you lose" statement.
    hope that helps

  • True or False using RadioCheckbox - need help ASAP

    So I've been working my way through java with self-study. Our teacher gave us knoweldge not applicable to what he's asked us for our project (except logic). Basically, he wants us to present questions, have the user answer them, then show the number of correct answers.
    I'm now using checkboxes in a True or False 10-item test. I once used buttons, but I gave up and went to checkboxes. I managed to display them using this:
    Parameters:
    tofp = true or false panel
    tofql = true or false question label
    tofqp = true or false question panel
         if(e.getActionCommand().equals("True or False"))
              f2.hide();
              JPanel tofp = new JPanel();
              JPanel tofp2 = new JPanel();
              JPanel tofqp = new JPanel();
              JPanel tofqp2 = new JPanel();
              JPanel tofqp3 = new JPanel();
              JPanel tofqp4 = new JPanel();
              JPanel tofqp5 = new JPanel();
              JPanel tofqp6 = new JPanel();
              JPanel tofqp7 = new JPanel();
              JPanel tofqp8 = new JPanel();
              JPanel tofqp9 = new JPanel();
              JPanel tofqp10 = new JPanel();
              FormPanel3 = new JPanel();
              JLabel tof = new JLabel("<html><Font size=5>TRUE OR FALSE</font> </html>");
              JLabel tofql1 = new JLabel("<html>1. CFC, found in refrigerator and <P> aircons , means Chlorofluorinechloride.</html>");
              JLabel tofql2 = new JLabel("<html>2. Endangered species are species <P> that are less in number and are nearly extinct.</html>");
              JLabel tofql3 = new JLabel("<html>3. The smallest fish in the world <P>is the sardines. </html>");
              JLabel tofql4 = new JLabel("<html>4. The agents of soil erosion are <P>wind, water, and human.</html>");
              JLabel tofql5 = new JLabel("<html>5. One way of conversing energy is <P> by using fluorescent light.</html>");
              JLabel tofql6 = new JLabel("<html>6. The use of dynamite is a legal method <P> of fishing.</html>");
              JLabel tofql7 = new JLabel("<html>7. Windmill is an example of a potential <P>energy.</html>");
              JLabel tofql8 = new JLabel("<html>8. Tamaraws are found in Mindanao.</html>");
              JLabel tofql9 = new JLabel("<html>9. Mining causes minimum destruction to <P> our environment.</html>");
              JLabel tofql10 = new JLabel("<html>10. The Philippines is called the Pacific <P>Ring of Fire because of the many <P> volcanoes surrounding it.</html>");
                b4 = new JButton("Submit");
                b4.addActionListener(this);
              tofp.setPreferredSize(new Dimension(400,550));
              tofqp.add(tofql1);
              tofqp2.add(tofql2);
              tofqp3.add(tofql3);
              tofqp4.add(tofql4);
              tofqp5.add(tofql5);
              tofqp6.add(tofql6);
              tofqp7.add(tofql7);
              tofqp8.add(tofql8);
              tofqp9.add(tofql9);
              tofqp10.add(tofql10);
              tofp.add(tof);
              tofp.setBackground(Color.yellow);
              tofp.add(tofqp);
              tofp.add(tofqp2);
              tofp.add(tofqp3);
              tofp.add(tofqp4);
              tofp.add(tofqp5);
              tofp.add(tofqp6);
              tofp.add(tofqp7);
              tofp.add(tofqp8);
              tofp.add(tofqp9);
              tofp.add(tofqp10);
              tofp.add(b4);
         JRadioButton True = new JRadioButton("True");
             True.setActionCommand("True");
             True.setSelected(false);
         JRadioButton False = new JRadioButton("False");
             False.setActionCommand("False");
             False.setSelected(false);      
             ButtonGroup group = new ButtonGroup();
             group.add(True);
             group.add(False);
             JRadioButton True2 = new JRadioButton("True");
             True.setActionCommand("True");
             True.setSelected(false);
         JRadioButton False2 = new JRadioButton("False");
             False.setActionCommand("False");
             False.setSelected(false);      
             ButtonGroup group2 = new ButtonGroup();
             group2.add(True2);
             group2.add(False2);
             tofqp.add(True);
             tofqp.add(False);
               tofqp2.add(True2);
             tofqp2.add(False2);
              FormPanel3.add(tofp);
              FormPanel3.add(tofp2);
              FormPanel3.add(tofp2);
              f3.setContentPane(FormPanel3);
              f3.pack();
              f3.show();     
              f3.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              f3.setResizable(false);I intentionally just have 2 groups of radio button displayed to test if I could tally the right answer. No luck.
    I'm a complete beginner to this sort of thing, as in starting from scratch. But if I were to apply what our teacher taught us, this would be a simple boolean program. Unfortunately, this kind of thing isn't too simple for me.
    So how do I tally the right answer upon clicking 'submit'. I know you have to have a new frame for that, but it's about tallying. Like the right answer for number 1 is false, for number 2 is true. If you click Submit, I should be able to show "You got 1 correct answer".

    Tan-Tan wrote:
    I'm now using checkboxes in a True or False 10-item test. I once used buttons, but I gave up and went to checkboxes. I managed to display them using this:I'm confused. So does your code use JRadioButtons (like your code says), or JCheckBoxes (like this sentence says)?
    I intentionally just have 2 groups of radio button displayed to test if I could tally the right answer. No luck.How did you attempt to tally the right answer? How do you have the right answers stored? How were you getting the status of each JRadioButton?
    So how do I tally the right answer upon clicking 'submit'. I know you have to have a new frame for that, but it's about tallying. Like the right answer for number 1 is false, for number 2 is true. If you click Submit, I should be able to show "You got 1 correct answer".Worry about how you display the tally later. For now just use a System.out.println. I'd use a for loop to get the status of each JRadioButton or JCheckBox, and check that against an array of correct answers.

  • Getting [Event type="authenticationFailure" bubbles=false cancelable=false eventPhase=2] while tryin

    Hi ,
    i am creating an sample app using LCCS. The flow is stated below.
    on page opens displaying title window and and asking to enter username, password and Account name. i am creating URL on the fly.
    when page loads and if we provide the correct username/password/account name its works fine. The scenario it is failing is for the first if we provide the wrong username validations worksfine and it displays wrong username and with the same session if we are providing correct credentials it is giving me the following error
    [Event type="authenticationFailure" bubbles=false cancelable=false eventPhase=2]
    private  
    function application1_creationCompleteHandler(event:FlexEvent):void
    for (var i:int=0; i <bankData.length ;i++){MonthsArrayCollection.addItemAt(bankData[i].Months,i)
    updatedBankData.source = bankData.source;
    setdata();
    openPopUpWindow();
    private function openPopUpWindow():void {systemManager.addEventListener(PopUpLoginEvent.Login_Event, loginDetails,
    false);popup = PopUpManager.createPopUp(
    this,MyPopUpWindow,true) as MyPopUpWindow;PopUpManager.centerPopUp(popup);
    private function loginDetails(evt:PopUpLoginEvent):void{userName = evt.userName;
    password = evt.password;
    accountName = evt.accountName;
    roomUrl =
    "https://collaboration.adobelivecycle.com/" + accountName +"/test";authenticateHandler();
    //Alert.show(evt.accountName +":"+ evt.userName +":"+ evt.password);
    private function authenticateHandler():void{ 
    //Alert.show("inside="+accountName +":"+ userName +":"+ password+":"+roomUrl);
    //cSession = new ConnectSessionContainer();
    cSession.roomURL = roomUrl;
    cSession.autoLogin =
    false;cSession.addEventListener(SessionEvent.SYNCHRONIZATION_CHANGE,onSync);
    cSession.addEventListener(SessionEvent.ERROR,onSessionError);
    auth =
    new AdobeHSAuthenticator();auth.userName = userName;
    auth.password = password;
    auth.addEventListener(AuthenticationEvent.AUTHENTICATION_SUCCESS,onAuthenticationSuccess);
    auth.addEventListener(AuthenticationEvent.AUTHENTICATION_FAILURE,onAuthenticationFailure);
    cSession.authenticator = auth;
    this.addChild(cSession); 
    cSession.login();
    protected  
    function application1_initializeHandler(event:FlexEvent):void{
    cSession =
    new ConnectSessionContainer();}
    protected function onAuthenticationSuccess(evt:Event):void{
    trace('AuthenticationFailure Sucess');initBindSetter();
    webPulisher =
    new WebcamPublisher();webPulisher.connectSession = cSession;
    this.WebCameraContainer.addChild(webPulisher); 
    simpleChat =
    new SimpleChat();simpleChat.connectSession = cSession;
    simpleChat.height = 235;
    simpleChat.percentWidth = 100;
    simpleChat.styleName =
    "ChatFont"; 
    this.SimpleChatContainer.addChild(simpleChat); 
    webCameraSubscriber =
    new WebcamSubscriber();webCameraSubscriber.connectSession = cSession;
    webCameraSubscriber.height = 176;
    webCameraSubscriber.percentWidth = 100;
    webCameraSubscriber.displayUserBars=
    true;webCameraSubscriber.addEventListener(UserEvent.USER_BOOTED,onBooted);
    webCameraSubscriber.addEventListener(UserEvent.STREAM_CHANGE,onCameraPause);
    webCameraSubscriber.webcamPublisher =
    this.webPulisher; 
    this.WebCameraContainer.addChild(webCameraSubscriber); 
    _camera = Camera.getCamera();
    if(_camera == null){NoCameraImg.includeInLayout =
    true;NoCameraImg.visible =
    true;webCameraSubscriber.includeInLayout =
    false;webCameraSubscriber.visible =
    false;}
    else{NoCameraImg.includeInLayout =
    false;NoCameraImg.visible =
    false;webCameraSubscriber.includeInLayout =
    true;webCameraSubscriber.visible =
    true;}
    collabView.visible =
    true;PopUpManager.removePopUp(popup);
    protected function onAuthenticationFailure(evt:Event):void{
    //Alert.show("ww="+cSession.);Alert.show(
    'AuthenticationFailure Occured'+evt.toString()); 
    /* cSession.logout();this.removeChild(cSession); */ 
    //auth.logout();}
    protected function onSessionError(event:SessionEvent):void{
    if( event.error ){
    switch (event.error.name){
    case "INVALID_INSTANCE":Alert.show(
    "Room: "+ roomUrl +", has not been created. \nPlease login to the room console and create a room named "+roomUrl+".", "Room Not Created" ); 
    break;}

    that looks similar to 2 flash trace() statements and one non-flash error message.

  • Getting the correct userid in a afterproperties in a item event receiver

    HI,
     am writing  a   custom item event receiver and i am trying to read from a user/group column. and when i am  using afterproperties to get the  getitembyid() for a user, am getting different values on different times.
     yesterday when i accessed the same, i am getting the correct  user id i mean if its  "in\john.mith " am getting the  values  john.smith.
     but today when i debugged, i am not getting the john.smith value instead it pulled the fully qualified value - i eman  - along with authentication  - i:#w0/.....kind of.
    its strange that sometiems its working fine and sometimes the same code behaves in a different way.
    can ansyone please provide any hint what exactly going on and how can i get a correct id when i use afterproperties.
    help  is appreciated!

    Hi,
    According to your description, the value of the User field in the AfterProperties not always the same.
    As you said, the value got changed today when you debug your event receiver, is there any change in your environment recently?
    A possible reason might be that the authentication method has been changed.
    There is a test in Naim’s blog about the different value of User filed in an Event Receiver when in different authentication mode:
    http://naimmurati.wordpress.com/2014/07/25/user-field-in-event-receivers-when-using-claims-based-authentication-and-classic-mode-authentication/
    How to determine the Authentication mode of a web application:
    http://blogs.msdn.com/b/psssql/archive/2011/02/22/sharepoint-adventures-how-to-identify-if-you-are-using-claims-authentication.aspx
    Thus, a possible workaround to get the user name from a User field is that you can use
    properties.ListItem["UserField"] which will return same result whatever the authentication mode would be.
    Best regards
    Patrick Liang
    TechNet Community Support

Maybe you are looking for

  • Using Phone Functions with Samsung a900

    Hello all... I have a Samsung a900 from Sprint, and just learned that I can use the phone functions in the Address Book app. I go to pair the device to my iBook, and type in my defined passkey, but nothing happens. And Bluetooth Setup Assistant says

  • Problems with GFW Classes

    Hi I use the GFW classes to show a chart ! I works fine! When I leave the dynpro who show the chart, I call the method CALL METHOD GP_INST->IF_GRAPHIC_PROXY~FREE. When I call this Dynpro again It dow not show the chart not again! The Problem is that

  • Alternative to Motion 4?

    I'm working on a web site and would love to find a cheaper alternative to Motion 4.  I don't need the entire suite of Final Cut and really just need/want the capabilities found in Motion 4.  Are there any alternatives that are available on the Mac Ap

  • Need to know the standard function module/program in E recruitment

    Hi All, I need to know the standard function module/programm that defaults the 'Functional area' field in the posting page from the requisition page. Early responce is greatly appreciated. Thanks and best regards Rajeev

  • QS41-Use / Imp of Classification TAB.

    Hi All, This is related to transaction QS41. In this transaction we define codes and code group for catalog type E(defect location). On main screen of this transaction we have TAB Classificaton. Can any one please let me know waht is the importance o