Dynamic Labels with Datepicker..

Hiya folks,
I need to have a dynamic label for a page item, and am coming up lacking....
Here is the situation:
APEX 4.0, running on Oracle 10g..
I have a datepicker control (item is a due date). I am using a hidden item to store the label and I setup the value of this item when it is displayed via a simple sql select.
If the due date is PAST the system date, then I set the label to Item Is Past Due.
If the item due date is within 7 days of the system date I change the label to Item Due within 7 Days.
If none of these are true then I set the label to Due Date.
However, if the user changes the date via the datepicker, I need to have the label updated (and the the hidden item) to show the change (or not).
I tried a dynamic action on the datepicker, but it did not seem to fire on a change event always, and would NOT refresh the label with the new value.
Do I need to submit the page to get the label to update?
Thank you,
Tony Miller
LuvMuffin Software

Hello Tony,
>> I am using a hidden item to store the label and I setup the value of this item when it is displayed via a simple sql select.
If you need to refresh a page item, without submitting the page, based on a result of a SQL query, it seems that your only option is to use AJAX (as the SQL can only run on the server side, and you don’t want to submit the page).
The old, but still good, fashion way is to define an onchange event on the Datepicker item. This event is fired every time a changed value is passed from the Datepicker into the input field of the item. Simple and effective.
I’m no expert in Dynamic Actions but I can tell you that if you set the When Event to Change it is fired when the Datepicker changes the current date. With the Action option of Execute JavaScript Code you can probably also trigger an AJAX process.
>> Do I need to submit the page to get the label to update?
No. You can use AJAX, either directly or through DA.
Regards,
Arie.
♦ Please remember to mark appropriate posts as correct/helpful. For the long run, it will benefit us all.
♦ Author of Oracle Application Express 3.2 – The Essentials and More

