How to make checkbox checked by default

hi,
i have created a checkbox and binded the 'Checked' property of the checkbox to a attribute of type WDY_BOOLEAN. I have set the attibute value to 'True' in my code. but this s not working. Pls can anybody tel me where i have went wrong ?
    DATA lo_nd_check_box TYPE REF TO if_wd_context_node.
     DATA lo_el_check_box TYPE REF TO if_wd_context_element.
     DATA ls_check_box TYPE wd_this->element_check_box.
     lo_nd_check_box = wd_context->get_child_node( name =
wd_this->wdctx_check_box ).
     lo_el_check_box = lo_nd_check_box->get_element( ).
   get all declared attributes
     lo_el_check_box->set_attribute(
       EXPORTING
         name = 'text'
         value = 'true' ).
thanks,
aishwarya.

Hi,
Please try with the below code hope it helps.
                   DATA lo_nd_inp_sflight TYPE REF TO if_wd_context_node.
                   DATA lo_el_inp_sflight TYPE REF TO if_wd_context_element.
                   DATA ls_inp_sflight TYPE wd_this->element_inp_sflight.
                   DATA lv_chkgrp LIKE ls_inp_sflight-chkgrp.
                 navigate from <CONTEXT> to <INP_SFLIGHT> via lead selection
                   lo_nd_inp_sflight = wd_context->get_child_node( name = wd_this->wdctx_inp_sflight ).
                 get element via lead selection
                   lo_el_inp_sflight = lo_nd_inp_sflight->get_element(  ).
                 get single attribute
                   lo_el_inp_sflight->set_attribute(
                     EXPORTING
                       name =  `CHKGRP`
                       value = abap_true ).
Regards,
Basuvaraj.P

