Color Changes in Spry Data Fields

Hi All,
I'm new to Javascript & PHP  programming. Currently I have coded neccesary apperances for the Web  Page and also Spry Data Set to read an external XML date source file.
What I need  to do is one of the fields, needs to have color based status changes  based on certain data or criterias received.
For example,
I have a  Spry Table displayed on my browser,
Name
Current  Status
Lane
Jane
6  Mins
1
Peter
Boarding
2
Sally
Arriving
3
Alex
Delayed
4
With the  above, what I need is when the current status show in minutes, the text  color will be white (This has been coded with CSS Style)
For the  Current Status color changes, when I received anything apart from  minutes, the display will be as of below :-
Minutes = Black
Boarding  = Red
Arriving = Green
Delayed = Yellow
My question  is can this be coded with just Javascript, HTML and normal CSS
OR
This  needs to be coded in PHP, ASP ?
I'm not familiar with ASP and only have very  little knowledge of PHP. If anyone here have some experience with this,  can offer some advice on how I can apply this theory into my existing.  And if possible some code example would be great.
Thanks.

I have tried many times on Ben's method and it didn't work.
I have also tried the method from Adobe's documentation site.
Method 1
<ul spry:region="dsStates" spry:if="{ds_RowCount} != 0" spry:repeat="dsStates" spry:test="'{name}'.match(/^[amn]/i);" spry:choose="choose">
     <li spry:when="'{name}'.match(/^n/i);" style="color: red;">{name}</li>
     <li spry:when="'{name}'.match(/^m/i);" style="color: blue;">{name}</li>
     <li spry:when="'{name}'.match(/^a/i);" style="color: green;">{name}</li>
</ul>
Method 2
<div spry:region="dsStates" spry:if="{ds_RowCount} != 0">
<table border="1" spry:repeatchildren="dsStates" spry:test="'{name}'.match(/^[amn]/i);" spry:choose="choose">
     <tr spry:when="'{name}'.match(/^n/i);" style="background-color: red;"><td>{name}</td></tr>
     <tr spry:when="'{name}'.match(/^m/i);" style="background-color: blue;"><td>{name}</td></tr>
     <tr spry:when="'{name}'.match(/^a/i);" style="background-color: green;"><td>{name}</td></tr>
</table>
</div>
Can anyone make it plain and simple of how the data source should look like ?
I'm posting my source code here to make things easy.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:spry="http://ns.adobe.com/spry">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script src="SpryAssets/xpath.js" type="text/javascript"></script>
<script src="SpryAssets/SpryData.js" type="text/javascript"></script>
<script type="text/javascript">
var KomtarETA = new Spry.Data.XMLDataSet("KomtarETA.xml", "komtareta/bus", {useCache: false, loadInterval: 100});
</script>
</head>
<body>
<div spry:region="KomtarETA">
  <table>
    <tr>
      <th>Route</th>
      <th>Current</th>
      <th>Destination</th>
      <th>Next</th>
      <th>Lane</th>
    </tr>
    <tr spry:repeat="KomtarETA">
      <td>{route}</td>
      <td>{current}</td>
      <td>{destination}</td>
      <td>{next}</td>
      <td>{lane}</td>
    </tr>
  </table>
</div>
</body>
</html>
The above is the HTML file I start working with.
The {Current} field needs to have it's data periodically changing color & addition of flashing effect based on it's input from the XML data.
So my question is how do I work about ? I don't quite get the explanation above.
Thanks.