Similar Messages

  • Dynamic Labels with JSP/BC4J

    Is it possible to have the labels on a JSP dynamically change as the input changes? IE. If country chosen is canada the label becomes postal code instead of zip code.
    Thanks,
    Natalie

    You can setup control hints per locale. If you setup hints for both locales, the JSP runtime will automatically select the appropriate label based on the browser's language settings.

  • Displaying "Required Label with Help" icon dynamically

    Hi,
    I have an item say 'Dept Name', P1_DEPT_NAME
    This field is mandatory in case of CREATE and optional in case of UPDATE.
    - so in case of CREATE, I need to put the ICON (Required Label with Help) along with the Label 'Dept Name'
    - in case of UPDATE, I don't need the ICON (Required Label with Help) along with the Label 'Dept Name' as it is an optional field.
    How can I change the label dynamically.
    the path of the icon is shown below but don't know where to put this as per my requirement.
    <img src="#IMAGE_PREFIX#themes/theme_12/required.gif" alt="Required Field" />Thanks,
    Deepak

    Thanks..Shijesh
    I have put the following code in Region Footer.
    <script type="text/javascript">
    var req =  $v('pRequest')  // getting the request
    if (req == 'CREATE')    // if request = CREATE
       document.getElementById("IMG_ID").src ="<img src=#IMAGE_PREFIX#themes/theme_12/required.gif/>";       //set the image src to create image icon  
    else
       document.getElementById("IMG_ID").src ="<img src=#IMAGE_PREFIX#themes/theme_12/optional.gif/>"; // set the image src to update icon
    </script>Also, have update the item label with the following -
    <img src="" id="IMG_ID" />
    But images are not coming up.
    also, every time either CREATE or UPDATE...it's going to the else part..that means it doesn't identifying the REQUEST value, I have checked couple of times but I am passing the exact REQUEST value.
    Thanks,
    Deepak

  • Problem in aligning dynamic UI with the static UI

    Hi All,
    I have problem in aligning dynamic UI with the static UI, I am using Matrix layout.
    Static fields are spread over 2 colums and 3 rows:
    lableA SPACE input field SPACESPACE lable B SPACE input field
    lableC SPACE dropdown SPACESPACElableD SPACE dropdown
    lableE SPACE dropdown SPACESPACElableF SPACE dropdown
    Now when a value is selected in C, than E becomes visible, and depending on the values selected in E, there are dynamic UI generated, i.e dynamic lables and depending on some validation it will be either a dropdowns or input fiels or both.
    at run time screen is like this:
    lableA SPACE input field SPACESPACE lable B SPACE input field
    lableC SPACE dropdown SPACESPACElableD SPACE dropdown
    lableE SPACE dropdown SPACESPACElableF SPACE dropdown
    dynaSPACEdropdown
    dynbSPACEinput field
    if I change my selection in E than layout looks like:
    lableA SPACE input field SPACESPACE lable B SPACE input field
    lableC SPACE dropdown SPACESPACElableD SPACE dropdown
    lableE SPACE dropdown SPACESPACElableF SPACE dropdown
    dynaSPACESPACEdropdown
    dynbSPACESPACEinput field
    Requirment: I need all the lables as well as dropdown/ input fiels in line with the static fields irrespective of my selection in E.
    Something like this:
    lableA SPACE input field SPACESPACE lable B SPACE input field
    lableC SPACE dropdown SPACESPACElableD SPACE dropdown
    lableE SPACE dropdown SPACESPACElableF SPACE dropdown
    dyna   SPACEdropdown
    dynbSPACESinput field
    dyncSPACESdropdown
    All this elements are in a group and that group has 2 transparent containers, 1 for static and for holding dynamic UI.
    I tried playing with the container properties, and also tried fixing width of dynamic UI but still the alignment issue is encountered.
    Can U guys plz give in ur valuable inputs as i need to fix this urgently.
    Regards,
    JJ

    Hi Armin,
    Can you please elaborate your solution ?, I do not have an idea of InvisibleElement & IWDView.resetView() ,
    If you can give me the exact pointer than it would be great and a good learning exp. for me.
    Thanks for the action assignment part, it worked.
    if (wdContext.nodeMaterialClass().size() > 0 && wdContext.currentContextElement().getActionMatCls()) {
         if (wdContext.currentMaterialClassElement().getMaterialClass_Description() != null || !wdContext.currentMaterialClassElement ().getMaterialClass_Description().equalsIgnoreCase(" ")) {
               IWDGroup Searchgroup = (IWDGroup) view.getElement("DynGroup");
    Searchgroup.destroyAllChildren();
    view.getContext().reset(false);
                                                      for (int i = 0; i < wdContext.nodeMaterialCharateristcs().size(); i++) {
                                  //this for label
         IWDLabel CharLabel = (IWDLabel) view.createElement(IWDLabel.class, "label" + i);
         CharLabel.setText(wdContext.nodeMaterialCharateristcs().getMaterialCharateristcsElementAt(i).getDescr_Char());
         CharLabel.setDesign(WDLabelDesign.EMPHASIZED);
         CharLabel.createLayoutData(MatrixHeadData.class);                              CharLabel.setWidth("154px");                              Searchgroup.addChild(CharLabel);
                 further there are conditions to create either dropdown or input field
    Can you please point where and how to apply your solution.
    Regards,
    JJ

  • How to link label with an input field in data table?

    I am curious if there is a nice way to link a label to input field in a data table directly in JSP? Data filling the table are dynamically bounded.
    Sample, simplified code below. Values of "label" property are unique in the collection binded to dataTable.
    <?xml version="1.0" encoding="UTF-8"?>
    <jsp:root version="1.2" xmlns:f="http://java.sun.com/jsf/core"
         xmlns:h="http://java.sun.com/jsf/html"
         xmlns:jsp="http://java.sun.com/JSP/Page">
         <jsp:directive.page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8" />
         <f:view>
              <html>
              <body>
              <h:dataTable value="#{screen$monitoring$errorlog$CorrectHopper.dataset}" var="DATA_ROW">
                   <h:column>
                        <f:facet name="header">
                             <h:outputText value="Name" />
                        </f:facet>
                        <h:outputLabel value="#{DATA_ROW.label}" for="#{DATA_ROW.label}_id" />
                   </h:column>
                   <h:column>
                        <f:facet name="header">
                             <h:outputText value="Value" />
                        </f:facet>
                        <h:inputText value="#{DATA_ROW.label}" id="#{DATA_ROW.label}_id" />
                   </h:column>
              </h:dataTable>
              </body>
              </html>
         </f:view>
    </jsp:root>
    returns:
    17:39:01,390 ERROR [[jsp]] Servlet.service() for servlet jsp threw exception
    java.lang.IllegalArgumentException: #{DATA_ROW.label}_id
    what is related to EL expression in h:inputText's "id" attribute.
    Is there any other way to bind label with dynamically created input field in JSP? Do I really have to bind input field directly to component objects with "binding" and set IDs manually with setId() (what is ugly solution because it moves View related logic to Model layer)?

    I've thought of using EL because I have to somehow
    link a label to an input field dynamically. Somehow? Dynamically? Just use plain text :)Well... just look at my code snippet (notice: we want to join the pairs of labels and text boxes placed in a datatable [or any other repeater-like component rendering properties of objects from a collection]):
    <h:dataTable value="#{screen$monitoring$errorlog$CorrectHopper.dataset}" var="DATA_ROW">
    <h:column>
    <f:facet name="header">
    <h:outputText value="Name" />
    </f:facet>
    <h:outputLabel value="#{DATA_ROW.label}" for="#{DATA_ROW.label}_id" />
    </h:column>
    <h:column>
    <f:facet name="header">
    <h:outputText value="Value" />
    </f:facet>
    <h:inputText value="#{DATA_ROW.label}" id="#{DATA_ROW.label}_id" />
    </h:column>
    </h:dataTable>
    and what is your idea of using plain text as "id" attribute value in this case? :)
    Regards,
    Michal

  • Dynamic accordion with dynamic datagrid

    I’m trying to create a dynamic accordion with embedded
    datagrids in each accordion area. I have the base working but have
    2 problems I can’t seem to figure out.
    Bases; the accordion uses a repeater and vbox with a custom
    component from a webservice result set to create the accordion. The
    custom component has another webservice that gets a value from the
    repeater to pass it to the custom component.
    My 2 problems:
    1. how do I prevent the custom component from running the
    webservice until the accordion item is clicked or the area is
    visible? Otherwise I end up will a bunch of queries hitting the DB
    and if there is several items for the accordion and many items from
    the datagrid its slower.
    2. how can I get the datagrid query to refresh when the
    accordion item is clicked? Because the data may change I am not
    able to see the updated data unless I reload the entire
    application.
    1 thing I did try. With the tab control you can use the
    show() event and the data will refresh just fine, but with the
    accordion, the show() event does not seem to fire. Its as if they
    are all visible.
    Any help here would be much appreciated, I’ve been
    racking my brain for days now and I sure it is something simple
    that I am missing. Thanks in advance.
    See the example code below.
    the application code:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    layout="absolute"
    width="100%"
    height="100%"
    initialize="ws.getMethod1.send()"
    xmlns:output="com.comp.*">
    <mx:Script>
    <![CDATA[
    import mx.controls.Alert;
    [Bindable]
    public var thisWsdl:String = '
    http://localhost/webservice/service.cfc?wsdl';
    ]]>
    </mx:Script>
    <mx:WebService id="ws"
    wsdl="{thisWsdl}"
    useProxy="false"
    showBusyCursor="true"
    fault="Alert.show(event.fault.faultString, 'Error');"
    concurrency="multiple" requestTimeout="30">
    <mx:operation name="getMethod1">
    <mx:request>
    <param1>{param1data}</param1>
    <param2>{param2data}</param2>
    <param3>{param3data}</param3>
    </mx:request>
    </mx:operation>
    </mx:WebService>
    <mx:Accordion width="100%" height="100%"
    fillColors="[#808080, #808080]">
    <mx:Repeater id="rp"
    dataProvider="{ws.getMethod1.lastResult}">
    <mx:VBox label="{String(rp.currentItem.catname)}"
    backgroundColor="#C0C0C0" width="100%" height="100%"
    paddingRight="10">
    <output:comp catid="{rp.currentItem.catid}"/>
    </mx:VBox>
    </mx:Repeater>
    </mx:Accordion>
    </mx:Application>
    the component code:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:VBox xmlns:mx="
    http://www.adobe.com/2006/mxml"
    width="100%"
    height="100%"
    focusIn="ws.getMethod.send()"
    horizontalAlign="center"
    backgroundColor="#FFFFFF">
    <mx:Script>
    <![CDATA[
    import mx.controls.Alert;
    [Bindable]
    public var thisWsdl:String = '
    http://localhost/webservice/service.cfc?wsdl';
    [Bindable]
    public var catid:int;
    ]]>
    </mx:Script>
    <mx:WebService id="ws"
    wsdl="{thisWsdl}"
    useProxy="false"
    showBusyCursor="true"
    fault="Alert.show(event.fault.faultString, 'Error');"
    concurrency="multiple" requestTimeout="30">
    <mx:operation name="getMethod2">
    <mx:request>
    <catid>{catid}</catid>
    </mx:request>
    </mx:operation>
    </mx:WebService>
    <mx:DataGrid id="itemGrid"
    dataProvider="{ws.getMethod2.lastResult}" width="700"
    height="250">
    <mx:columns>
    <mx:DataGridColumn width="100" dataField="itemid"
    headerText="Item Id"/>
    <mx:DataGridColumn wordWrap="true" dataField="itemname"
    headerText="Item Name"/>
    </mx:columns>
    </mx:DataGrid>
    </mx:VBox>

    Perhaps you could use the change event of the accordion, or
    the show event of the child containers?
    Tracy

  • Dynamic Routing with VPN and multiple Peers

    I have several sites that connect to my primary host site (ASA5525-X) via LAN to LAN tunnels and currently all internal host routing is static. I need to implement a backup host site (ASA5520) for the remote sites to connect to. I know that I can add additional peers on each remote site for the host sites. However, I need to be able to do dynamic routing, so that if does not matter which site they are connected to the internal networks will learn where to route the traffic. I am running OSPF on my internal networks at both Primary and Backup host sites and they have an internal connection between the two sites.
    Is there a way to accomplish this on the ASAs?
    Thanks,
    Doug

    To make perhaps my question a little more clear, this is an example of how I would the result to look like
    http://www.latitudes.co.uk/dept_search_pages/search_provence.php
    where the labels with the checkboxes are retrieved from the 'category' table and when one or more boxes are ticked, the corresponding values are used to make the selection in the WHERE statement in the MySQL query.
    Hope someone can help me out.
    Erik

  • Dynamic label in qml

    How to add  dynamic label in qml 

    I am not familar with this , but I think you might want to take a look in the developer forums.  I see some stuff on this subject..
    http://supportforums.blackberry.com/t5/10K-Developer-Commitment/dynamically-change-label-text-QML/td...

  • Using Dynamic Visibility with Accordian Menu

    Hiya.  I am trying to use dynamic visibility with an accordian menu.  My menu categories are years, 2005 - 2010. My categories items are key performance indicators such as abandon percentage,  first call resolution, customer satisfaction percentage, call volume and average speed of answer. 
    Of my 6 KPIs, 4 display as percentages and 2 display as whole numbers.  When the percentage graphs are displayed the axis labels needs to be percentages.   When the whole number graphs are displayed the axis label needs to show whole numbers.
    I thought to achieve this I should use dynamic visibility with two different line charts where one line chart shows percentages and the other line chart shows whole numbers.   However I am strugging trying to make that happen.
    Is my concept correct, or is there an easier way to accomplish this?  If my concept is correct,can someone give me some advice on how to make dynamic visibility display the correct chart depending on which KPI I select from my accordian menu?
    Thanks!

    Hi
    You can achieveby doing following steps..
    Insert your categories into D3 and label bind to E3.
    take two charts and bind to the destination data of Accordion menu
    then write a formula in F3 like this =IF(OR(E3="abandon percentage",E3="customer satisfaction percentage"),1,0)
    and bind your two charts to the F3 and set DV for % charts as 1 and # charts as 0.
    I hope this will helps you
    Thanks,
    Srinivas Dandamudi.

  • Dynamic label texts on dynpro

    Hello,
    I created a dynpro with screen painter and want to determine the label texts dynamically from a Z dict table.
    I hoped that I could change the text of the labels with loop at screen, but there it isn't possible to do that.
    Could you help me here?
    Best regards
    Tim

    Hello Tim Eisenmann
    Use an input field instead of the label
    but set "output only" tick on screen painter.
    It has the same appearance as label.
    I mean double click on the component on the screen painter,
    go to "Program" tab at the right screen and tick "Output Only"
    Now you can set whatever you want as an input field.
    I hope it helps.
    Edited by: Bulent Balci on Aug 9, 2010 4:23 PM

  • Retain call info using dynamic label

    Hi
    Im using dynamic labels together with vxml app so depending on what e164 number the fromExtvxml variables is populated with the dynamic label diales to these extensions. Only problem with this as you all may know is that after label node in a dynamic label the script cannot continue. As i also need to have queuing if the dialed out phones do not answer. How could this be accomplished? Is there any way to use last label to be a dialednumber plan pattern or something else? I could for some smaller customers use a separate dnis / script for queuing but it will not fit all needs in the long run.
    Sent from Cisco Technical Support Android App

    I solved it. It works perfectly fine to do queuing after a dynamic label. Dont know why others says it does not work
    Sent from Cisco Technical Support Android App

  • ICM dynamic label transfer

    For UCCE 8.X can anyone share info on how exactly a transfer happens using dynamic label.  We are transferring out to 800 no and somehow the calls sent out are not matching what is being received at the other end. 

    The call is routed back to the routing client i.e. CVP or CUCM (wherever call arrived from) and follows dial-plan configured on the routing client i.e. CUCM Route pattern in matching partition or if CVP is involved either CUSP/CUPS/CVP dial-plan. If you are doing REFER transfer with CVP then the call gets routed back to the originating device i.e. ingress GW and a dial-peer is matched.
    Chris

  • Dynamically labeling a button

    Hello again.
    In AS 2.0, I used to be able to make a single movie clip that I could re-use over and over again as a button.  Each instance of this button would then be dynamically labeled at runtime based on some code using onClipEvent(load) and textFormat.  I tried to so something similar using actionscript 3.0 and came up against some problems.  Could anybody tell what I am doing wrong?
    The button is instance named "lgndOneBedroom_mc" and this is the code on the root timeline:
    import flash.display.Sprite;
    import flash.text.TextField;
    import flash.text.TextFieldAutoSize;
    import flash.text.TextFormat;
    lgndOneBedroom_mc.buttonMode = true;
    lgndOneBedroom_mc.buttonTextField.text = "One Bedroom";
    Then, in the button movie clip I have a dynamic text field instance named "buttonTextField" and the following code on the actions layer:
    myTextFormat = new TextFormat()
    buttonTextField.setTextFormat(myTextFormat);
    Thanks everyone.

    Hey, I'm pretty sure its a minor error with either the name or the text field, but here's a completely dynamic piece where even the text field is created by action script so u don't need anything on the stage, just use the label.x and label.y to place it where you want, hope this helps;
    var label:TextField;
    function TextFormat() {
                configureLabel();
                setLabel("Hello ");
    function setLabel(str:String):void {
                label.text = str;
    function configureLabel():void {
                label = new TextField();
                label.autoSize = TextFieldAutoSize.LEFT;
                label.background = true;
                label.border = true;
                var format:TextFormat = new TextFormat();
                format.font = "Verdana";
                format.color = 0xFF0000;
                format.size = 10;
                format.underline = true;
                label.defaultTextFormat = format;
                addChild(label);
                //label.x = where?
                //label.y = where?
    TextFormat() ;

  • Labels with javascript

    Hi all! I have a question regarding dynamic labels.
    I have an item and I need to draw a red asterisc (like a mandatory field) if the item is not null.
    I have something like that on the label:
    PA Number <script>if ( document.getElementById("IP_P740_PA").value !="") <img src="/i/requiredicon_status2.gif" alt="Required Field Icon" tabindex="999" /></script>
    But this red asteric never appears when I run the page.
    Thanks!

    Daniela,
    I think what's missing in your solution is an event to invoke the javascript. My best quess is you want to use OnLoad in the HTML body element, which you can define in HTML DB. The part that I'm not clear on, but I'm sure some Javascript/DHTML gurus are, is how to write the javascript to make the images appear for the correct labels.
    By the way, any reason you are not just using HTML DB's validations with inline error messages?
    Sergio

  • Dynamic action with set value on date field

    Hi,
    I'm using APEX 4.02
    I'm trying to calculate the age based on the date of birth dynamically on a form. I'm trying to do this with a (advanced)dynamic action with set value.
    I'm able to get this kind of action working based on a number field etc, but NEVER on a date field.
    I've read all posts on this subject but so far no solution. Even if I try to simply copy the value over to another date field or typecast it to a string ( to_char function ) it does not work. So for me the problem seems to be in the source field being a date field.
    I've tried using the source value as is in a select statement :
    select :P33_GEBOORTEDATUM from dual;
    and also type casted based on the date format :
    select TO_DATE(:P33_GEBOORTEDATUM,'DD-MON-YYYY') from dual
    but still no luck.
    On the same form I don't have any issues as long as the calculation is based on number fields, but as soon as I start using dates all goes wrong.
    Any suggestions would be greatly appreciated. If you need any extra info just let me know.
    Cheers
    Bas
    b.t.w My application default date format is DD-MON-YYYY, maybe this has something to do with the issue .... ?
    Edited by: user3338841 on 3-apr-2011 7:33

    Hi,
    Create a dynamic action named "set age" with following values.
    Event: Change
    Selection Type: Item(s)
    Item(s): P1_DATE_OF_BIRTH
    Action: Set value
    Fire on page load: TRUE
    Set Type: PL/SQL Expression
    PL/SQL Expression: ROUND( (SYSDATE - :P1_DATE_OF_BIRTH)/365.24,0)
    Page items to submit: P1_DATE_OF_BIRTH
    Selection Type: Item(s)
    Item(s): P1_AGE
    Regards,
    Kartik Patel
    http://patelkartik.blogspot.com/
    http://apex.oracle.com/pls/apex/f?p=9904351712:1

Maybe you are looking for

  • Purchased Films no longer available to watch on Apple TV

    Ill Manors I have turned my Apple TV on to watch the above film which I purchased at £13.99 and have found this has been removed from the apple store and I can no longer watch this. How is this possible if I own the film? But I have purchased this fo

  • Translation of heading in Excel file.

    Hi frnd, My requirment is to send a report in excel format to the customer in customer language. The headings of each coulmns are translated to customer language format. I defined the column heading in Text symbols. Goto>text elements->text symbols.

  • How to use JDBC to connect informix database

    Dear all, I want my client application to connect informix database by using JDBC. The JDBC driver has been installed successfully in the client computer (Win2000). The informix 5.0 resides the a Unix server named "dbserver". The following is my java

  • Itunes wifi sync not working on windows 8!!

    Does itunes wifi sync works on windows 8? Because i already have enabled wifi sunc but after i disconnect the cable from the ilhone it doesnt aloud me to do sync via wifi.  Does anyone know how to make it work properly on windows 8?

  • Catch a JList event, which JList is in a JTable

    I have got a JTable and in its cells are JLists or JLabels (it depend on data) Here is code spinnet: DefaultTableCellRenderer ownRenderer = new DefaultTableCellRenderer() { public Component getTableCellRendererComponent(JTable table, Object value, bo