Disable button when no records in multirecord block.

Hello,
In a tabular multirecord block we have a button that will open another window for the selected row. The problem is that when there are no records in the multirecord-block, the first line is still selected, and the pushbutton is enabled. This will cause an error when the user press the button when there are no records. Adding code to the button will of course take care of the error, but it is still enabled. How do we disable the entire line when there are no records?

how about - directly after querying the master record...
go_block(<block>)
if :blk.key (or :blk.rowid) is null then
  SET_ITEM_PROPERTY('<buttonname>',enabled, property_false);

Similar Messages

  • Disable button when user clicks

    Hi.,
    I am using jdev 11.1.5
    I need to disable button when user clicks the record which contain the value 'No'
    My scenario
    Id          Value
    1            Yes
    2            No
    3            YesThe button should get enabled for the first record which contain value 'Yes'
    In the above table the button should get enabled for
    Id        Value
    1          Yes          //while user clicks the record button must enabledfor 2 and 3 the button must be disabled
    could any one pls help me

    Hi,
    First get the selected value in bean and set it to String attribute,in your value change listener.
            public void customVLC(ValueChangeEvent valueChangeEvent) {
              //write code to get selected value
              this.selectedValue = "No";//Depend on your selected value on above
              AdfFacesContext.getCurrentInstance().addPartialTarget(getCbButton());//Bind button to bean and get UI here to refresh
       private String selectedValue;
        public void setSelectedValue(String selectedValue) {
            this.selectedValue = selectedValue;
        public String getSelectedValue() {
            return selectedValue;
        }in page put as
    disabled="#{YourBean.selectedValue eq 'No' ? true : false}"Here selectedValue keep the state for disable and enable the button
    I hope above information enough to resolve the issue..

  • Jump to one defined record in multirecord block

    Hello.
    I have a multirecord block.
    ex:
    rec, day, text
    rec1, day1, text1
    rec2, day1, text2
    rec3, day2, text1
    rec4, day2, text2
    rec5, day2, text3
    rec6, day3, text1
    User can select any record in that block. But when he presses one button, form should first jump to first record of that day, then execute everything else in that trigger.
    If the user is in record:
    rec5, day2, text3
    form should jump to record:
    rec3, day2, text1
    If the user is in record:
    rec2, day1, text2
    form should jump to record:
    rec1, day1, text1.
    And so on.
    Is there a way to do that?
    Thanks.

    Another technique ...
    Declare
         v_Day Table.Field%Type;
    Begin
         v_Day := :Rec.Day;
         Previous_Record;
         Loop
              if :Rec.Day <> v_Day then
                   Next_Record;
                   Exit;
              else
                   Previous_Record;
                   if :System.Cursor_Record = 1 then
                        Exit;
                   End if;
              End if;
         End Loop;
    End;
    Best regards
    R E H A N M I R Z A

  • Disable Button when no rights to enter Form

    I have a form which i can open from another form with use of a button.
    The problem is:
    One of our users have the rights to enter form1 on but not to enter form2 through menu. But on form1, i have a button to goto Form2.
    Now i want to know how to disable this button when she enters form1. We tried to use a get_menu_property procedure. Does anyone knows a code to disable a button.
    Our code is:
    PROCEDURE Toggle_Enabled( consultant_profielen VARCHAR2) IS
    mi_id MenuItem;
    BEGIN
    mi_id := Find_Menu_Item( consultant_profielen );
    IF Get_Menu_Item_Property(mi_id,ENABLED) = 'TRUE' THEN
    Hide_button('consultantprofiel');
    ELSE
    Null;
    END IF;
    END;
    This code doesn`t work, anyone know how it will work.
    Thanks,
    Vincent

    set_item_property on the button should do it. check the online help

  • Disable button when text field is empty

    Hi
    How can I disable a button in JDialog box when the text field is empty and enable it when the user gives some input.
    Balaap

    You will have to use a keyListener since the use is not able to type into a disabled TextField. Listen for KeyEvents, if you get one enable the TextField a fill it with the char of the pressed key.
    Rommie.

  • How to disable buttons when another button is clicked

    I have an application with 5 buttons that each play or pause
    different movieclips. How can I prevent other buttons from playing
    different movieclips when a movieclip is already playing.

    I looked in the help and found an example actionscript. I
    changed the button instance names to the button names in my app. I
    put the actionscript on frame 1 that holds the movieclip being
    played. Here it is
    mycase3_btn = true;
    mycase1_btn = false;
    mycase2_btn = false;
    //button code
    // the following function will not get called
    // because myBtn2_btn.enabled was set to false
    mycase1_btn.onRelease = function() {
    trace( "you clicked : " + this._name );
    mycase2_btn.onRelease = function() {
    trace( "you clicked : " + this._name );
    mycase3_btn.onRelease = function() {
    trace( "you clicked : " + this._name );
    It doesn't disable the other 2 buttons. As may be obvious I
    am new to all but the simplest actionscripts. What am I doing
    wrong?
    thank you for your time!

  • Enabling Insert allowed for particualr records in a block,

    Hi All,
    I have a requirement to enable insert allowed(and delete allowed) button for only particular records(say for all records where column1=2) and for all other values that insert allowed button should be disabled.
    I tried setting the property
    SET_BLOCK_PROPERTY for insert allowed for my block, in new_block_instance.
    when i'm querying the first time with column1=2, its working fine.
    But, when im querying my blcok with column1=5 and then requerying the block with column1=2, im facing issue. insert allowed button is disabled here.
    Not sure, whether this can be achieved or not using this way. Please suggest me if there is any other ways we can do in oracle forms.
    Thanks & regards,
    Pavan Kumar

    I have used the below code in when new record instance at block level,
    IF event='INSERT'
    THEN
    IF :xxscp_gbl_exp_detail_v.order_type=5
         THEN
         SET_BLOCK_PROPERTY('XXSCP_GBL_EXP_DETAIL_V',
         insert_allowed,
         property_true);
    ELSE
    SET_BLOCK_PROPERTY('XXSCP_GBL_EXP_DETAIL_V',
         insert_allowed,
         property_false);
    END IF;
    END IF;
    as i already told, it work when i directly search with order_type=5.
    But not working, when i first search with order_type=1 and then with order type 5.
    Thanks in advance,
    pavan

  • When-Remove-Record, does not update header field

    i have master-detail form and in that there is a DB field eh_amount, which takes it value from
    the computed non-db summary field m_amount
    my E_head
    eh_code
    eh_no
    eh_amount
    my E_detail (tabular with 5 records displayed)
    ed_eh_code
    ed_eh_no
    ed_amount
    m_amount <---summary column (summing ed_amount)
    whenever i enter/update ed_amount , m_amount get computed properly.
    i have WVI trigger written where i store eh_amount := m_amount
    i have also written When-remove-record on e_datail block, where i again re-initialize
    eh_amount := m_amount
    the detail record gets deleted and m_amount gets updated,
    but the header eh_amount does not show the updated value of m_amount.
    Kindly suggest to me as to where the change has to happen.

    Hi Craig..
    I am using form6i, db 10g.
    I am not doing summation myself. My m_amount field is calculated field set at design time.
    Summary detail block is E_detail and summary field is ed_amount.
    Only after saving form, the new value for eh_amount is seen.
    what i want is eh_amount should be seen updated, if while entering i delete any detail record.
    in when-remove-record i am storing m_amount in eh_amount, but the new value of eh_amount
    is visible only after saving the form and not when any record is deleted.

  • Disabling radio buttons in multi record block

    Need to be able to disable/enable one or more radio buttons in a group dynamically in multiple record block. Tried setting enabled properties but it sets for all records in the block. At the very least, I need to reset an item using radio to previous value if setting is invalid but when-radio-changed has already set value. Thank you.

    Your one row record has 5 items, then I assume empno, ename, ssn, phone, deptno 5 items on your multi-record block.
    you entered first row record as,
    empno, ename, ssn, phone, deptno
    100 John Smith 123-45-9999 234-333-9999 2
    101 Al Brown 222-34-1111 123-456-7890 2(duplicated)
    You want your code to duplicate the second deptno record as 2 instead of typing in, right?
    If so, then you add KEY-NEXT-ITEM trigger on item :phone, inside put,
    go_item('deptno');
    duplicate_item;
    It will copy the first deptno record 2 for the second record as showed above.

  • Push Button in Multirecord block and Record Number

    Hi All,
    I have a push button in Multirecord block.
    for eg. there are 5 records in that block and cursor is on 1st record. if users pressess the push button on 3rd record (or other than 1st record) i want to get that 3rd record number. i am not able to get this. i checked :system.trigger_record, cursor_record, mouse_record values but it is not working correctly.
    what code should i write in when-button-pressed trigger to work it the way i want.
    can anybody help.
    regds

    Yes i got it
    Re: multi-record push button
    set mouse navigable property to true for push button and you get the :system.trigger_record value.

  • Multirecord block & when-button pressed

    Forms10g
    In a multirecord block there's a button displayed for each row.
    Problem is:
    Focus doesn't change to the row where button is pressed before executing the "w-b-p" trigger logic and therefore correct context information is not passed !
    I've tried to get form to synchronize:
    synchronize;
    go_record(:system.trigger_record); and also
    go_record(:system.cursor_record);
    but system variables are not being set before executing "w-b-p trigger" ?
    HAs anyone got a workaround for this ?
    Thanks
    Pete

    Set the Mouse Navigate property to TRUE/YES on the button

  • Showing 10 records at a time in a multirecord block

    Hello,
    I have a requirement to show 10 records at a time,consider a table in which
    there are 100 records which is associated to a multirecord block,in order to have a web look and feel I need to show first 10(1 to 10) record on load,when the user presses the button "Next 10 records", I need to replace the first 10 records with new set of 10 records(11 - 20),
    Please note that no of records to be displayed at a time will be 10 and our requirement is avoid scroll bar.
    Any suggestions as to how I need to accomplish the task above.
    Thanks and Regards
    Mohan

    You don't need a special button for this because the user can already navigate using the cursor keys and page up/down keys.
    For cursor keys use the key-up, key-down, key-nxtrec and key-prvrec triggers.
    For page up/down use the key-scrup and key-scrdown triggers.
    I suppose the menu option "Query > Fetch Next Set" (key-nxtset) should operate the same as page down.
    An example of the key-scrdown trigger is thisdeclare
         numrecs integer := get_block_property('EMP',records_displayed);
         toprec integer := get_block_property('EMP',top_record);
         thisrec integer := :system.trigger_record;
    begin
         go_record(toprec + (2 * numrecs) - 1);
         go_record(thisrec + numrecs);
    end;This will advance by as many records are in the block and leave the cursor positioned on the same record relative to the top of the block. Eg if there are 10 rows in the block and you're on the first set then the top record will be 1 and you want to make the new top record 11. So you need to call go_record(20), which makes that the bottom record and 11 the top one.
    You'll need to work out how the form should behave when the number of records in the block is not exactly divisible by the number of records in the data because forms won't allow blank records to pad out the bottom of the block and records_displayed isn't a settable property at runtime. So if there are 10 rows in the block and 103 rows of data then the penultimate page will show records 91-100 and the last page will show records 94-103. Should scrolling back up show record 91 at the top, or 84?
    For the key-down/key-nxtrec trigger you'll probably want something like thisdeclare
         numrecs integer := get_block_property('EMP',records_displayed);
    begin
         if :system.last_record != 'TRUE' then
              if mod(:system.cursor_record,numrecs) = 0 then
                   -- last record in this set
                   go_record(:system.cursor_record + numrecs);
                   go_record(:system.cursor_record - (numrecs - 1));
              else
                   next_record;
              end if;
         end if;
    end;If you're at the bottom of one set it will show the next set and go to the top record, otherwise it will just go to the next record. But again, this breaks down when the number of rows in the block and in the data don't divide up evenly.
    I hope this is enough to get you started.

  • Disable checkbox in multiple record block with form personalization in r12

    hi
    i try to personalized form 'Autocreate Document' in purchasing super user responsibility in R12
    i want to disable some checkbox in block REQ_LINES that meet some criteria
    but why when personalized run, it disable all checkbox in all record in block REQ_LINES
    --Condition--
    Event trigger     : WHEN-VALIDATE-RECORD
    Trigger object    : REQ_LINES
    --Action--
    Type               : property
    Language         : all
    Object type     : item
    Target Object     : REQ_LINES.SELECT_LINE
    Properti name     : enabled
    value               : false
    please give me advice about this
    thank you very much for help

    I recommend you these forums for your question:
    Forums Home » Oracle Technology Network (OTN) » Products » Database » JVM
    Java in the Oracle Database
    Forums Home » Oracle Technology Network (OTN) » Technologies » Java » Java Server Pages (JSP)
    Java Server Pages (JSP)
    Forums Home » Oracle Technology Network (OTN) » Technologies » Java
    http://forums.oracle.com/forums/index.jsp?cat=24
    Joel Pérez

  • Navigate to pressed button in multirecord block

    Hi,
    I'm using Forms 6i (6.0.8.27.0), Client / Server.
    I have a multi-record block with a button ("+") in the block for duplicating the record and increasing the date.
    So each row has a "+" button.
    When I press the "+" eg. on the 3rd row I want to navigate to this row and to execute the code in when-button-pressed trigger.
    So I wrote in the when-button-pressed trigger
    "GO_RECORD(:system.mouse_record);
    duplicate_record;
    Unfortunately :system.mouse_record is set to 1, also :system.cursor_record and :system.trigger_record.
    The "Mouse Navigate" property of the button is set to "yes".
    I have used the search function but didn't found a solution.
    Thanks in advance,
    Marco.

    Marco,
    My apologies, I should learn to read all of the message. I am embarrassed into having another try.
    Firstly, to clarify
    I am using Forms10g (sorry but it was the only one I could remove a developer from)
    Duplicate_Record: Copies the value of each item in the record with the next lower sequence number to the corresponding items in the current record. The current record must not correspond to a row in the database. If it does, an error occurs.
    I have setup a default block with a button on it and to test I have just executed a query against the block.
    After rows have been retrieved
    When I click on a button system.mouse_record always returns 0 (In the help it says this will be the case if you are not in an item, but I do not know if a button is classed as an item in the eyes of the help test author, I thought it might be, but maybe they mean a text item?) when I use :system.trigger_record I always get the right record number.
    For duplicate_record to work I have to be in a "NEW" record. I appear to be able to do this in two ways.
    Go to the bottom of my records + 1. The button becomes enabled and when I press it I can duplicate the record above.
    I can choose "insert record" (key-crerec I think or create_record) if I do this I can then press the button and duplicate the record above into this new record.
    If I press a button on a record which already has a record I presume of type QUERY then when I press the button I get FRM-41802 duplicate record function allowed on new records only.
    If I do not perform a query in the block; I create the first record input data I have to move to the next record to enable the button
    If I press the button it duplicates the value in the first record
    If I change the value in the second record and then go back to the first and press the button on the second row it overwrites the value with the value from the first row
    I hope this gives you some pointers in solving your problem.
    Apologies again for not reading properly and I hope that my using 10g has not made all this info useless.

  • Enable/disable an item in a multirecord block

    hello to all
    How is possible Enable/disable an item in a multirecord block?
    set_item_property change all instances of an item in a multi-record block
    SET_ITEM_INSTANCE_PROPERTY only affects the display
    thanks

    Hi,
    You cannot set the Enabled property in a multi-record block, instead you can change the INSERT_ALLOWED, UPDATE_ALLOWED properties. So that the user can't change the value in the item.
    Regards,
    Manu.
    If my response or the response of another was helpful, please mark it accordingly

Maybe you are looking for

  • FM10 Book to PDF - show title (not PDF filename) in Reader header?

    FrameMaker 10.0.2.419 + Distiller X Pro 10.1.438 -> Adobe Reader X I have a FM book file with a title along the lines of 'Worked Examples'. When I save it to PDF with Distiller and view the PDF in Adobe Reader X, the reader's header bar shows the PDF

  • Goldengate Language settings

    Hi, We have OS / Application being configured to Japanese language. Can we install Goldengate in English version and how will the log files will be generated? Does it have any effect on goldengate configuration? And whether it is a valid scenario? Th

  • DHCP issues for Wired Guest LAN

    Hi Everyone, I've a 1751 acting as a DHCP server for client PCs on a guest network A.B.8.x (using an Anchor controller) on the DMZ of my firewall. The 1751 reports the following Nov 30 15:35:45: DHCPD: DHCPDISCOVER received from client 0100.1708.37a3

  • Changing the Bitrate when transfering to iPod

    Is it possible to change the bitrate of a mp3 file when transfering files between itunes and my ipod? I have a lot of mp3 files encoded at 256 kbps but because I have so many of them I want to transfer them at 128 kbps. I know you can convert it to A

  • BATMAS Configuration

    IDoc BATMAS03 is creating in our system when a goods receipt is completed, and I'm not sure why.  (Obviously someone set this up, but the IDocs are not going anywhere so I want to turn it off.)  I see in transaction BD52, BATMAS is set up with an ent