Similar Messages

  • Business partner change Valid From Date field

    How can I change the Valid From Date field in tables:
    BUT000
    BUT020
    BUT0BK
    BUT100
    Currently the of date of creation of the business partner is in this tables' Valid From field.
    In transaction BP the Address of the Business Partner is  valid from 01.01.1990 but still I get a warning that the business partner is not valid for date 01.11.2011.

    Sounds like the problem is the valid to date.  What is that date set to?

  • How to change crystal report data field at runtime ?

    Hello everyone,
    I have a Crystal Report file ,which i am using to generate report for my windows form project .
    In that report i have a filed called as Quantity which data type is set as decimal, the requirement is like that the number of value those comes after decimal point that should be set according to the value which is given by the user at the run time .
    For eg: If user gives 1 at the run time then the report Qty field value set one value after decimal point. Like 12.1
    if user gives 2 then Qty field the value is 12.22 like tat  but user can give from zero to any number.. and if it is zero it should not show decimal
    Note: The main idea hear is how to change the filed in Crystal Report decimal point value by using code(or we say writing code we need to set manually as user input it will change)
    Can any body help me how to solve this issue .
    S.K Nayak

    I think you could probably make the field you see a formula field and take a parameter as the number of decimal places.
    totext converts a number to a string.
    totext({decimalField}, 2)
    That's 2 decimal places.
    You could probably substitute a {parameter} for that 2.
    If not then you could substitute an entire formula.
    To explore formulas:
    foreach (FormulaFieldDefinition f in rpt.DataDefinition.FormulaFields)
    MessageBox.Show(f.Name);
    // f.Text = your new formula
    Where rpt is an instantiated report.
    Or add another string field which you display in the column and do the calculation with the original decimal.
    Hope that helps.
    Recent Technet articles:
    Property List Editing;  
    Dynamic XAML

  • Change of due date field in F-36 t.code

    Hi
    I posted Bills of exchange transaction thru F-36 t.code. Due on will be the future maturity date of Bill. While entering user made mistake. Now i want to change the date. I tried with Fb02 but it is grayed.
    Pls suggest me.
    Thanks
    Sneha

    Hello,
    Check the document change rules in OB32.
    I believe you are referring the following field.
    BKPF-XWVOF
    If yes, then
    OB32,
    Give account type, transaction type, company code.
    Tick field can be changed.
    Save.
    Regards,
    Ravi

  • Remove or Change seconds in Date field

    Hello All,
    I have a field which is storing the start and end time. data type is date ( oracle 8.1.6). while the data is store into the table it is taking seconds also, but the requirement is to store only hours and minutes not seconds. for eg. if the time is '30/10/2007 10:30:59'. How to do this. ?
    regards
    Kris

    but the requirement is to store only hours and minutes not secondsThis doesn't sound like a requirement for storing the data but rather for retrieving or displaying the data. While yo can store the date with '00' seconds it might be more flexible to store the data with seconds and convert it later when you retrieve the data. Either way you can use one of the following;
    SQL> create table t as (
       select to_date('30/10/2007 10:30:59', 'DD/MM/YYYY HH:MI:SS') col1 from dual)
    Table created.
    SQL> select to_char(col1, 'DD/MM/YYYY HH:MI') || ':00' new_date
    from t
    NEW_DATE          
    30/10/2007 10:30:00
    1 row selected.
    SQL> select trunc(col1, 'MI') new_date
    from t
    NEW_DATE          
    30/10/2007 10:30:00
    1 row selected.

  • Print a new report whenever a change occurs to data field

    Post Author: goffj1
    CA Forum: General Feedback
    Please forgive my ignorance but this is my first experience with CR. 
    I have a dynamic dataset with multiple records.  Each records contains a TASK number that groups all the records relating to that TASK.
    Can I force a sperate printed report for each TASK number?
    I can do this with other reporting tools using group headers and such but so far how to do this in CR has eluded me.

    Post Author: pandabear
    CA Forum: General Feedback
    Goffj1,
    I'm not 100% sure I understand what you want, but this is what I think you want:
    Go to Reports/Group Expert
    Select the field "Task Number".
    Go to the Section Expert for the "Task Number" group you just created,
    and select "New Page After".
    This will separate each "Task Number" group by a page when you print.
    Under the "Task Number" group on the report, you can now add
    more groups or add more fields to the Details line as needed.
    Hope this helps,
    The PandaBear

  • Using alternate rows with Spry Data Set

    Can anyone provide more information on how to implement alternate row colors with a Spry Data Set?  What I have done is:
    Create spry data set using HTML page as the data set
    The html page that displays the data set is:  <div spry:region="equipment">
    In the default.css page that is linked, I added the info in note #1 below
    When the page displays, no colors appear. Tried changing the colors and still no luck.  Is there another step to do?
    Note #1:
    within the default.css, the following are declared:
    #equipment odd {
    background-color: #CCC;
    #equipment even {
    background-color: “#F2F2F2;
    Note #2:
    Here is a link to see the actual pages referenced above.
    Any ideas? Getting frustrated!!  Thanks in advance for any advice.

    You are going to kick yourself, but, you haven't assigned any page element the ID #equipment. The region is called that but the table or the DIV does not have an idea and your selector matches nothing...

  • When creating a fillable form and saving it as a pdf, the default color of the data fields is a light blue. How do I change the color to something else that will copy better, e.g. a light yellow?

    When creating a fillable form and saving it as a pdf, the default color of the data fields is a light blue. How do I change the color to something else that will copy better, e.g. a light yellow?

    It's probably the fields highlight color of the application, which you can change via Edit - Preferences - Forms.

  • Working days between two date fields and Changing Factory Calendar

    Hi,
    I have to calculate working days between two date fields excluding the weekends and public holidays for Switzerland.
    I have written the routine using factory calender and its working fine except for two problems now:
    1. If any one of the date field is empty then teh rsult should be zero.
    2. And the below code is working from 1996 but my cleints wants it to work for years before 1996 as well.
    I also tried to change the Start date in SCAL for factory calendar but it says enter values between 1995 to 2020.
    I am new to ABAP. Please help me how i can achieve these for below code.
    DATA: IT_HOLIDAYS type TABLE OF ISCAL_DAY,
          IS_HOLIDAYS TYPE ISCAL_DAY.
    DATA: T_DATE TYPE SY-DATUM,
          P_DATE TYPE SY-DATUM.
    DATA : X_DATE(4) TYPE C.
    DATA: CNT TYPE I.
    REFRESH : IT_HOLIDAYS.
    CLEAR : IT_HOLIDAYS.
    T_DATE = SOURCE_FIELDS-/BIC/ZCCCHP812.
    P_DATE = SOURCE_FIELDS-/BIC/ZCCCHP810.
    CALL FUNCTION 'HOLIDAY_GET'
    EXPORTING
    HOLIDAY_CALENDAR = 'CH'
    FACTORY_CALENDAR = 'CH'
    DATE_FROM = P_DATE
    DATE_TO   = T_DATE
    TABLES
    HOLIDAYS = IT_HOLIDAYS
    EXCEPTIONS
    FACTORY_CALENDAR_NOT_FOUND = 1
    HOLIDAY_CALENDAR_NOT_FOUND = 2
    DATE_HAS_INVALID_FORMAT = 3
    DATE_INCONSISTENCY = 4
    OTHERS = 5.
    DESCRIBE TABLE IT_HOLIDAYS LINES CNT.
    X_DATE = T_DATE - P_DATE - CNT.
    RESULT = X_DATE.
    Please help
    Regards
    Zabina
    Edited by: Syed786 on Nov 2, 2011 9:15 AM

    Hi Zabina,
    Try this function module  'DURATION_DETERMINE'.
    Give the factory calendar and unit as DAY
    With regards,
    Rajesh

  • Date field input help - changing first day of the week

    Hi,
    I need to change the starting day of the week  in a date field value help. I also need to change the days name in this calender.
    Thanks in Advance,
    Dekel.

    I found how to change the first day of the week, through BAdi calendar_definition.
    Can anyone help me locate the day names? (I checked - FM day_names_get dosen't get the names of the UI search help).
    Thanks,
    Dekel.
    Edited by: dekel31 on May 29, 2011 1:17 PM

  • Is it possible to change the way SAP stores a DATE field ?

    Hi,
    I have a scenario here where I have to read from a file and then upload the contents to a custom table.
    The file is comprised of several lines, each line being formatted to accomodate several fields, according to their length specifications. It's the "standard" string style to import/export files from one system to another.
    My question is: one of these fields is a date field, and I am required to order the table, afterwards, by this date field. I notice it comes as DDMMYYYY, and my SORT is not working. If I use, on the other hand, dates in YYYYMMDD format, the SORT works perfectly.
    Does SAP expects the date to come as YYYYMMDD ? Is there a way I can change this "default" format ?
    Thanks,
    Avraham

    Hi,
    Yes, SAP expects the date to come as YYYYMMDD, this is the internal format.
    I am not sure you will be able to change the default DATS format to something else.
    Other internal date format : GDATU as in table TCURF.
    Sugestion : use offsets to convert original date to internal date format and keep doing your SORT as you already did.
    Hope this will help you find de good solution.
    Issa

  • Planning function to change date field value in layout

    Hello experts,
                          I have 1 BPS layout with 2 date fields ( Start date, End date ). With a filter conditions, set of data comes in BPS layout on execution and 2 date fields also contain some value...I want to change values of these 2 dates...both the date fields are char infoobjects..in BPS layout, in planning function I got only 1 function ( Repost function ) to change the value of char infoobject based on some condition. but date field value is not the status field...i want to enter new date instead of old date..if i right exit function in that also i can change only keyfigs values..so please help me to solve this problem..
    Thanks & Regards,
    Priyanka Joshi

    Hi Priyanka,
    As of now master data planning is not so flexibly supported.
    Still u can refer the below link which is enhancement of standard Repost function,and can be used to change master data.
    [http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/10d2b273-0e12-2c10-fab3-a34bde559f92]
    As far as my knowledge goes u cannot directly input date in rows.
    regards,
    Rajendra

  • Date Field Changed After Persistence

    When persisting an object the date field is changed from it's original
    millisecond value to a new value.
    i.e.
    Before persist fastTime: long = 1065003043301 (java.util.Date)
    After persist fastTime: long = 1065003028240
    (com.solarmetric.kodo.util.ProxyDate)
    It is not consistent. Sometimes it correct, other times it's not.
    So my equal() method fails as the member variable Timestamp is different. I
    need to filter on this value and for it to be 'exactly' the same.
    How?
    Config
    KODO 2.5.3,
    Database MYSQL, Default Table type MYISAM, same on InnoDB
    default .JDO file for persistent object
    defaults in kofo.properties

    Graham-
    Unfortunately, SQLServer is only able to store dates to a 3 millisecond
    precision, which means that if your date's milliseconds part is not
    divisible by 3, then you will get back a different date that you
    entered.
    Two possible solutions:
    1. Subclass the SQL Server dictionary to store all date fields as
    longs. This will require that the date field on the server is also a
    BIGINT.
    2. Manually round the milliseconds part of your date to the nearest 3
    milliseconds.
    In article <ble9lc$dne$[email protected]>, Graham Cruickshanks wrote:
    When persisting an object the date field is changed from it's original
    millisecond value to a new value.
    i.e.
    Before persist fastTime: long = 1065003043301 (java.util.Date)
    After persist fastTime: long = 1065003028240
    (com.solarmetric.kodo.util.ProxyDate)
    It is not consistent. Sometimes it correct, other times it's not.
    So my equal() method fails as the member variable Timestamp is different. I
    need to filter on this value and for it to be 'exactly' the same.
    How?
    Config
    KODO 2.5.3,
    Database MYSQL, Default Table type MYISAM, same on InnoDB
    default .JDO file for persistent object
    defaults in kofo.properties--
    Marc Prud'hommeaux [email protected]
    SolarMetric Inc. http://www.solarmetric.com

  • Using Spry.Data.XMLDataSet. Can xml file name be set to change on calendar date?

    I have a website that uses Spry Data XML DataSet to list common pests for the current month. http://www.shspestcontrol.com/
    Each month's list of pests is in a separate xml file (e.g. pests-august.xml)
    Rather than manually updating the file name each month, can it be setup to automatically change the name
    For instance on January 1st, file name changes to pests-january.xml, Feb 1st changes to pests-february.xml. etc.
    <script type="text/javascript">
    <!--
    var dsPests1 = new Spry.Data.XMLDataSet("xml_files/pests-august.xml", "gallery/pests/pest");
    //-->
    </script>
    Any advice if this can be done and if so how to go about doing it would be much appreciated
    Thanks, Toni

    <script>
    var dsPests1 = new Spry.Data.XMLDataSet("pests-september.xml", "gallery/pests/pest");
    function setPestsFile(){
        var months = new Array(13);
            months[0]  = "january";
            months[1]  = "february";
            months[2]  = "march";
            months[3]  = "april";
            months[4]  = "may";
            months[5]  = "june";
            months[6]  = "july";
            months[7]  = "august";
            months[8]  = "september";
            months[9]  = "october";
            months[10] = "november";
            months[11] = "december";
        var now = new Date();
        var monthnumber = now.getMonth();
        var monthname = months[monthnumber];
        dsPests1.setURL("pests-"+monthname+".xml");
        dsPests1.loadData();
    window.onload = setPestsFile();
    </script>

  • Tabular Forms - how to change the color of text when the field is disabled

    Hi,
    I have a tabular form and some of it's columns are disabled showing text in grey color...
    is there a way to change the color to black and bold the text...?
    thanks

    Okay, i've taken a look at your example.
    The column formatting does not work on the input fields. The help on the item says that it generates a span with a style attribute. This would work for a display field, not for an input field.
    Css like i've written should be in the style tags, put up in the header section of the page (page -> edit -> header region).
    You've already put script tags there, the style tags go there aswell. You shouldn't even need to put your script tags in the header region. Just put your code up in the javascript functions region (without the script tags).
    However, i tested in firefox and here color works on an input field, changing the font color. In IE it does not do this. Cross browser implementations and such, not much to do about it here. See http://stackoverflow.com/questions/602070/changing-font-colour-in-textboxes-in-ie-which-are-disabled.
    I did notice that you build your form with a bunch of input fields, which you disable through javascript in the footer of the region. Then on submit, you set the disabled to false again for all those fields! If you want those fields to always be submitted to the server, why wouldn't you use the readonly attribute? Readonly fields are always submitted, and can't be edited by the user. Plus, readonly fields CAN be styled however you want! You can get rid of the javascript code in your header then.
    Even the javascript in the footer is not necessary. If you just add 'readonly="true"' (without single quotes) to the element attributes of your items (edit column -> column attributes region) = no javascript at all (less maintenance).

Maybe you are looking for

  • Can I turn off iTunes match on one computer only?

    I have iTunes installed on two laptops, one at home and one at school (I'm a teacher). iTunes match has worked great for my home computer and iPad, BUT...I do not want my music on the school laptop. Is there a way to turn off iTunes match on one mach

  • Data load to Cube

    Hi All, I am new to SAP BI, I am trying loading data from data source to DSO and then from DSO to a Cube. I am getting data in DSO, but when I run DTP for DSO to cube the data does not come in cube. There is no status message for error while executin

  • Why does while loop pause during operation

    Hi everyone, I have written the attached code which will eventually be a part of a bigger program. The program is intended to log some test value, in this case just the date and time  to a csv file  when a button is pressed (log in WHITE, loop1).  Lo

  • Well designed + free DEMO of Forms

    Does anyone know where I could download an .fmb file which would give an example of what a basic and 'well' designed form looks like? thanks-

  • After EHP6 upgrade in SAP ECC6.0 Stocke not get updated in MMBE after Partial UD

    Hello Experts, Recently we have upgraded our system to EHP6 on ECC 6.0 facing issue in MMBE. We have given Partial UD. after partial UD, some stock suppose to move in Blocked stock as per UD code customization. surprisingly stock not moved to Blocked