How to process checkbox change in a simple list?

Hi guys,
I'm in a middle of a task, where some table is asked to be written on the screen (simple WRITE statement) and one of the fields is written in a way:
LOOP AT it.
  WRITE: it-f1 AS CHECKBOX.
ENDLOOP.
The screen in simple, PF-STATUS is not complex also.
Everything is shown as expected. But I've been asked to manipulate content of the it-f1 depending on the user-action on the screen - i.e. if the user checked/unchecked f1 at line 23, this should be corrected into an it[23] also. In my PF-STATUS I have a 'SAVE' button, and after pressing it I should have my internal table filled correctly depending on the user interaction. The table is expected to be long (approx. 200-300 records or so).
How to achieve this? I played with AT LINE-SELECTION and much more which I found in the docu, but with no success until now.
Any help would be highly appreciated.
If any specifics are needed, I'm ready to supply them here.
Many thanks in advence.
Ivaylo

Hello ,
The following code sample should do the trick.
==========================================================
REPORT  ZTEST no standard page heading.
data : begin of itab occurs 0,
         check type c,
         value type i,
       end of itab.
data: w_line_no  type i,
      w_itab(72) type c.
start-of-selection.
do 10 times.
  itab-value = sy-index.
  append itab.
enddo.
loop at itab.
  write : / itab-check as checkbox,
            itab-value.
endloop.
at user-command.
if sy-ucomm eq 'SAVE'.
  clear itab.
  loop at itab.
    w_line_no = sy-tabix.
    read line w_line_no line value into w_itab.
    itab-check = w_itab(1) .
    modify itab transporting check.
  endloop.
endif.
==========================================================
Get back if you have any more doubts on this.
Regards,
Anand Mandalika.
P.S. : Don't forget to award the points if you like the solution.

