This discussion is archived
7 Replies Latest reply: May 20, 2013 12:24 PM by 1008295 RSS

Development of a single row functionality with list items

1008295 Newbie
Currently Being Moderated
Hello,
I am new to Oracle forms. Presently using Oracle forms 6i.
I am facing a problem when controlling the status of items within a row while choosing the 'List item'. I basically have multi-data block. On the data block I have assigned the property as 'List Item' to one of the item. This list item has three options 'MANUAL', 'AUTO' and 'ADVANCE'. When I choose the list item 'MANUAL', corresponding row should be editable and the user can insert the record in that row. But when I choose 'AUTO' or 'ADVANCE' only the specified item say for e.g. the item 'Sr.no' only should be editable while all the other items are uneditable. I have tried using set_record_property for 'MANUAL' and that serves my purpose. But have written set_item_property for 'AUTO' and 'ADVANCE' which then spoils the 'MANUAL' functionality for the next row/record after an 'AUTO' or 'ADVANCE' row is inserted.
Please help asap as this is an urgent requirement.

Edited by: 1005292 on May 10, 2013 12:43 PM
  • 1. Re: Development of a single row functionality with list items
    GregorM Explorer
    Currently Being Moderated
    Hi.

    You should use two triggers :
    1. when-new-record-instance -> in this trigger you should check the value of "List item". If the "List item" is empty you have to set all the item editable. If the "List item" is not empty you have to set items properly as per your needs regarding "List item" value.
    2. when-list-changed -> Change the editable property of items appropriately depending on value selected in "List item"

    The point here is you have to set/unset items in every row the user navigates to. That is done by when-new-record-instance trigger.

    Hope this helps

    Best regards.
  • 2. Re: Development of a single row functionality with list items
    Andreas Weiden Guru
    Currently Being Moderated
    I agree with Gregor using the WHEN-LIST-CHANGED-trigger. But i would not set the properties INSERT_ALLOWED and UPDATE_ALLOWED in a WHEN-NEW-RECORD-iNSTANCE-trigger, but set them in the WHEN-LIST-CHANGED-trigger and in the process of filling the block(i don't know how the block is populated, if its done using EXECUTE_QUERY the trigger would be the POST-QUERY-trigger).

    The statement to make an item in the current record insertable is
    SET_ITEM_INSTANCE_PROPERTY('BLOCK.ITEM', TO_NUMBER(:SYSTEM.TRIGGER_RECORD), INSERT_ALLOWED, PROPERTY_TRUE);
    SET_ITEM_INSTANCE_PROPERTY('BLOCK.ITEM', TO_NUMBER(:SYSTEM.TRIGGER_RECORD), UPDATE_ALLOWED, PROPERTY_TRUE);
  • 3. Re: Development of a single row functionality with list items
    GregorM Explorer
    Currently Being Moderated
    Hi Andreas,

    The built-in SET_ITEM_INSTANCE_PROPERTY you suggested is only applicable when data are retrieved from database but not when the user inserts a new record. My point/assumption is the requirement is also this : "if user creates a new record and set the list item to some value there should also be mentioned (items enabled/disabled) business logic involved."

    Best regards.
  • 4. Re: Development of a single row functionality with list items
    Andreas Weiden Guru
    Currently Being Moderated
    SET_ITEM_INSTANCE_PROPERTY works also for newly created records when you use the property INSERT_ALLOWED.
  • 5. Re: Development of a single row functionality with list items
    1008295 Newbie
    Currently Being Moderated
    Hi Gregor
    Yes that exactly is my requirement. When I choose a value from the list item the items should be enabled or disabled.
    When I choose 'MANUAL' that whole row (i.e. the items in the row should be editable) as I am inserting a new record in that particular row.
    But when I choose 'AUTO' or 'ADVANCE' only two items in that row should get edited while all the other items should remain uneditable.
    The data gets populated with an execute_query.

    Now when I tried setting set_item_instance property on the list item here is the scenario:
    When I choose 'MANUAL' initially for first time the whole row is editable but when i choose the rest of the two, what happens is, the set_item_instance property is fired and all the remaining columns are set as per editable/uneditable. Now again when I choose 'MANUAL' the item properties are not fired according to this list item(as in the whole row does not become editable).

    Also it should not happen that first when I choose MANUAL, then AUTO or ADVANCE and again MANUAL the row with the list item AUTO or ADVANCE which is in between, becomes editable totally.
  • 6. Re: Development of a single row functionality with list items
    1008295 Newbie
    Currently Being Moderated
    Thanx Andreas, that really saved my time as I read a lot but did not find the right suggestions.

    Would like to have suggestions for 2 more threads posted :

    1)problem with set_item_instance_property and set_lov_property

    2)setting property on radio button status

    Edited by: 1005292 on May 20, 2013 12:25 PM
  • 7. Re: Development of a single row functionality with list items
    1008295 Newbie
    Currently Being Moderated
    Thanx GregorM, help with the triggers was really required. Would like to have suggestions for 2 more threads posted :

    1)problem with set_item_instance_property and set_lov_property

    2)setting property on radio button status

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points