Similar Messages

  • To make a checkbox checked by default

    hi all,
    I am using struts framework
    and I am using the below line for creating a checkbox
    <html:checkbox property="name" value="Y" /></td>
    How can I make the checkbox checked by default
    thanks

    set value="something" in ur jsp
    then in 2 ways u can set default values
    1--- by setting that value in formbean
    2--- by using setProperty() method in ur action
    if that value matchs... then corresponding controll set defualt

  • How to Make Variant as a default?

    Hi,
          How  to  make  Variants as a  default variant  for  reports  like  Layouts?     
      and   how to make  Scope  of list   :     ALV -> grid control  as  default  in ME55 ( Collective release of Purchase requisitions )
    like ME28 ( Release Purchase Documents ) .   We have   scope of  list  is ALV  as  default  in ME28.
      Thanks  in  Advance.
    Regards,
    Aruna.

    Check
    Variant as default

  • How to make data sorted by default by key figure?

    hi experts,
    how to make data sorted by default by key figure?

    Hi ,
    Try to make the selections for the filter of the query..
    Check this link ..
    http://help.sap.com/saphelp_nw70/helpdata/en/f1/0a5625e09411d2acb90000e829fbfe/frameset.htm
    Regards,
    Shikha

  • How to make Adobe as your default viewer for all your PDF file instead of the Preview given? Thanks

    How to make Adobe as your default viewer for all your PDF file instead of the Preview given? Thanks

    you need to "Get Info" on the file first. Select it, right click and select 'Get Info' in the menu.
    In the window that pops up, near the bottom, the "Open With" drop down menu needs changed. If the drop down menu does not present the one you want, select "Other" and find it.

  • How to make the current value default programmatically

    How to make the current value default programmatically

    Open a VI reference to the desired VI and use invoke mode with method: "Make current values default".
    The VI cannot be running, so you need to set it from a different VI. (It also means, it cannot set itself.)
    LabVIEW Champion . Do more with less code and in less time .

  • How to make checkbox uneditable

    I have a problem about how to make checkbox uneditable.
    1. the checkbox DO not respond to user mouse click
    2. and the text company with checkbox is not greyed.
    setenable is not i wanted, because 2 is not satisfied
    thanks in advanced.

    If I understand the question, then my replies in this thread should help you out:
    http://forum.java.sun.com/thread.jsp?forum=57&thread=122112

  • How I make "dreamweaver mx 2004" default program

    How I make "dreamweaver mx 2004" default program that opens
    files such as .php, .htm, .asp etc ? default currently is
    "dreamweaver mx" ...

    In Windows.
    This can be done in any Windows Explorer panel or from the
    Control Panel..
    Open any folder in Windows, Click Tools/Folder Options then
    the File Types
    tab. Find the file type you want to change and change it...
    If you're using a Mac... don't know.
    "lse987" <[email protected]> wrote in
    message
    news:eifmsi$33u$[email protected]..
    > "If Windows, CONTROL PANEL, FOLDER OPTIONS,
    > On the File Types tab,"
    >
    > this in dreamweaver mx 2004 or in .... ? Be more clear

  • How to make a checkbox checked by default in payment method table in APsuppliers

    I need to make the first checkbox in the payment method table(row name: check)  to be checked by default... Any suggestion are welcome...

    set value="something" in ur jsp
    then in 2 ways u can set default values
    1--- by setting that value in formbean
    2--- by using setProperty() method in ur action
    if that value matchs... then corresponding controll set defualt

  • Copy : Make the "Apply to all" checkbox checked by default

    Hi,
    Does someone know a way to make the checkbox "Apply to all" checked by default, in the window that appears when you want to replace files in a folder?
    thanks

    Nope. Can't be done with OS X tools. Maybe a 3rd-party thingy, but I don't know of any.

  • How to make checkbox field inactive in the output of ALV report.

    Dear All,
    I am having one ALV report in whose output there are checkboxes against each record. Example: the output columns of my ALV report are:
    Checkbox, Sales Document No, Billing Document No.
    Now, my requirement is that if for the Sales Document No there exists any Billing Document No in the output then the Checkbox should be inactive but if the Billing document coloumn is empty for a particular Sales Document No then only the Checkbox field should become active.
    Kindly guide me on how to make this checkbox field inactive.
    Waiting for your reply.
    Warm Regards,
    N.Jain

    Hello,
    Follow the below steps:
    1.Define as--> GS_STATUS TYPE SLIS_STATUS,
    2.check layout check box fieldname is not initial.
          then set the status according to your logical conditions
          GS_STATUS-FLG_CHECKBOXES_ACTIVE = 'X'
    Hope this would help you.
    Let me know your feedback.
    Regards,
    Raju

  • How to make checkbox to be pre-selected in ALV

    Hi all!
    I`m creating ALV report and I want to create checkbox in the first column of the row. So I have a field SEL(1) in my structure and I`ve made the fieldcat:
    gs_fcat-col_pos = 5.
      gs_fcat-coltext = 'Check'.
      gs_fcat-fieldname = 'SEL'.
      gs_fcat-tabname = 'GT_TREE9001'.
      gs_fcat-outputlen = 10.
      gs_fcat-checkbox = 'X'.
      gs_fcat-edit = 'X'.
    That works, checkbox is displayed.
    But now I need to make all the checkboxes to be checked for the first start of my program.
    I mean when user executes my report all the checkboxes must be checked by default.
    I have tried to do following:
    loop at gt_tree9001.
    gs_tree9001-sel = 'X'.
    modify gt_tree9001 from gs_tree9001.
    endloop.
    But it doesnt work, I now see checkbox and mark 'X' near but not the checked ckeckbox.
    Any help appreciated!

    Solved.
    My final code:
    data: lv_tree_size TYPE i,
                ls_layout_item TYPE lvc_s_laci,
                lt_layout_item TYPE lvc_t_laci,
                lv_ind TYPE LVC_INDEX.
          CLEAR ls_layout_item.
          ls_layout_item-fieldname = 'SEL'.
          ls_layout_item-class = cl_gui_column_tree=>item_class_checkbox.
          ls_layout_item-editable = 'X'.
          ls_layout_item-u_class = 'X'.
          ls_layout_item-u_editable = 'X'.
          ls_layout_item-u_chosen = 'X'.
          ls_layout_item-chosen = 'X'.
          append ls_layout_item to lt_layout_item.
    call method g_tree9001->set_table_for_first_display
          EXPORTING
            i_save              = 'A'
            is_variant          = ls_variant
          CHANGING
            it_sort             = gt_sort9001
            it_outtab           = gt_tree9001
            it_fieldcatalog     = gt_treefcat9001.
    DESCRIBE TABLE gt_tree9001 LINES lv_tree_size.
    DO lv_tree_size TIMES.
            CALL METHOD G_TREE9001->CHANGE_LAYOUT
              EXPORTING
                I_OUTTAB_INDEX = sy-index
                IT_ITEM_LAYOUT = lt_layout_item                .
    ENDDO.
    The main trick is in u_class, u_editable, u_chosen. These params say that layout should be changed. Only this way it will work.
    And some helpful links:
    ALV tree get selected checkbox
    Checkbox ALV Tree CL_GUI_ALV_TREE
    ALV TREE-Checkbox
    CL_GUI_ALV_TREE and Checkboxes
    Report BCALV_TREE_ITEMLAYOUT is also very helpful.

  • How to change a check box default from checked to unchecked?

    Hi All,
    I have a form, want to change a check box default from checked to unchecked.
    from the layout, doulb click into property of this check box, did not see default setting for the box, where to change a check box default from checked to unchecked?
    Thanks.

    hello friend,
    ->go to the property palette of ur check box
    ->under the functional set the property "check box mapping of other values"=unchecked
    so...when u run the form then checkbox will unchecked.
    but..at design time u can't see the effect of unchecked..
    Regards
    Chandan

  • How to obtain checkbox checked/unchecked  while editing

    Hi All,
    My scenorio is,
    I have a form and on that form i have text field & checkbox.
    I am saving record by entering some value in text box & checking checkbox(if my checkbox checked then I am saving "Y" for that checkbox in DataBase).Its saving both things properly in databse.
    While editing , If i click on edit link , my text box value coming properly(i.e. value which I stored in databse. )
    But that checkbox is not coming in checked mode(i.e while saving I have checked checkbox)
    So how to obtain checkbox at the time of editing checked/unchecked as they were at the time of saving ?
    Thanks
    Sandip

    Hi,
    Thanks for your reply.
    Sorry my variable is userAdmin.
    I have getUserAdmin() method in the C.java(server side pojo )?
    But its return type is String.(return type String because I want to save "Y / N") while saving
    public class C{   // server side pojo
    private String userAdmin; // corresponding getter & setter
    lly, I have getUserAdmin() method in cleint side pojo
    public class B{ // client side pojo
    private boolean userAdmin; // corresponding getter & setter
    but while saving I am doing as,
    public class SaveClass
    public String saveMethod()
    C c = new C();
    B bb = new B();
    if (bb.getUserAdmin() == Boolean.TRUE)
    c.setUserAdmin("Y");
    else
    c.setUserAdmin("N");
    // in client side pojo userAdmin variable's return type is boolean for checking as,
    if (bb.getUserAdmin() == Boolean.TRUE)
    but on server side its String for saving "Y / N",
    if (bb.getUserAdmin() == Boolean.TRUE)
    aa.setUserAdmin("Y"); /// to save String here
    So if I write in JSP,
    <h:selectBooleanCheckbox value="#{BeanName.c.userAdmin}"/>
    its giving error as,
    javax.servlet.ServletException: Expected submitted value of type Boolean for Component : {Component-Path :.................                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • How to make a button as Default

    Hi All,
    How can we make a button as default action. like, if i have a add button in the view and Whenever the user hits the enter key, the add buttons event should be fired. which fires the action assigned to the add button's event.
    Thanks for your time.
    - Raghavendra

    Hello Raghavendra,
    it is not possible to implement exactly scenario you described. But you can use following workaround:
    1) Set button design as "emphasized" (Optional)
    2) Call requestFocus for this button in wdDoModifyView for first time.
    if (firstTime) {
             final IWDButton button = (IWDButton)view.getElement("<ID_OF_BUTTON>");
             button.requestFocus();
    3) Assign the same action as for button to every inputfield.onEnter event.
    final IWDAction onAction  = wdThis.wdGet<ACTION_NAME>Action();
    //...get element
    ((IWDInputField)element).setOnEnter(onAction);
    Best regards, Maksim Rashchynski.

Maybe you are looking for

  • Using a second Mac as a display for a first

    Disclaimer: Apple does not necessarily endorse any suggestions, solutions, or third-party software products that may be mentioned in the topic below. Apple encourages you to first seek a solution at Apple Support. The following links are provided as

  • Selecting from which accout I want to send mail from

    On my 17" powerBook, when I go into mail and want to compose a new mail, in the header it gives me a drop down menu to select from which mail account I want to send the mail from. Now on my desktop G5, that DropDown menu is no where to be seen. I can

  • How to transfer mail.app to new MBP?

    Is there a way I can transfer my Mail.app settings and messages to my new MBP without having to migrate all of my data to the new machine? Looking fwd to your responses.

  • BAPI vsRFC in web dynpro

    Hi, can you pls tell me what's the difference in using a BAPI or an RFC function module to retrieve or update data in Web Dynpro? Should I prefer one or an other? Regards,     Anita

  • Embedding Iweb page into Craigslist using mobile me link?

    I would like to embed an iweb page or and ad creating in Pages into a craigslist post. How can I do this so it looks like a nicely formatted webpage in my craigslist posting? I