Similar Messages

  • How to handle value change events of select list in custom component?

    My HelloUIComp code...How to handle events for "Select"...if i choose option1 from select then one text box is to be displayed in custom component and if i choose another option then some other text box is to be displayed in custom components...
    public class HelloUIComp extends UIComponentBase {
        public static final String account="custom.account";
        public static final String RENDERER_TYPE = null;
        HtmlCommandButton button = createButton();
        //HtmlSelectOneMenu select=createSelect();
        public void processDecodes(FacesContext context) {
             Calling the lifecycle method "processDecodes" on the
             internal button is absolutely critical to create action events
             button.processDecodes(context);
             super.processDecodes(context);
        private HtmlCommandButton createButton() {
             FacesContext context = FacesContext.getCurrentInstance();
             HtmlCommandButton newButton = new HtmlCommandButton();
             newButton.setId("Add");
             newButton.setValue("Add");
             newButton.setType("submit");
             //newButton.setOnclick("return func_1(this,event);");
             MethodBinding binding = context.getApplication().createMethodBinding("#{pc_MyProjectView.go}", null);
             newButton.setAction(binding);
                  newButton.setParent(this);
             return newButton;
      /*  private HtmlSelectOneMenu createSelect()
             HtmlSelectOneMenu selectCategory=createSelect();
             return selectCategory;
         public void encodeBegin(FacesContext context) throws IOException {
              String style = (String)getAttributes().get("style");
              String startdate = (String)getAttributes().get("startdate");
              String enddate = (String)getAttributes().get("enddate");
              //String add=(String)getAttributes().get("add");
              ResponseWriter writer = context.getResponseWriter();
             writer.startElement("table", this);
            writer.writeAttribute("border","2","2");
            writer.startElement("tbody", this);
            writer.startElement("tr", this);
            writer.startElement("td", this);
            writer.writeText("Account Category", null);
            writer.endElement("td");
              writer.startElement("td", this);
              writer.writeText("Reg-No", null);
              writer.endElement("td");
              writer.startElement("td", this);
            writer.writeText("Account-No", null);
              writer.endElement("td");
              writer.startElement("td", this);
            writer.writeText("", null);
              writer.endElement("td");
              writer.startElement("td", this);
            writer.writeText("Start-Date", null);
              writer.endElement("td");
              writer.startElement("td", this);
            writer.writeText("End-Date", null);
              writer.endElement("td");
              writer.endElement("tr");
              writer.startElement("tr",this);          
              writer.startElement("td", this);
              writer.startElement("select", this);
            if (style!=null)
                   writer.writeAttribute("style", style, null);
            writer.writeAttribute("name","category","category");
            writer.startElement("option", this);
              writer.writeText("Select", null);
              writer.endElement("option");
              //to access data
              Account accountObj;
              AccountData accountDataobj;
              List listOfAccounts;
              int noOfAccounts;
              accountDataobj=new AccountData();
              listOfAccounts=accountDataobj.getAccounts();
              noOfAccounts=listOfAccounts.size();
              for(int i=0;i<noOfAccounts;i++)
              writer.startElement("option", this);     
              accountObj=(Account) listOfAccounts.get(i);
              writer.writeText(accountObj.getCategory(), null);
              writer.endElement("option");
              //System.out.println(accountObj.getRegNo());
              //System.out.println(accountObj.getAccountNo());
              writer.endElement("select");
              writer.endElement("td");
            writer.startElement("td", this);
              writer.startElement("select", this);
              if (style!=null)
                   writer.writeAttribute("style", style, null);
              writer.writeAttribute("name","regno","regno");
              writer.startElement("option", this);
              writer.writeText("Select", null);
              writer.endElement("option");
              for(int i=0;i<noOfAccounts;i++)
              accountObj=(Account) listOfAccounts.get(i);     
              writer.startElement("option", this);
              writer.writeText(""+accountObj.getRegNo(), null);
              writer.endElement("option");
              writer.endElement("select");
              writer.endElement("td");
              writer.startElement("td", this);
              writer.startElement("select", this);
              if (style!=null)
                   writer.writeAttribute("style", style, null);
              writer.writeAttribute("name","accno","accno");
              writer.startElement("option", this);
              writer.writeText("Select", null);
              writer.endElement("option");
              for(int i=0;i<noOfAccounts;i++)
              accountObj=(Account) listOfAccounts.get(i);
              writer.startElement("option", this);
              writer.writeText(accountObj.getAccountNo(), null);
              writer.endElement("option");
              //writer.startElement("option", this);
              //writer.writeText("00200155", null);
              //writer.endElement("option");
              writer.endElement("select");
              writer.endElement("td");
              writer.startElement("td", this);
              button.encodeBegin(context);
             button.encodeChildren(context);
             button.encodeEnd(context);
            writer.endElement("td");
              writer.startElement("td", this);
              writer.startElement("input", this);
              if (style!=null)
                   writer.writeAttribute("style", style, null);
              writer.writeAttribute("type","text","text");
              writer.writeAttribute("name","startdate","startdate");
              writer.writeAttribute("value",startdate,startdate);
              writer.writeAttribute("readonly", "","");
              //writer.endElement("input");
              writer.endElement("td");
              writer.startElement("td", this);
              writer.startElement("input", this);
              if (style!=null)
                   writer.writeAttribute("style", style, null);
              writer.writeAttribute("type","text","text");
              writer.writeAttribute("name","enddate","enddate");
              writer.writeAttribute("value",enddate,enddate);
              writer.writeAttribute("readonly", "","");
              writer.endElement("td");
              writer.endElement("tr");
              writer.endElement("tbody");
              writer.endElement("table");
         public String getFamily() {
              return "HelloFamily";
         }

    NewEclipseCoder wrote:
    How to handle events for "Select"...if i choose option1 from select then one text box is to be displayed in custom component and if i choose another option then some other text box is to be displayed in custom components...Two ways:
    1) submit the form to the server and render the desired textbox depending on the option.
    or
    2) render all textboxes and use Javascript/DOM to display/hide them depending on the option.

  • How to Get checkbox value when List value changed in classic report

    hi ,
    i worked with apex 4.2 and i create normal classic report with one checkbox column and one column change it to select list(named loved) now i want when user change list
    take value of checkbox item and show it in message .
    SQL for report
    SELECT
    '<INPUT TYPE="checkbox" NAME="f01" VALUE="'
    ||SEQ
    ||'">' SEQ,
    ID,
    DEPT_NO,
    EMP_NAME} i change the column attributes of Dept_NO to Display as Select list of department name (named lov).
    now i want when user change name of department the value of SEQ SHOW IN ALERT MESSAGE
    i create JavaScript on the page
    function test(pThis) {
    var f01_value = $('select[name="f01"]').value;
    alert('#SEQ : '+ f01_value);
    </script>
    I call this javascript function when list change but the value undefined..
    My Question :
    How can get this value Or any value of item in reports
    regards
    Ahmed

    Hi Ahmed,
    >
    i worked with apex 4.2 and i create normal classic report with one checkbox column and one column change it to select list(named loved) now i want when user change list
    take value of checkbox item and show it in message .
    SQL for report
    SELECT
    '<INPUT TYPE="checkbox" NAME="f01" VALUE="'
    ||SEQ
    ||'">' SEQ,
    ID,
    DEPT_NO,
    EMP_NAME} i change the column attributes of Dept_NO to Display as Select list of department name (named lov).
    >
    You should not create checkboxes like this. Either use the APEX_ITEM.CHECKBOX2 API or change the Column Type to Simple Checkbox.
    >
    now i want when user change name of department the value of SEQ SHOW IN ALERT MESSAGE
    i create JavaScript on the page
    function test(pThis) {
    var f01_value = $('select[name="f01"]').value;
    alert('#SEQ : '+ f01_value);
    </script>
    >
    name="f01" returns an array, what you need is single element value.
    Try
    <script type="text/javascript>
    function test(pThis) {
      var f01_value = $v(pThis);
       alert('#SEQ : '+ f01_value);
    </script>
    {code}
    {quote}
    I call this javascript function when list change but the value undefined..
    My Question :
    How can get this value Or any value of item in reports
    {quote}
    Depends in how you are invoking/triggering the change event. Are you using DA or have you written an "onchange" event on the element?
    Cheers,                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Simple/silly question: how do I set/change default font/color for outgoing mail messages?

    Simple/silly question: how do I set/change default font/color for outgoing mail messages?

    Just a suggestion..........
    Download Thunderbird.  Easier to use when it comes to what you want to do w/your emails. 

  • How to get the changes during ABENDED replicat process

    Hi,
    I am working on Oracle GG bi-directional DML replication. I m stuck in one place.
    My target replicat process was ABENDED due to Error :- ORA-01403: no data found. I restarted my replicat process again by runing the below command
    GGSCI (db1) 30> alter replicat rep2 begin now
    GGSCI (db1) 30> start replicat rep2
    After restart the replicat process I can't see the changes on target server which I had applyed on source server during target replicat was ABENED.
    My doubt is.
    1. Is my command is correct for start the ABENDEND replicat process?
    2.How to get the changes on target server which applyed on source during ABNDED of targer replication?
    3.How to avoid the ABENDED replicat process on production server?
    4.how to track the ABENDED process in production server?
    Please HELP:(
    Edited by: NaveenK on Aug 29, 2012 3:32 AM

    NaveenK wrote:
    Hi,
    I am working on Oracle GG bi-directional DML replication. I m stuck in one place.
    My target replicat process was ABENDED due to Error :- ORA-01403: no data found. I restarted my replicat process again by runing the below command
    GGSCI (db1) 30> alter replicat rep2 begin now
    GGSCI (db1) 30> start replicat rep2
    After restart the replicat process I can't see the changes on target server which I had applyed on source server during target replicat was ABENED.
    My doubt is.
    1. Is my command is correct for start the ABENDEND replicat process?
    2.How to get the changes on target server which applyed on source during ABNDED of targer replication?
    3.How to avoid the ABENDED replicat process on production server?
    4.how to track the ABENDED process in production server?
    Please HELP:(
    Edited by: NaveenK on Aug 29, 2012 3:32 AMHi Naveen. SQL Error 1403 means row not found. Your data is out of sync and you should fix this.
    By doing begin now when this happens, you are skipping all the transactions that were "in-line" since the process ABENDED.
    You have more than one way to deal with these things, first of all you should synchronize your data! This should get rid of the 1403 errors.
    Then you can write rules using REPERROR to tell the replicat how to behave in case of errors should come up.
    Using logdump, you can read the exact row which failed and find out the next RBA to skip that specific one if required. You should also configure a DISCARDFILE to get details about errors when they happen.
    Greetings,
    N K

  • How to process Fisacl year change for Investment Management with Project?

    How to process Fisacl year change for Investment Management with Project as measure

    hi
    check this menu path
    Accounting  --> Investment Management  --> Programs  --> Periodic Processing  --> Fiscal Year Change

  • How to make a quick checkbox change work in a table?

    Hello,
    I have an af:table with some columns. In one column I specified a checkbox.
    If I check or uncheck the checkbox for each record, the corresponding request is sent to the server and the checkbox change persists when the server has answered to the request.
    However if I check many records too quickly during the period of one request, the checkings other than the first one which fired the request are not automatically enqueued and persisted: that is, the checkbox of those components changes their selection to the new value as soon as the click is intercepted and changes their selection back again to the old value when the first request has ended
    Is there a way to "quickly" allow checkbox selections? I have tried to set "autosubmit=true" and "immediate=true" to both the table and the checkbox component, but this does not seem to solve the problem.

    we have done something similar to this in a table. .but guess its the same with the tree table.
    <af:table value="#{bindings.S.collectionModel}"
                            var="row" rows="#{bindings.S.rangeSize}"
                            emptyText="#{bindings.S.viewable ? 'No data to display.' : 'Access Denied.'}"
                            fetchSize="#{bindings.S.rangeSize}"
                            rowBandingInterval="0"
                            styleClass="AFStretchWidth" columnStretching="column:c3"
                            partialTriggers=":::search"
                            id="t4" selectionListener="#{bindings.S.collectionModel.makeCurrent}"
                            selectedRowKeys="#{bindings.S.collectionModel.selectedRow}">
                    <af:column width="15"
                               inlineStyle="#{row.Selected eq 'true'?'background-color:#9CACC9;':''}">
                              <af:selectBooleanCheckbox text=""
                                                        label="" id="sbc4"
                                                        value="#{row.Selected}"/>
                            </af:column>1) Have SelectionListener and SelectedRowkeys
    2) Donot have rowSelection
    3) have a transient attribute from ur VO called 'selected' (String type)
    4) in the button that you have - process the selection from the 'Selected' attribute

  • How to hide/unhide the all Treenodes on Treeview based on Checkbox changed event in Sharepoint custom webpart Sitecollections

    How to  hide/unhide the all Treenodes on Treeview based on Checkbox changed event?
    Checkbox(Control)
    1.Checkbox Checked:(Action below like)
     if user click on  Checkbox, all the treenodes on treeview is hide.
    2.Checkbox Unchecked(Action below like)
    If user uncheck the Checkbox  all the treenodes on treeview is unhode.
    Could you please help me how to do above one.
    Badri

    Hi,
    According to your post, my understanding is that you want to hide/show the TreeView when the Checkbox checked/unchecked.
    We can use jQuery to achieve it, the following script for your reference:
    <script src="http://code.jquery.com/jquery-1.10.2.min.js" type="text/javascript"></script>
    <script type="text/javascript">
    $(function () {
    $("input[type=checkbox]").click(function () {
    if (this.checked) {
    $("#TreeViewID").hide();
    } else {
    $("#TreeViewID").show();
    </script>
    More information:
    http://dineshsharepoint.blogspot.com/
    Best Regards
    Dennis Guo
    TechNet Community Support

  • I am in the process of changing Iphones, I have synced everything from my old phone, how do i transfer it to the new phone??, I am in the process of changing Iphones, I have synced everything from my old phone, how do i transfer it to the new phone??

    I am in the process of changing phones. I have synced all the information off my old phone onto itunes, i now wont to get this information onto my new phone, how do i do this??

    Follow the directions here, this document even tells you what to do with your old phone:
    http://support.apple.com/kb/ht2109

  • How to update collection when checkbox changed in report

    I have a report based on a collection:
    select seq_id
           ,c001
           ,c002
           ,apex_item.checkbox(1,seq_id,decode(c003,'J','CHECKED','UNCHECKED')) selected
    from apex_collections
    where collection_name='CONCOLLECTION'When the checkbox changes I want to store the new checked/unchecked status in the collection.
    Steps towards a solution I've come up with:
    1 Create a dynamic action: Change, jquery selector : input[name="f01"]
    2 Create javascript to store value (=seq_id) of changed item into a hidden page item.
    3 plsql code to update collection member with seq_id that is now in hidden item.
    Is this the way to do it?
    If so, it's the javascript of step 2 that I can't figure out.
    thanks, René

    thanks this works.
    Using javascript I store the seq_id and the checked value in 2 page items
    $s('P70_SEQ_ID', $(this.triggeringElement).val() );
    $s('P70_CHECKED', $(this.triggeringElement.checked).val() );The checked value I get is <empty> when checked and 'undefined' when unchecked. Based on this I can now update the collection.
    declare
      l_selectie varchar2(1);
    begin
      if v('P70_CHECKED')='undefined'
      then
        l_selectie := 'N';
      else
        l_selectie := 'J';
      end if;
      apex_collection.update_member_attribute(p_collection_name => 'CONCOLLECTION'
                                                 ,p_seq             => v('P70_SEQ_ID')
                                                 ,p_attr_number     => 3
                                                 ,p_attr_value      => l_selectie);
    end;

  • How to process momentary MIDI CC in Environment ?

    I'm sending MIDI CC messages into the Logic Environment to control various things (it's a complicated mess of cable switchers, transformers, etc).
    When my input is a toggling MIDI CC message (127 for ON, 0 for OFF), everything is working just fine... I process the MIDI input, transform it and route it... all good.
    But I'd like to swap for a MIDI controller that sends momentary MIDI CC messages only (pressing a button generates a 127 immediately followed by a 0), and I can't figure out how to process that in the Logic environment. What I need seems so simple: I want an Environment button to toggle its state between ON and OFF every time it receives the same CC message, but I haven't found a way. Any suggestions ?
    Thanks!
    James

    Hey, iS,
    I'm using the Environment for live MIDI control, via a Rocktron All Access footpedal.
    Since some of the functions I want to control are conceptually momentary, I thought it would work best to configure the MIDI pedals buttons as momentary (the Rocktron box gives a choice), and I was struggling to get Logic to process the info that way. And I ultimately stumbled across the same solution you suggested (discard zeroes, bang the fader, etc.)
    But I ultimately scrapped the whole thing when I found out that with the Rocktron buttons configured as momentary, turns out they receive data that way, too, which makes it impossible to have Logic configure the state of the Rocktron button lights. (i.e. I wanted to be able to change patches on the Rocktron and have Logic update the lights on the footswitch. Doing that requires the Rocktron buttons to be latching, since if they're momentary, a value of 127 just toggles the lights, so it's impossible to use Logic to reset the lights to a known configuration)
    So I went back to the latching config for the Rocktron buttons, and found I could still handle functions like tap-tempo, where you want a button to do the same thing every time it's pressed: just use Logic to send an off message after receiving an on message... works great.
    Oh, and once my Environment got huge, I ran into the cable-limit... fun, fun, fun! Took a while, but I cleaned up the logic to simplify things enough to stay under the limit. Frustrating, though!
    Thanks for the advice, iS!
    James

  • How do I properly change a Mac's name?

    My laptop (a MacBook with Tiger) was assigned a name when I first activated it. I am using it as an airport router (using a mobile broadband system, via a "modem" connected to the laptop to access the internet) with two iMacs. One of the iMacs has the same name as the laptop. I found I had problems with the airport network, because of the common name.
    I changed the name of the laptop, using Sharing in Preferences to "Eric's Laptop". However, the name seen by the airport connection on both iMac's remains as it originally was, and I continue to have problems with the airport network.
    How do I properly change the name of the laptop so its network name is, indeed, changed?

    Thank you Baby Boomer, Texas Mac Man, and Neville Hillyer. I have taken those actions, now several times. They have not changed the laptop's name, _as seen_ on the AirPort drop-down on the right of my iMac menu bar, and the problem continues.
    When I first bought and activated the laptop and used it for this purpose, I ran into this same problem. After hours of frustration, since the laptop was still under warranty, I called Apple Service, and a helpful and knowledgeable support technician walked me through a very different and simple process that did change the name as seen by the other computers on the AirPort network. At that time, I asked why that information was not available anywhere for Mac customers, and he did not know. I (obviously) do not remember what that process was.

  • How to restrict manual change to exchange rate.

    Hello
    Requirement:
    Our requirement is we want to control the manual exchange rate entry(user type or otherwise) at different form e.g. AP Invoice screen,AR Invoice,GL JV.
    What ever the rate defined pops up,should only be used for transactions and no scope should be given to user to change the rate.
    Process:
    Our process is that We have a boundary system and we manually enter the rates daily and upload to Oracle Application by running a program interfaced with the boundary system.The rates fetched from the boundary system sits in daily rate form as spot rate.
    The profile option "AR: Default Exchange Rate Type" has value "spot".
    Similarly in payable option the rate given as "spot".
    Solution provided by our consultant:
    We have Below clarification from the consultant Oracle team on controlling who can enter exchange rates manually vs who can not.
    Pls see response for both sub ledger and general ledger transactions. An ability to limit manual exchange rate entry & view is, therefore, available in Oracle.
    In Oracle, the transactions are created in subledgers and manual journals are created in General Ledger.The defaulting of exchange rate type is done separately for different subledgers. For General Ledger (creating manual journals) the control is separate.
    1)For transactions originating in subledgers , for eg.Accounts Receivable, the name of the profile option is "AR: Default Exchange Rate Type" and looking at your requirement, this should be set at "Corporate" and not "User" or "Spot". Setting it at Corporate, will make the application look at the predefined corporate rates. Similarly for transactions (invoices/payments) in Accounts Payable, the defaulting can be configured through payable options.
    2)For manual journals , the defaulting of exchange rate type is controlled separately. This can also be secured by definition access set which will prevent unauthorized changes to rate type.
    Questions:
    1.Can we take their suggest given our process that changing the rate to corporate will restrict manual intervention of the user.
    2.whether definition access set feature available in 11.5.10.2 and if so how can we configure.
    3.What is the best way to restrict user from manual intervention.

    Hello.
    For the mentioned forms, you can use Forms Personalization to force users to use a certain type(s) of exchange rate.
    Octavio

  • How to prevent PO changes in ME22N after Order acknowledgement?

    Hi everyone,
            Can anyone tell me how to prevent PO changes (ANY) in ME22N after Order acknowledgement?
            I would like to make it possible without release strategy process or authorizations.
            Do you know some User Exit or Customazing way?
    Regards.
    Jaime S.

    Dear Jaime S,
    You can do this by restricting in authorization SHDO and also by marking "changes not possible after release" in Release strategy procedure.
    And also you can navigate the menu to, SPRO------>IMG------>Material Management--->Purchasing(OLME)------->Purchase Order---->Define screen Layouts at Document Level---->And go to ME22n And Select the right parameter and in this you can make it display, optional or required entry for the fields.
    Regards,
    Manjunath B L

  • URGENT - HOW TO PROCESS A BDC SESSION (IN BACKGROUND) FROM INSIDE A REPORT

    Hi All,
    I have a requirement wherein I need to create a BDC session for mass update(from file) of one transaction and check if at all that update has taken place and proceed with the same session for another transaction.
    For this I need to know how to process the session in background in a report, so that if the processing is done, the next set of data to update a different transaction can happen.
    All inputs are welcome and highly valuable to me.
    If someone is unable to intrepret this, I'll detail it again.
    Thanks in advance,
    Vaishnavi Varadarajan

    Hi,
    1.Use RSBDCDRU is an exe pg.With this u can download the logs into local file.
    2.It will create the spool request .from there u can download or print.
    OtherWise:
    Use the code from the link below. U need to provide the session queue id as input and it will download the log to an excel file. U can change it to  ur reqmt.
    Re: BDC
    regards
    kiran

Maybe you are looking for