Enabling a button according to time

Hi all,
I have a requirement of enabling a button according to system time ie from 9:00 am to 10:00 am I need to have the button functionality disabled for particular days.  Is this type of functionality possible if so can anyone help me in how I can go about with it.
Thank you
Regards,
Preet

Hello Preet,
you can use the following code :-
this particular piece of code will enable the button for monday to friday and morning 9 am to evening 5 pm.
you need to write this code in wddoinit of your view and also bind the enable property of your button to one boolean attribute in context. for example here i have bound it to btnpro.
java.util.Calendar cl = Calendar.getInstance();  // get the current time and date
      int day = cl.get(cl.DAY_OF_WEEK);
      int hour = cl.get(cl.HOUR_OF_DAY);
      if((day >=  1 || day <= 5 )&&((hour >= 9 && hour <= 17)))
           wdContext.currentContextElement().setBtnpro(true);
      else
           wdContext.currentContextElement().setBtnpro(false);
Thanks
Sarbjeet Singh

Similar Messages

  • To enable iconic button at run time

    hi ,
    i have requirement regarding an iconic button could you please help me with the code
    i have taken the button style as iconic
    i have given a file to the icon with extension as .ico
    it was showing at deisn time but it was not diplaying at runtime
    could anyone plz help me with the coding to run at it runtime
    thanks & regards
    Prasad T

    hi
    i was using oracle forms 10g running it in web environment
    but when i give .gif
    it was not displaying even at the desin time
    could you provide me any alternative solution
    thanks
    Prasad.T

  • Enable/Disable Button Depending On User Role

    Hi all,
    I have some buttons in a portlet. I have consumed this portlet in a webcenter portal application. Now i want to disable/enable these buttons according to the user role. How can i achieve this??
    Thanks,
    Dhiraj

    Thinking aloud,
    - should the button be a resource from Webcenter, you could modify its visibility (property) via EL: #{WCSecurityContext.userInGroup['Administrators']} will display the button only if the user is in Administrators group
    - does your portlet have a parameter like that? If so, you should be able to fill it in with EL. If not, I doubt you will be able to achieve visibility changes - you might try to contact the producer of your portlet to do the necessary changes, though.

  • Enable/disable operation buttons according to the selected row in table?

    Hi,
    I used JDev 11.1.1.2.0
    On my main page, it has a query section and display search result to a table component, and also has some operation buttons like (update/delete) on the toolbar.
    I want to enable/disable the operation buttons according to some filed value of the selected row in the table, and I searched the OTN forum, found more questions like this but seemed no found one right solution.
    The table is single selection, and has a status column, its data type is Integer, and I want to enable buttons when the selected row's status field value is 0 or 1, disable buttons when status value is other values.
    Table code like:
    <af:table value="#{bindings.VO1.collectionModel}" var="row"
    rows="#{bindings.VO1.rangeSize}"
    emptyText="#{bindingsVO1.viewable ? 'No data to display.' : 'Access Denied.'}"
    fetchSize="#{bindings.VO1.rangeSize}"
    rowBandingInterval="0"
    filterModel="#{bindings.VOCriteriaQuery.queryDescriptor}"
    queryListener="#{bindings.VOCriteriaQuery.processQuery}"
    filterVisible="true" varStatus="vs"
    selectedRowKeys="#{bindings.VO1.collectionModel.selectedRow}"
    selectionListener="#{bindings.VO1.collectionModel.makeCurrent}"
    rowSelection="single" id="resId1">
    Operation buttons code like:
    <af:commandToolbarButton text="Update" id="ctb2" action="editDAF"/>
    Any suggestion will be great help.
    Thanks,
    zeroxin

    Hi,
    create an attribute binding in the PageDef file for the status field. Then setup the button PartialTriggers property to point to the table ID. The button's disabled property then points to the status attribute binding like
    #{bindings.statusField.inputValue=='value'}
    Frank

  • My weather doesn't changes according to time

    My weather doesn't changes according to time as after 12:00 am it will remain the same day

    Try:
    - Reset the iOS device. Nothing will be lost       
    Reset iOS device: Hold down the On/Off button and the Home button at the same time for at
    least ten seconds, until the Apple logo appears.
    - Reset all settings      
    Go to Settings > General > Reset and tap Reset All Settings.
    All your preferences and settings are reset. Information (such as contacts and calendars) and media (such as songs and videos) aren’t affected.
    - Restore from backup. See:                                                
    iOS: How to back up                                                                                     
    - Restore to factory settings/new iOS device.                     
    Also, the US daylight saving time starts tonight. Sometimes the iOS has problems around DST

  • Enabling Push Buttons

    Hi Gurus,
    I have a column of push buttons in my table control, each push button for each line item.
    According to my requirement, I disabled the push button column initially, it will only get enable depending
    upon each line item's condition.
    Like, 1st row, if rad2 = 'x' , then the push button for that line should get enabled.
            2nd row, if rad2 = 'X', then the push button for that line should get enabled.
            3rd row, if rad2 NE 'X', then the push button for that line should be disabled.
    I tried a lot , but its not happening. May be because I disabled the column based on the screen group.
    Can anyone please help me on this ?
    Thanks
    Chandan

    Hi,
    First assign some function keys for Radio buttons..
    and assign the Logic for enabling and disabling screen logic in the PBO..
    Refer:
    Take the group1 for the screen fields that you have taken on screen as ABC and then follow code to disable fields, in PBO:-
    IF <condition>. "as per your condition
      IF screen-group1 = 'ABC'.
        LOOP AT SCREEN.
          screen-invisible = 0. "to disable screen fields
        ENDLOOP.
        MODIFY SCREEN.
      ENDIF.
    ENDIF.
    Now say if you want to enable fields on some condition then you may use:-
    IF <condition>. "as per your condition
      IF screen-group1 = 'ABC'.
        LOOP AT SCREEN.
          screen-invisible = 1.  "to enable Push Button
        ENDLOOP.
        MODIFY SCREEN.
      ENDIF.
    ENDIF.
    Regards,
    Prabhudas
    Edited by: Prabhu Das on May 11, 2009 7:51 PM

  • Hide radio button in run time

    Hi expert,
    kindly help me for hide radio button in run time for web dynpro kindly give me on example .
    thank's and regard's
    Vikash

    hi.
    For Visibility :
    ->  bind its Visible Property to the context of type WDUI_VISIBILITY.
    -> Now make it visible or invisible according to your requirement.
    using Code Wizard ( Control + F7) , Set the particular context.
    For visible Set as 02.
    For invisible Set as 01.
    code for your ref ( Generated using Code Wizard- Set the particular context attribute. )
    In below code : radiobutton is binded with CA_VIS of type WDUI_VISIBILITY
    DATA lo_el_context TYPE REF TO if_wd_context_element.
    DATA ls_context TYPE wd_this->element_context.
    DATA lv_ca_vis TYPE wd_this->element_context-ca_vis.
    get element via lead selection
    lo_el_context = wd_context->get_element( ).
    @TODO handle not set lead selection
    IF lo_el_context IS INITIAL.
    ENDIF.
    @TODO fill attribute
    lv_ca_vis = 1.
    set single attribute
    lo_el_context->set_attribute(
    name = `CA_VIS`
    value = 02 ).
    I hope it helps.
    Check the sample Wedbynpro Component WDR_TEST_events . This is having the complete UI element functionalities in WDA.
    Thanx.
    Edited by: Saurav Mago on May 1, 2009 1:53 PM

  • CS 5.5. Advanced actions enable a button that jumps to slide... when revisited, button only continue

    Essentially, I have a slide with six buttons on it.... five that navigate to other pages as an interaction, and a continue button that breaks the loop and moves the user forward in the lesson. I have an advanced action that shows the continue button after all other buttons have been used. The problem:
    When a user navigates back to this interaction hub, the enabled continue button doesn't jump to the proper slide... it slowly just moves into a slide in the loop.
    Any idea why a continue button would no longer jump to the proper page after it has been activated?

    Hi there
    Actually I do believe there is a way to make the behavior what you want. But I'll address your issue for making things known to Adobe first. Adobe has something called the "Wish Form/Bug Reporting Form" that they monitor. So you use that. (Link to that is in my sig line)
    As for the button issue, you can accomplish it using Advanced Actions. What you need to do is to manipulate the Playhead to keep it paused. One way is by configuring the variable rdcmndGotoFrame with the value rdinfoCurrentFrame. Sometimes this works to just keep the playhead paused. Other times I've tried to do it with some success by repositioning the playhead farther upstream and allowing it to "float" back to the pause point of the object. And to do this you use the variable rdcmndGotoFrameAndResume and assigning it the frame number earlier in time. Of course, to do this you must first calculate the frame number to position at. I normally did this by inserting a Text Caption configured to present the rdinfoCurrentFrame variable and manipulating the pause points using a Click Box object to arrive at the desired value.
    Cheers... Rick
    Helpful and Handy Links
    Captivate Wish Form/Bug Reporting Form
    Adobe Certified Captivate Training
    SorcerStone Blog
    Captivate eBooks

  • HT1175 I am trying to setup my Time capsule via a ethernet cable as a back up for a new iMac. The on button on the time capsule set up window keeps failing to stay on. Any ideas what to do?

    I am trying to setup my Time capsule via a ethernet cable as a back up for a new iMac. The on button on the time capsule set up window keeps failing to stay on. Any ideas what to do?

    A PC can have more issues connecting than a Mac.
    But it really should not matter.. so just try it in situ.. press and hold the reset.. once it starts up, it will return to default IP, 10.0.1.1 the PC should then be able to find it via the airport utility.
    If not drag it over to the Mac and plug in there by ethernet.. or since it is a laptop, really should not be that difficult to drag the Laptop and plug it into the TC.
    Important thing is to get access to the TC.
    The Mac if it is running lion, then you MUST download and install 5.6 airport utility to do anything useful.
    http://support.apple.com/kb/DL1482

  • Select one radio button at a time

    Hi all,
    my webdynpro table contains 3 rows. each row contains one radio button. at a time i should select only one radio button and bydefault the first one should be select.
    Thanks,
    Sagarika

    Hi,
    when the view will load,  bydefault radio button of first row of webdynrpo table should check. in this part i am facing problem.
    in my onaction-method i wrote the down code for 'deselect radio button if i will select other one'.my node is 'paticipants'.
      " Uncheck  other Radio button if selected
      DATA: lo_nd_participants  TYPE REF TO if_wd_context_node,
            lo_changed_elem     TYPE REF TO if_wd_context_element,
            lo_elem             TYPE REF TO if_wd_context_element,
            lt_elem_set         TYPE wdr_context_element_set,
            ls_chgd_participant TYPE LINE OF wd_this->elements_participants,
            ls_participant      TYPE LINE OF wd_this->elements_participants.
      FIELD-SYMBOLS:
            <fs_participant>   TYPE LINE OF wd_this->elements_participants.
      " Get the changed context row
      CALL METHOD wdevent->get_context_element
        EXPORTING
          name  = 'CONTEXT_ELEMENT'
        RECEIVING
          value = lo_changed_elem.
      " Get static attributes
      CALL METHOD lo_changed_elem->get_static_attributes
        IMPORTING
          static_attributes = ls_chgd_participant.
      " Navigate from <CONTEXT> to <PARTICIPANTS> via lead selection
      lo_nd_participants = wd_context->get_child_node( name = wd_this->wdctx_participants ).
      IF lo_nd_participants IS INITIAL.
        RETURN.
      ENDIF.
      " Get all the selected elements from the context
      lt_elem_set = lo_nd_participants->get_elements( ).
      " Process the elements
      LOOP AT lt_elem_set INTO lo_elem.
        CALL METHOD lo_elem->get_static_attributes
          IMPORTING
            static_attributes = ls_participant.
        IF ls_participant-prim_userid NE ls_chgd_participant-prim_userid.
          ls_participant-admin_ind = abap_false.
          lo_elem->set_static_attributes( ls_participant ).
            ENDIF.
      ENDLOOP.

  • On my PC, in I-Tunes, my iPod (touch) button disappears every time I try to sync or update.  Everything has been rebooted, but no changes. Any ideas on how to sync to the IPod?

    On my PC, in I-Tunes, the iPod (touch) button disappears every time I try to sync or update.  Everything has been rebooted, but no changes. Any ideas on how to sync to the IPod?  Better yet, how to keep the ipod button on screen when itunes is open and the ipod is connected?

    - Have you tried another USB port and cable?
    - Inspect the dock connector for bend or missing contacts, foreign material, corroded contacts, broken, missing or cracked plastic.

  • How do I enable the button to use the tree list in excel? (Enable the list type: Tree enabled in Office 2013 - VSTF 2013)

    Hi, I was looking to see if anyone knows how I can troubleshoot my connection problem with TFS view in excel. I'm trying to  produce a tree view in Office 2013 as described in the following KB -
    https://msdn.microsoft.com/en-us/library/dd286627.aspx
    I have followed the instructions on the KB all the way up to : 'Add backlog items and tasks and their parent-child links using a tree list' and at this point I can't seem to get it to work as the button is greyed out.
    Note that I have completed steps 1-6 for the previous procedure... all 6 steps work just fine. However on step 2 of the second procedure - the instructions state I should be able to 'Add Tree Level' - However the button is greyed out.
    Anyone know what I need to do to enable the button to use the tree list in excel? 
    Frank

    Frank,
    I believe your issue is that you have opened a Flat query and are trying to add tree levels. A flat query is just that and you cannot change the query type from Excel.
    The second process is managing a backlog (which is a tree). TFS web access has a link on the backlog view to create a query. That query will be a "tree of work items" query that returns the items in the backlog including their parent-child relationships.
    This type of query supports the Add Tree Level and Add Child functionality as does a new Input List (not bound to an existing query).
    "You will find a fortune, though it will not be the one you seek." -
    Blind Seer, O Brother Where Art Thou
    Please Mark posts as answers or helpful so that others may find the fortune they seek.

  • How to enable a button only when a tilelist item is selected

    Simple question but it seems quite awkward to me. How do I enable a button only when an item within a tilelist is currently selected?
    For example lets say if I have a button called button1 that is disabled by default and a tilelist called tilelist1 what would I have to add into the brackets of the following code (enabled property of the button) to ensure that the button is only enabled when an item in the tilelist is currently selected but disabled when no items are selected:-
    enabled="{}"

    enabled="{tilelist1.selectedItem}"
    that should do it, it's making an implicit comparision with null (tilelist1.selectedItem == null) which will result in a boolean.
    SelectedItem is null when nothing is selected , not null when something is.

  • How to Enable a Button

    Hello,
    I have a little problem to Enable a Button.
    I have a Text-Item and a Button in my Form-Modul. I want to write a Code which checks if the Text-Item is Null. If it is then the Button must be enabled.
    But which Form-Trigger must I use to do this.

    This question is definitely more clear then Sven's;-)
    I would use the when-validate-item-trigger on your text field,
    and in addition the post-query-trigger if you want to set the
    property already when retrieving records from the database.
    IF :MY_BLOCK.EINGABE IS NULL THEN
      SET_ITEM_INSTANCE_PROPERTY('MY_BLOCK.MY_BUTTON', :SYSTEM.TRIGGER_RECORD, ENABLED, PROPERTY_FALSE);
    ELSE
      SET_ITEM_INSTANCE_PROPERTY('MY_BLOCK.MY_BUTTON', :SYSTEM.TRIGGER_RECORD, ENABLED, PROPERTY_TRUE);
    END IF;

  • My iPad won't charge after plugging into my computer and after holding down the power and home button at same time for 10 seconds- Can anybody help? Has IOS7.0 but the most up-to-date version

    My iPad won't charge after plugging into my computer and after holding down the power and home button at same time for 10 seconds… Can anybody help? Has IOS7.0 but not the most up-to-date version

    It's just the battery sign - nothing else. I've tried to reboot by holding down both power and home key for 10+ seconds, waiting for the apple logo - but nothing happens. It's plugged into the imac at the moment. I tried to recharge it overnight using the normal charger - but no luck. It went dead during a Skype call with a friend - even though it was powered into the mains - albeit at a low battery level at the time

Maybe you are looking for

  • Error whiel runnning the FR report

    Hi folks, Any clue about this error? 5200:Error executing query: Invalid Item ID. Thanks

  • Menu in ALV grid output

    Hi all, Iam in need of a code that may help me out to get my cuztomized menu for my alv grid output. Please give your suggestions, Thanks, Rajesh.

  • Images fail to load completely

    I regularly visit a web site which displays many photographs. Often some of the images fail to load completely, I may see the top 30% of the image and the rest shows as a grey box. Pasting the same URL into Firefox, shows the whole image. Any ideas?

  • Problem with change mode in program

    Hi, I have problem to chage the program from display mode to change mode. I tried to change the mode by clicking change icon(little pen indicator) and also i tried with menu path program->Dispaly<>change also. But i got message that The user kumar cu

  • I went to insert button hit counter. It shows on iweb, but it won't  publish

    I went to insert>button>hit counter. It shows on iweb, but it won't  publish