How to set a default pre-select for radio buttons?

Hi
I have some text form fields that I've set up to display some paired variables stored in a .txt file.  When the swf loads, the form fields are populated with the text.
I've also set it up so that if you change the text and hit a submit button, the .txt file gets updated.
I'm now tryng to set it up so that I can store radio button selections in the .txt file too.
I've started doing it a certain way, but am wondering if there is a more straightforward way of doing ?
Here's what I've done...
I've set up the butttons to spit out "on" or "off" depending on the selection, and apply that to the variable that gets stored.
Now, in the same way I loaded the variables into the text form fields when the swf is refreshed, I want to load the on/off variable, and then somehow apply it to the radio buttons so that one of them is pre-selected.
So my questions are a) how do I take that loaded variable, and use an if statement to make it pre-select the button, and b) is there a simpler way to pre-select a button based on an external variable?
Thanks
Shaun

Nevermind guys - I did it using the 'rb_on.selected' command on the "on" radio button if the .txt file variable was "on", else the "off" radio button is selected.
Thanks for taking a look though!
Shaun

Similar Messages

  • How to check the default checked  value for radio button on jsp for struts

    Hello , I just want to check the default checked value in JSP for a radio button, how can i do that?
    <html:radio property="sale" value="permanent" style="vertical-align: middle;">Permanent</html:radio>
    <html:radio property="sale" value="temporary" style="vertical-align: middle;">Temporary</html:radio>

    you can set the default value for property ( which you want to default selected when the form is first loaded) in reset method of the form.
    <html:radio property="sale" value="permanent" style="vertical-align: middle;">Permanent</html:radio>
    <html:radio property="sale" value="temporary" style="vertical-align: middle;">Temporary</html:radio>
    In the above case you can write the code as follows in the perticular form of this jsp.
    public void reset(ActionMapping mapping, HttpServletRequest request) {
    super.reset(mapping, request);
         sale = "permanent";
    This will show the first check box default selected when the first time the page is loaded.

  • How to set the default settment rule for the same kind project.

    hi experts:
       the project of the same kind of the project profile have the same settment rule to one account (G/L).
    how to set the default settment rule for the project of  this kind of the project profile.
    regards

    Hi,
      You need to define the settlement profile and allocation structure.
    next you need to define the  Strategy for settlement rule.
    navigation-PS> costs> automatic and periodic allocations> settlement> Settlement rule for WBS
    --> Define strategy for settlement rule.
    Select the strategy and click on settings. in that new entries, check the Acc Assg element, enter Settlement profile and mention accass category as reposnsible cost center.
    Save this transaction.
    Now create a project assgin responsible costcenter for the WBS element in the project buider and save the transaction.
    Now run CJB2 transaction for the project, settlement rule will generated automatically.
    even you can configure the same for profitability segment.
    Rgds
    Sudhir Reddy

  • How to Set A Default Start Time For New Events In Calendar?

    How to Set A Default Start Time For New Events In Calendar?

    John,
    Thanks for that suggestion - could not get it to work. However, I did manage a different approach. I finally determined the sequence of events in terms of how the various events and listeners fire (I think).
    Basically, the CalendarActivityListener fires, followed by the listener associated with the Calendar object's Create facet, followed finally by the CalendarEventListener - the final is where the TriggerEvent is available and then finally, control is passed to the popup/dialog in the Create facet. So, my approach of trying to set/get the TriggerDate in the user's HTTP session was doomed to failure because it was being get before it had been set :(
    Anyway, I ended up adding a bit of code to the CalendarEvent listener - it grabs the current BindingContext, navigates through the DCBindingContainer to derive an Iterator for the ViewObject which drives the calendar and then grabs the currently active row. I then do a few tests to make sure we're working with a "new" row because I don't want to alter start & end dates associated with an existing calendar entry and then I define the Start and End dates to be the Trigger Date.
    Works just fine. Snippet from the listener follows
    BindingContext bindingContext = BindingContext.getCurrent();+
    *if ( bindingContext != null )    {*+
    DCBindingContainer dcBindings = (DCBindingContainer) bindingContext.getCurrentBindingsEntry();+
    DCIteratorBinding iterator = dcBindings.findIteratorBinding("EventsView1Iterator");+
    Row currentRow = iterator.getCurrentRow();+
    if ( currentRow.getAttribute("StartDate") == null)+
    currentRow.setAttribute("StartDate", calendarEvent.getTriggerDate());+
    if (currentRow.getAttribute("EndDate")==null)+
    currentRow.setAttribute("EndDate", calendarEvent.getTriggerDate());+
    *}*

  • How to set a default colour & thickness  for rectangle in preview?

    How to set a default colour & thickness for rectangle(annotation) in preview ? Because every time that I choose for example red and thickness 1 it reverts to orange and 3 next time .

    Doesn't appear to be a default setting. Peruse the webpage for Secrets at http://secrets.blacktree.com/ for a possible setting.

  • How to set a default Billing type for a particular Delivery type

    Dear All,
    How to set a default billing type for a particular delivery type.
    My requirement is, we are creating delivery for a Stock Transport Order. Delivery type is NL and the Purchase order type is UB.
    When we are creating Billing, it should take Billing type "ZSTO" by default, which is the customised Billing type.
    Where we have to do this setting?
    In case of normal sales order, this control will be available in the Sales order document types.
    In case STO, how to set a default billing type for a delivery type (NL).
    Regards,
    Rajesh

    There is a customization available here no default or hard coded
    Normally in a sales doc type we mention which billing type system has to pick
    If the billing happens from a PO which billing type system will take depends on the controls set in the areas mentioned below
    Go to your delivery type OVLK (say your delivery type is NL)
    In that there is a field called default order qty in the order reference tab (say if you maintained DL there)
    This DL is called PSEUDO order type
    Then in VOV8 for DL based on the billing types mentioned ,system will take the billing doc
    For delivery related billing say if you mention say ZF8 in the details of DL in VOV8(provided you have created ZF8)
    Then while you bill the delivery doc of NL system will take ZF8
    For intercompany delivery you can create ZIV billing type also Pure customization
    PO is linked to delivery type ( MM spro settings)--Del type linked to order (pseudo) type---in order type (pseudo) we mention the billing types. Here the flow is bit different that pure SD flow
    Though the invoice is crated by manually putting customized Biiling Type and A/Cing doc also generated, but in the VF04 still system shows the same deliveries pending with Billing Type (F2).
    This manual is not reqd if the said assignments are done properly
    Hope it can assist you.
    Thanks & Regards
    JP
    Edited by: J Prakash on Jun 23, 2010 4:05 PM

  • How to set the default context value for flexfield in OAFramework pages

    Hi,
    I have a page which contains a contexxt value field i.e Flexfields
    To select the context value we have to select the value from drop down
    So Here we want to display the context value immediately when the page is called
    How to set the default valu in this case
    Regards,
    Krishna

    You can set the Attribute category view attribute to the Flexfield context value and call prepareforRendering in the flex bean. Check the dev guide for details.
    Regards
    Sumit

  • How to set the default maximum size for java's heap?

    Hi!
    Im trying to set the default max size for the java heap - but not from the command line.
    I would like to set it higher as default on my computer.. how can I do that?
    thanks!

    >
    ...You may increase the memory heap only when you're launching a new JVM.>Much like IWantToBeBig does.
    OTOH, it this is an app. with a GUI, it is easier to launch it using webstart, and request extra memory in the JNLP descriptor (the webstart launch file).

  • How to set different default interactive reports for different user groups?

    I'm probably overlooking an obvious solution, but how do I set different default interactive report for different user groups?
    For the same interactive report, I want one set of users to see a default where the default filter is based on column X. However, another group of users doesn't have authorization to see that column so I need to set the default filter to something else for them.
    Thanks

    You can set a filter on a report in a URL - would that help? I think with apex 4.x you can also link to a saved default report or alternative report...

  • How to set a default output device for FAX outputs

    Hi Experts,
    Business requires to set a default output device for fax outputs ( Medium as 2 Fax medium ).
    as fas as print output ( medium as 1 print medium ) is considered we can maintain output device in condition record--> communication
    I tried maintaining output device in VP01 for my condition type based on sales org but it did not worked.
    Can you please suggest ways to achieve default output device for fax outputs.
    Thanks,

    Well, obvious solution would be to either update user profiles or change the output from 'process immediately' to 'process by a background job'. Then create a generic user ID with any fax number desired and use that user ID to process the output through the background job.
    This is not really an SD question, so if this simple option doesn't work for you, I'd suggest to discuss other custom solution with your ABAP / Basis team.

  • How to set a default value of " " for a VARCHAR2 in ER diagram?

    Hi,
    I am trying to set the default value of a VARCHAR2 attribute to " " (space) in an ER diagram. But it just thinks I don't want anything for the default value. If I specify CHR(32) will it work? or is there another way? Will I have to wait until I get into the server model to do this, if so how do I do it there?
    thx
    adam

    Are you sure you want the default to be a space, not a NULL? VARCHAR2 fields want to trim spaces from the right, which makes them NULL if they started as all spaces. You can force them to accept spaces, but it is an unnatural condition. Even the VARCHAR2 columns that I use as surrogates for booleans I set as 'Y' for true and 'N' for false, or 'T' for true and 'F' for false. Occasionally, it will be 'X' for selected and NULL for not selected, but the NULLs tend to cause trouble so I avoid them.
    Okay, let's assume that you have a good reason to default to a space. Use ' ', including the single quotes. When you transform to a Table Definition, change the Default Value Type for the column to a Database Function Call. You can't do that in the logical (Entity/Attribute) design, only in the physical (Table/Column). That will make sure that the Server generator will leave it the way you wrote it.

  • How to set the default web site for WGM users

    Hi,
    In Tiger server there was a place to input the URL of the default web page for all browsers when users logged into network home folders. This was really helpful and saved a bunch of bandwidth and class time. Is there any way to do this in Leopard server? If so, please point me in the right direction.
    Thanks,
    ..Tom

    Antonio, Thanks! That seems to have worked for Safari. However, we like Firefox too, and I tried to set that up the same way, but was told "can't find a manifest for that app". I wonder if I can copy the Safari list then alter and rename it?
    ...Tom

  • How to set the default value filters for navigational block in WAD.

    Hi Experts.
    as per the customer requirement . they have bex report we need to convert in to web. but in the bex for one field  they using default filters but am not aware in the WEB reports.
    Please anyone suggest me how to give the default filter values in the navigation block in WAD.
    Thanks
    Ashok

    Hi,
    In the Properties of the Navigation Block pane. Goto WebItem-- Goto List of Characteristics, in that click list it will pop up new window, there enter the required objects wants to be in the default filter area.
    Hope it hleps you.
    Veerendra.

  • How to set the default file name for upload

    Hi All,
    I have the following BSP app for a file upload of a csv file. I want the page when displayed show the default file name to be loaded as c:\db1\currentPM.csv
    What changes do I need to make to get the default file name in the BSP app.
    Thanks
    Karen
    <%@page language="abap" %>
    <%@extension name="htmlb" prefix="htmlb" %>
    <htmlb:content id               = "content"
                   design           = "classicdesign2002design2003"
                   controlRendering = "sap"
                   rtlAutoSwitch    = "true" >
      <htmlb:page title="File Upload " >
        <htmlb:form method       = "post"
                    encodingType = "multipart/form-data">
              <htmlb:textView text   = "File:"
                              design = "STANDARD" />
              <htmlb:fileUpload id          = "uploadID"
                                onUpload    = "UploadFile"
                                upload_text ="Upload"/>
        </htmlb:form>
      </htmlb:page>
    </htmlb:content>
    On Input Processing
    event handler for checking and processing user input and
    for defining navigation
    DATA: EVENT TYPE REF TO IF_HTMLB_DATA,
          DATA TYPE REF TO CL_HTMLB_FILEUPLOAD,
          LV_OUTPUT_LENGTH TYPE I,
          LV_TEXT_BUFFER TYPE STRING,
          FILE_NAME TYPE STRING,
          FILE_PATH TYPE STRING ,
          INTERN TYPE TABLE OF  ZALSMEX_TABLINE.
    DATA: LT_BINARY_TAB TYPE TABLE OF SDOKCNTBIN .
    TYPES: BEGIN OF TY_TAB,
           FIELD1(2) TYPE C,
           FIELD2(2) TYPE C,
           FIELD3(2) TYPE C,
           FIELD4(2) TYPE C,
           FIELD5(2) TYPE C,
           END OF TY_TAB.
    DATA:  WA_TAB TYPE TY_TAB,
           IT_TAB TYPE TABLE OF TY_TAB.
    TYPES: BEGIN OF TY_LINE,
              LINE(255) TYPE C,
           END OF TY_LINE.
    DATA:  WA_LINE TYPE TY_LINE,
           IT_LINE TYPE TABLE OF TY_LINE.
    EVENT = CL_HTMLB_MANAGER=>GET_EVENT_EX( REQUEST ).
    IF EVENT IS NOT INITIAL AND EVENT->EVENT_NAME = HTMLB_EVENTS=>FILEUPLOAD.
      DATA ?= CL_HTMLB_MANAGER=>GET_DATA( REQUEST = RUNTIME->SERVER->REQUEST NAME = 'fileUpload' ID = 'uploadID' ).
      FILE_NAME = DATA->FILE_NAME.
      FILE_PATH = FILE_NAME.
      IF DATA IS NOT INITIAL.
        CALL FUNCTION'SCMS_XSTRING_TO_BINARY'
         EXPORTING BUFFER = DATA->FILE_CONTENT
         IMPORTING OUTPUT_LENGTH = LV_OUTPUT_LENGTH
         TABLES BINARY_TAB = LT_BINARY_TAB .
        CALL FUNCTION'SCMS_BINARY_TO_STRING'
        EXPORTING INPUT_LENGTH = LV_OUTPUT_LENGTH
         IMPORTING TEXT_BUFFER = LV_TEXT_BUFFER
         TABLES
         BINARY_TAB = LT_BINARY_TAB.
        IF SY-SUBRC = 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
        SPLIT LV_TEXT_BUFFER AT CL_ABAP_CHAR_UTILITIES=>CR_LF INTO TABLE IT_LINE.
        IF SY-SUBRC = 0.
          LOOP AT IT_LINE INTO WA_LINE.
           SPLIT WA_LINE AT CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB
            split wa_line at ','
            INTO WA_TAB-FIELD1 WA_TAB-FIELD2 WA_TAB-FIELD3 WA_TAB-FIELD4 WA_TAB-FIELD5.
            append wa_tab to it_tab.
          ENDLOOP.
        ENDIF.
      ENDIF.
    ENDIF.

    Also, I missed another point.
    In the folder c:\dbdata I have a number of CSV files on the user frontend. I would like the BSP application to get the list of files in the folder and process them one after the other. How can I get the list of files on the folder in the user PC and how to process them one after the other.
    I want the form to display only the default folder and once I press on upload it must process all files and display the status of processing on the same page.
    Please kindly share ideas how I can implement this app.
    Thanks
    Karen

  • How to set a default open with, for all files

    I would simply like to make all my .avi files to open with VLC, rather than Quicktime. I have done the "change default open with", but it's only for that file.
    Any way to make all avi's open with VLC?
    Thanks!

    Right-click any .AVI file and select Get Info. Under the "Open with" section, select the app you want, and then press the "Change All" button.

Maybe you are looking for