Dynamically load content by date using xml

i would like to load content by date using xml. meaning if i
have 5 upcoming social events listed, i want them to dynamically
drop off from my webpage as the event date passes. i would like to
use the built in spry xml dataset functionality, but don't have to.
i can't seem to find a way to get the server date and then compare
it to a date in a xml node. this seems simple, but i can't seem to
find a tutorial that does not get crazy with all kinds of
code.

Have the column headings (which the user clicks to sort by
that column) as
links back to the main page, with the sort as a url parameter
eg
www.mysite.com/mypage.php?sort=name
www.mysite.com/mypage.php?sort=date
etc
Then in your recordset, change the code from
$sql = "SELECT * FROM table ";
to
switch($_GET['sort']){
case "date":
$sql = "SELECT * FROM table ORDER BY date DESC";
break;
case "name":
$sql = "SELECT * FROM table ORDER BY name DESC";
break;
You`ll need to change the above to suit your needs obviously,
but the above
shows the principles that you need to use.
So you use the same page for each sort, but the SQL to
retrieve the records
in the order you want changes dynamically.
Gareth
http://www.phploginsuite.co.uk/
PHP Login Suite V2 - 34 Server Behaviors to build a complete
Login system.

Similar Messages

  • POST data using XML

    hi everyone...i want to upload a video to youtube from my desktop application. i went through the following link.
    http://code.google.com/apis/youtube/2.0/developers_guide_protocol_resumable_uploads.html#Sending_a_Resumable_Upload_API_Request
    it is for sending data using XML. but i don't know how to send data using XML. can someone give me an insight of data POST'ing using XML? any help is appreciated.

    actually i saw the following segment in this link :
    http://code.google.com/apis/youtube/2.0/developers_guide_protocol_resumable_uploads.html#Sending_a_Resumable_Upload_API_Request
    POST /resumable/feeds/api/users/default/uploads HTTP/1.1
    Host: uploads.gdata.youtube.com
    Authorization: AuthSub token="DXAA...sdb8"
    GData-Version: 2
    X-GData-Key: key=adf15ee97731bca89da876c...a8dc
    Content-Length: 1941255
    Slug: my_file.mp4
    Content-Type: application/atom+xml; charset=UTF-8
    <?xml version="1.0"?>
    <entry xmlns="http://www.w3.org/2005/Atom"
      xmlns:media="http://search.yahoo.com/mrss/"
      xmlns:yt="http://gdata.youtube.com/schemas/2007">
      <media:group>
        <media:title type="plain">Bad Wedding Toast</media:title>
        <media:description type="plain">
          I gave a bad toast at my friend's wedding.
        </media:description>
        <media:category
          scheme="http://gdata.youtube.com/schemas/2007/categories.cat">People
        </media:category>
        <media:keywords>toast, wedding</media:keywords>
      </media:group>
    </entry>

  • Importing data- using xml file into HANA Table

    Hi,
    We are using (HDB STUDIO ) - revision 60.......
    Is it possible to import data using XML file into HANA table (Master,Fact tables)?
    (Without using any intermediate adapters for conversion of data.....)
    Can any one suggest us........
    Thank you.

    Hi user450616
    I am a bit confused about what you are trying to achieve.
    Are you:
    1. importing a CSV file into APEX
    2. adding an extra column to the Oracle Table
    3. populating the extra column with the CSV filename?
    Let us know if this is what you are trying to do.
    Cheers,
    Patrick Cimolini

  • Dynamic loading tree and data grid

    Hi All,
    I new to java as well as JSF. I am very impressed with the jsf and Sun Java Creator IDE. I made a sample project.
    Now I want to load tree and data grid with dynamic values how can I achieve this.
    Please help to find out some examples.
    Also I need to know who I can use SOAP call using JSF.
    Thanks
    CSCS

    To dynamically load a Basic Table (ui:table) from a database, see http://developers.sun.com/prodtech/javatools/jscreator/learning/tutorials/2/databoundcomponents.html
    To dynamically load a Basic Table from other sources of data that are loaded into an array or such, see http://blogs.sun.com/roller/page/divas?entry=table_component_sample_project
    To dynamically CREATE a Basic Table, see http://developers.sun.com/prodtech/javatools/jscreator/reference/tips/2/createTableDynamically.html and http://developers.sun.com/prodtech/javatools/jscreator/reference/tips/2/add_component_to_table.html
    To dynamically create an HTML table on the fly, see section 7.5 in Chapter 7 of the Field Guide at http://developers.sun.com/prodtech/javatools/jscreator/learning/bookshelf/index.html
    To dynamically create a tree, see Dynamic Tree example at http://developers.sun.com/prodtech/javatools/jscreator/reference/index.jsp.
    A tutorial for dynamically creating a tree from a database is work in progress.
    Hope this helps,
    Chris

  • Dynamically loaded content?

    Can Catalyst (current beta) dynamically load text and images?  If not, will the release version have this capability?

    You can create a SWF file with Flash CS3 or CS4, to load textes or images dynamically.
    Then you import ("Import Artwork ...") the SWF file into Catalyst. That s all.
    More details (as far as i know) :
    - if you write actionscript, dont use the "root" keyword (as the SWF ll be embed in the Catalyst project)
    - if you need extra files (ex: a TXT file to set which image has to be loaded), paste them in the "src/assets" directory (from the "code view" of Catalyst)
    - if you need to edit such files : open them with the "system application" (again, from the "code view")

  • Loading leap year date using SQL*Loader

    Hello,
    I have a problem loading a date '29/02/2000' using SQL*Loader. This date is on a leap year. I'm getting an error message from SQL*Loader as 'ORA-01839: date not valid for month specified'. My colleague and I have tried using various date functions to convert the data into date, but no luck.
    I would appreciate any helps,
    Bruce

    Thanks for your help, I found the bug on my control file. I was using the RTRIM function to remove bad timestamp such as '29/02/2000 0:00:00'. So instead of using this statement:
    LOG_DATE DATE "DD/MM/RRRR" "RTRIM(:LOG_DATE,'0:00:00')"
    I was using the statement below with a space before the '0:00:00' string literal, with the intention to remove a space also:
    LOG_DATE DATE "DD/MM/RRRR" "RTRIM(:LOG_DATE,' 0:00:00')"
    Well, it turned out that if there was a space before the string literal, RTRIM function would trim the matching string plus any '0' characters from the right, including the '000' that belongs to '2000'. Thus, the error.
    Thanks again,
    Bruce

  • How to extract data using xml datatype

    Hi,
    I tried the following example using xml data type , but not getting the required output.
    could you please correct the query so as to get the required one
    CREATE TABLE TEST.EMP_DETAIL
      EMPNO       NUMBER,
      ENAME       VARCHAR2(32 BYTE),
      EMPDETAILS  SYS.XMLTYPE
    Insert into EMP_DETAIL
       (EMPNO, ENAME, EMPDETAILS)
    Values
       (7, 'Martin', XMLTYPE('<Dept>
      <Emp Empid="1">
        <EmpName>Kevin</EmpName>
        <Empno>50</Empno>
        <DOJ>20092008</DOJ>
        <Grade>E3</Grade>
        <Sal>3000</Sal>
      </Emp>
      <Emp Empid="2">
        <EmpName>Coster</EmpName>
        <Empno>60</Empno>
        <DOJ>01092008</DOJ>
        <Grade>E1</Grade>
        <Sal>1000</Sal>
      </Emp>
      <Emp Empid="3">
        <EmpName>Samuel</EmpName>
        <Empno>70</Empno>
        <DOJ>10052008</DOJ>
        <Grade>E2</Grade>
        <Sal>2530</Sal>
      </Emp>
      <Emp Empid="4">
        <EmpName>Dev</EmpName>
        <Empno>80</Empno>
        <DOJ>10032007</DOJ>
        <Grade>E2</Grade>
        <Sal>1200</Sal>
      </Emp>
    </Dept>
    '));I need to get the record for Empid="2"
    So tried the following query with no expected o/p
    SELECT a.empno,a.ename,a.empdetails.extract('//Dept/Emp/EmpName/text()').getStringVal() AS "EmpNAME",
         a.empdetails.extract('//Dept/Emp/Empno/text()').getStringVal() AS "EMPNumber",
          a.empdetails.extract('//Dept/Emp/DOJ/text()').getStringVal() AS "DOJ",
          a.empdetails.extract('//Dept/Emp/Grade/text()').getStringVal() AS "Grade",
          a.empdetails.extract('//Dept/Emp/Sal/text()').getStringVal() AS "Salary",
          a.empdetails.extract('//Dept/Emp[@Empid="2"]').getStringVal() AS "ID",
          a.empdetails.extract('//Dept/Emp[EmpName="Coster"]').getStringVal() AS "CHK"
         FROM emp_detail a
         where empno=7 
               AND a.empdetails.existsNode('//Dept/Emp[@Empid="2"]') =1thanks..

    I am not very good at this... But Shouldn't your XML be more like this
    SQL> Insert into EMP_DETAIL
      2     (EMPNO, ENAME, EMPDETAILS)
      3   Values
      4     (7, 'Martin', XMLTYPE('<Dept>
      5    <Emp>
      6      <Empid>1</Empid>
      7      <EmpName>Kevin</EmpName>
      8      <Empno>50</Empno>
      9      <DOJ>20092008</DOJ>
    10      <Grade>E3</Grade>
    11      <Sal>3000</Sal>
    12    </Emp>
    13    <Emp>
    14      <Empid>2</Empid>
    15      <EmpName>Coster</EmpName>
    16      <Empno>60</Empno>
    17      <DOJ>01092008</DOJ>
    18      <Grade>E1</Grade>
    19      <Sal>1000</Sal>
    20    </Emp>
    21    <Emp>
    22      <Empid>3</Empid>
    23      <EmpName>Samuel</EmpName>
    24      <Empno>70</Empno>
    25      <DOJ>10052008</DOJ>
    26      <Grade>E2</Grade>
    27      <Sal>2530</Sal>
    28    </Emp>
    29    <Emp>
    30      <Empid>4</Empid>
    31      <EmpName>Dev</EmpName>
    32      <Empno>80</Empno>
    33      <DOJ>10032007</DOJ>
    34      <Grade>E2</Grade>
    35      <Sal>1200</Sal>
    36    </Emp>
    37  </Dept>
    38  '));
    1 row created.so that you can
    SQL> SET LINESIZE 250
    SQL> COLUMN EMPNAME FORMAT A20
    SQL> COLUMN EMPNUMBER FORMAT A2
    SQL> COLUMN DOJ FORMAT A10
    SQL> COLUMN GRADE FORMAT A10
    SQL> COLUMN SALARY FORMAT A10
    SQL> SELECT a.empno,a.ename,a.empdetails.extract('//Dept/Emp[Empid="2"]/EmpName/text()').getStringVal() AS "EmpNAME",
      2        a.empdetails.extract('//Dept/Emp[Empid="2"]/Empno/text()').getStringVal() AS "EMPNumber",
      3        a.empdetails.extract('//Dept/Emp[Empid="2"]/DOJ/text()').getStringVal() AS "DOJ",
      4        a.empdetails.extract('//Dept/Emp[Empid="2"]/Grade/text()').getStringVal() AS "Grade",
      5        a.empdetails.extract('//Dept/Emp[Empid="2"]/Sal/text()').getStringVal() AS "Salary"
      6   FROM emp_detail a
      7  /
         EMPNO ENAME                            EmpNAME              EM DOJ        Grade      Salary
             7 Martin                           Coster               60 01092008   E1         1000Edited by: Karthick_Arp on Apr 30, 2009 2:21 AM

  • Initial full load of Master data using process chain

    Hi All,
    Could you please help me regarding, initial master data load to characteristics with attributes and text. I need to load master data to 23 info objects, by using process chain can I do full load of master data to all info objects at a time. And one more doubt is, as per my knowledge we can't maintain more than one variant in an info package, is that right ? or we can ?
    Means Start Variant -> Info Package (0Customer_Text, 0Customer_Attr,0BILL_TYPE_TEXT, BILL_CAT_TEXT) -> DTP ( ", ", ", ") -> ACR.
    Your Help will be appreciated.
    Thanks & Regards
    Sunil

    Hi,
    "I need to load master data to 23 info objects, by using process chain can I do full load of master data to all info objects at a time."
    if there is no dependency between attributes then you add you can create process chains and trigger them at a time. No issues.
    we can't maintain more than one variant in an info package, is that right ? or we can ?
    With one info pack you can't load data to all 23 psa. because each data source have own psa. you need to sue 23 info packs.
    in general start variant--> info pack --> dtp (assuming as your bw 7.x)---> attribute change run.
    like that you need to create 23 chains 
    Or create one two big chains.
    one is for attribute and another for text.
    In attribute
    start varaint--> info pack(info bject 1)--DTP(infoobject 1))--> info pack(infoo bject 2)-->dtp(infoobject 2).
    Like that way you can create in series and parallel chains to load attributes data into info objects. at end you add change run for 6 info objects each. SAme you can do for text loads also.
    Thanks

  • XML generation with SAP data using XML schema - Reg

    Hello experts,
      My requirement is , SAP( ztable data )  data has to be transferred to third party software folder.Third party using XML so they requires output from SAP in XML format.
    For that third party software guys told me that they will give their own XML schema to me.I have to generate XML file with SAP data using their XML schema.
    Generating XML file with their Schema should be underlined.
    I studied that call transformation statement helps for this.
    Even then i don't have clear idea about this topic.
    Please brief me about how to use their XML schema to generate XML with my own sap data.
    Thanks in advance experts.
    Kumar

    please  try this  same program    and see  it ....
    *& Report  z_xit_xml_check
      REPORT  z_xit_xml_check.
      TYPE-POOLS: ixml.
      TYPES: BEGIN OF t_xml_line,
              data(256) TYPE x,
            END OF t_xml_line.
      DATA: l_ixml            TYPE REF TO if_ixml,
            l_streamfactory   TYPE REF TO if_ixml_stream_factory,
            l_parser          TYPE REF TO if_ixml_parser,
            l_istream         TYPE REF TO if_ixml_istream,
            l_document        TYPE REF TO if_ixml_document,
            l_node            TYPE REF TO if_ixml_node,
            l_xmldata         TYPE string.
      DATA: l_elem            TYPE REF TO if_ixml_element,
            l_root_node       TYPE REF TO if_ixml_node,
            l_next_node       TYPE REF TO if_ixml_node,
            l_name            TYPE string,
            l_iterator        TYPE REF TO if_ixml_node_iterator.
      DATA: l_xml_table       TYPE TABLE OF t_xml_line,
            l_xml_line        TYPE t_xml_line,
            l_xml_table_size  TYPE i.
      DATA: l_filename        TYPE string.
      PARAMETERS: pa_file TYPE char1024 DEFAULT 'c:temporders_dtd.xml'.
    * Validation of XML file: Only DTD included in xml document is supported
      PARAMETERS: pa_val  TYPE char1 AS CHECKBOX.
      START-OF-SELECTION.
    *   Creating the main iXML factory
        l_ixml = cl_ixml=>create( ).
    *   Creating a stream factory
        l_streamfactory = l_ixml->create_stream_factory( ).
        PERFORM get_xml_table CHANGING l_xml_table_size l_xml_table.
    *   wrap the table containing the file into a stream
        l_istream = l_streamfactory->create_istream_itable( table = l_xml_table
                                                        size  = l_xml_table_size ).
    *   Creating a document
        l_document = l_ixml->create_document( ).
    *   Create a Parser
        l_parser = l_ixml->create_parser( stream_factory = l_streamfactory
                                          istream        = l_istream
                                          document       = l_document ).
    *   Validate a document
        IF pa_val EQ 'X'.
          l_parser->set_validating( mode = if_ixml_parser=>co_validate ).
        ENDIF.
    *   Parse the stream
        IF l_parser->parse( ) NE 0.
          IF l_parser->num_errors( ) NE 0.
            DATA: parseerror TYPE REF TO if_ixml_parse_error,
                  str        TYPE string,
                  i          TYPE i,
                  count      TYPE i,
                  index      TYPE i.
            count = l_parser->num_errors( ).
            WRITE: count, ' parse errors have occured:'.
            index = 0.
            WHILE index < count.
              parseerror = l_parser->get_error( index = index ).
              i = parseerror->get_line( ).
              WRITE: 'line: ', i.
              i = parseerror->get_column( ).
              WRITE: 'column: ', i.
              str = parseerror->get_reason( ).
              WRITE: str.
              index = index + 1.
            ENDWHILE.
          ENDIF.
        ENDIF.
    *   Process the document
        IF l_parser->is_dom_generating( ) EQ 'X'.
          PERFORM process_dom USING l_document.
        ENDIF.
    *&      Form  get_xml_table
      FORM get_xml_table CHANGING l_xml_table_size TYPE i
                                  l_xml_table      TYPE STANDARD TABLE.
    *   Local variable declaration
        DATA: l_len      TYPE i,
              l_len2     TYPE i,
              l_tab      TYPE tsfixml,
              l_content  TYPE string,
              l_str1     TYPE string,
              c_conv     TYPE REF TO cl_abap_conv_in_ce,
              l_itab     TYPE TABLE OF string.
        l_filename = pa_file.
    *   upload a file from the client's workstation
        CALL METHOD cl_gui_frontend_services=>gui_upload
          EXPORTING
            filename   = l_filename
            filetype   = 'BIN'
          IMPORTING
            filelength = l_xml_table_size
          CHANGING
            data_tab   = l_xml_table
          EXCEPTIONS
            OTHERS     = 19.
        IF sy-subrc <> 0.
          MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                     WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        ENDIF.
    *   Writing the XML document to the screen
        CLEAR l_str1.
        LOOP AT l_xml_table INTO l_xml_line.
          c_conv = cl_abap_conv_in_ce=>create( input = l_xml_line-data replacement = space  ).
          c_conv->read( IMPORTING data = l_content len = l_len ).
          CONCATENATE l_str1 l_content INTO l_str1.
        ENDLOOP.
        l_str1 = l_str1+0(l_xml_table_size).
        SPLIT l_str1 AT cl_abap_char_utilities=>cr_lf INTO TABLE l_itab.
        WRITE: /.
        WRITE: /' XML File'.
        WRITE: /.
        LOOP AT l_itab INTO l_str1.
          REPLACE ALL OCCURRENCES OF cl_abap_char_utilities=>horizontal_tab IN
            l_str1 WITH space.
          WRITE: / l_str1.
        ENDLOOP.
        WRITE: /.
      ENDFORM.                    "get_xml_table
    *&      Form  process_dom
      FORM process_dom USING document TYPE REF TO if_ixml_document.
        DATA: node      TYPE REF TO if_ixml_node,
              iterator  TYPE REF TO if_ixml_node_iterator,
              nodemap   TYPE REF TO if_ixml_named_node_map,
              attr      TYPE REF TO if_ixml_node,
              name      TYPE string,
              prefix    TYPE string,
              value     TYPE string,
              indent    TYPE i,
              count     TYPE i,
              index     TYPE i.
        node ?= document.
        CHECK NOT node IS INITIAL.
        ULINE.
        WRITE: /.
        WRITE: /' DOM-TREE'.
        WRITE: /.
        IF node IS INITIAL. EXIT. ENDIF.
    *   create a node iterator
        iterator  = node->create_iterator( ).
    *   get current node
        node = iterator->get_next( ).
    *   loop over all nodes
        WHILE NOT node IS INITIAL.
          indent = node->get_height( ) * 2.
          indent = indent + 20.
          CASE node->get_type( ).
            WHEN if_ixml_node=>co_node_element.
    *         element node
              name    = node->get_name( ).
              nodemap = node->get_attributes( ).
              WRITE: / 'ELEMENT  :'.
              WRITE: AT indent name COLOR COL_POSITIVE INVERSE.
              IF NOT nodemap IS INITIAL.
    *           attributes
                count = nodemap->get_length( ).
                DO count TIMES.
                  index  = sy-index - 1.
                  attr   = nodemap->get_item( index ).
                  name   = attr->get_name( ).
                  prefix = attr->get_namespace_prefix( ).
                  value  = attr->get_value( ).
                  WRITE: / 'ATTRIBUTE:'.
                  WRITE: AT indent name  COLOR COL_HEADING INVERSE, '=',
                                   value COLOR COL_TOTAL   INVERSE.
                ENDDO.
              ENDIF.
            WHEN if_ixml_node=>co_node_text OR
                 if_ixml_node=>co_node_cdata_section.
    *         text node
              value  = node->get_value( ).
              WRITE: / 'VALUE     :'.
              WRITE: AT indent value COLOR COL_GROUP INVERSE.
          ENDCASE.
    *     advance to next node
          node = iterator->get_next( ).
        ENDWHILE.
      ENDFORM.                    "process_dom
    reward  points  if it is use fulll ....
    Girish

  • Using a DropDownList in a DataGrid, both with dynamically loaded content

    I just bought FlashBuilder 4.5 and even though I have been using ActionScript for years, I am having the hardest time to solve a seemingly simple task:
    I have a database table with names of employees:
    id
    name
    departmentid
    1
    Janet Jackson
    2
    2
    Frank Zappa
    2
    3
    John Travolta
    1
    in another table I have the departments
    id
    Department
    1
    Acting Department
    2
    Music Department
    What I want is a DataGrid with a DropDownList itemRenderer for the Department so that I can selected the Department by name and not by id. This should be a no-brainer (and with HTML and PHP I have done that hundreds of times), but with Flex I can not figure out how to do this. This is what I have done so far:
    Created the DataGrid, generated the database service and dragged it to the datagrid to bind the data. Works.
    Then I created an itemRenderer for departmentid
    In the department itemRenderer I dragged a DropDownList element, created a database service for the departments and dragged it onto that to get the databinding.
    So far, so good. When I start it, I have a populated datagrid with a DropDownList that shows all available departments when I click on it.
    What I need, of course, is that the Department DropDownList now shows the Department of the Employee row. When I change the Department in the DropDownList, it should update the Employee Database table.
    I literally spend now days on trying to figure this out and can't find anything on the Internet that would help me. If you could give me some advise or even show me how the code needs to look, it would be GREATLY appreciated.
    I am pasting here also the code:
    <?xml version="1.0" encoding="utf-8"?>
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                      xmlns:s="library://ns.adobe.com/flex/spark"
                      xmlns:mx="library://ns.adobe.com/flex/mx"
                      xmlns:employeeservice="services.employeeservice.*"
                      width="982" height="380" minWidth="955" minHeight="600">
         <fx:Script>
              <![CDATA[
                   import mx.controls.Alert;
                   import mx.events.FlexEvent;
                   protected function dataGrid_creationCompleteHandler(event:FlexEvent):void
                        getAllEmployeeResult.token = employeeService.getAllEmployee();
              ]]>
         </fx:Script>
         <fx:Declarations>
              <s:CallResponder id="getAllEmployeeResult"/>
              <employeeservice:EmployeeService id="employeeService"
                                                       fault="Alert.show(event.fault.faultString + '\n' + event.fault.faultDetail)"
                                                       showBusyCursor="true"/>
              <!-- Place non-visual elements (e.g., services, value objects) here -->
         </fx:Declarations>
         <s:DataGrid id="dataGrid" x="52" y="67" width="455"
                        creationComplete="dataGrid_creationCompleteHandler(event)" editable="true"
                        requestedRowCount="4">
              <s:columns>
                   <s:ArrayList>
                        <s:GridColumn dataField="id" headerText="id"></s:GridColumn>
                        <s:GridColumn dataField="firstname" headerText="firstname"></s:GridColumn>
                        <s:GridColumn dataField="lastname" headerText="lastname"></s:GridColumn>
                        <s:GridColumn dataField="departmentid" editable="false" headerText="departmentid"
                                         itemRenderer="components.DepartmentDropDownList"></s:GridColumn>
                   </s:ArrayList>
              </s:columns>
              <s:typicalItem>
                   <fx:Object id="id1" departmentid="departmentid1" firstname="firstname1"
                                lastname="lastname1"></fx:Object>
              </s:typicalItem>
              <s:AsyncListView list="{getAllEmployeeResult.lastResult}"/>
         </s:DataGrid>
    </s:Application>
    Here the code of the itemRenderer:
    <?xml version="1.0" encoding="utf-8"?>
    <s:GridItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009"
                             xmlns:s="library://ns.adobe.com/flex/spark"
                             xmlns:mx="library://ns.adobe.com/flex/mx"
                             xmlns:departmentservice="services.departmentservice.*"
                             width="172" height="34" clipAndEnableScrolling="true">
         <fx:Script>
              <![CDATA[
                   import mx.controls.Alert;
                   import mx.events.FlexEvent;
                   override public function prepare(hasBeenRecycled:Boolean):void {
                        lblData.text = data[column.dataField]
                   protected function dropDownList_creationCompleteHandler(event:FlexEvent):void
                        getAllDepartmentResult.token = departmentService.getAllDepartment();
              ]]>
         </fx:Script>
         <fx:Declarations>
              <s:CallResponder id="getAllDepartmentResult"/>
              <departmentservice:DepartmentService id="departmentService"
                                                            fault="Alert.show(event.fault.faultString + '\n' + event.fault.faultDetail)"
                                                            showBusyCursor="true"/>
         </fx:Declarations>
         <s:Label id="lblData" top="9" left="7"/>
         <s:DropDownList id="dropDownList" x="34" y="5" width="128"
                             creationComplete="dropDownList_creationCompleteHandler(event)"
                             labelField="department">
              <s:AsyncListView list="{getAllDepartmentResult.lastResult}"/>
         </s:DropDownList>
    </s:GridItemRenderer>

    I just bought FlashBuilder 4.5 and even though I have been using ActionScript for years, I am having the hardest time to solve a seemingly simple task:
    I have a database table with names of employees:
    id
    name
    departmentid
    1
    Janet Jackson
    2
    2
    Frank Zappa
    2
    3
    John Travolta
    1
    in another table I have the departments
    id
    Department
    1
    Acting Department
    2
    Music Department
    What I want is a DataGrid with a DropDownList itemRenderer for the Department so that I can selected the Department by name and not by id. This should be a no-brainer (and with HTML and PHP I have done that hundreds of times), but with Flex I can not figure out how to do this. This is what I have done so far:
    Created the DataGrid, generated the database service and dragged it to the datagrid to bind the data. Works.
    Then I created an itemRenderer for departmentid
    In the department itemRenderer I dragged a DropDownList element, created a database service for the departments and dragged it onto that to get the databinding.
    So far, so good. When I start it, I have a populated datagrid with a DropDownList that shows all available departments when I click on it.
    What I need, of course, is that the Department DropDownList now shows the Department of the Employee row. When I change the Department in the DropDownList, it should update the Employee Database table.
    I literally spend now days on trying to figure this out and can't find anything on the Internet that would help me. If you could give me some advise or even show me how the code needs to look, it would be GREATLY appreciated.
    I am pasting here also the code:
    <?xml version="1.0" encoding="utf-8"?>
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                      xmlns:s="library://ns.adobe.com/flex/spark"
                      xmlns:mx="library://ns.adobe.com/flex/mx"
                      xmlns:employeeservice="services.employeeservice.*"
                      width="982" height="380" minWidth="955" minHeight="600">
         <fx:Script>
              <![CDATA[
                   import mx.controls.Alert;
                   import mx.events.FlexEvent;
                   protected function dataGrid_creationCompleteHandler(event:FlexEvent):void
                        getAllEmployeeResult.token = employeeService.getAllEmployee();
              ]]>
         </fx:Script>
         <fx:Declarations>
              <s:CallResponder id="getAllEmployeeResult"/>
              <employeeservice:EmployeeService id="employeeService"
                                                       fault="Alert.show(event.fault.faultString + '\n' + event.fault.faultDetail)"
                                                       showBusyCursor="true"/>
              <!-- Place non-visual elements (e.g., services, value objects) here -->
         </fx:Declarations>
         <s:DataGrid id="dataGrid" x="52" y="67" width="455"
                        creationComplete="dataGrid_creationCompleteHandler(event)" editable="true"
                        requestedRowCount="4">
              <s:columns>
                   <s:ArrayList>
                        <s:GridColumn dataField="id" headerText="id"></s:GridColumn>
                        <s:GridColumn dataField="firstname" headerText="firstname"></s:GridColumn>
                        <s:GridColumn dataField="lastname" headerText="lastname"></s:GridColumn>
                        <s:GridColumn dataField="departmentid" editable="false" headerText="departmentid"
                                         itemRenderer="components.DepartmentDropDownList"></s:GridColumn>
                   </s:ArrayList>
              </s:columns>
              <s:typicalItem>
                   <fx:Object id="id1" departmentid="departmentid1" firstname="firstname1"
                                lastname="lastname1"></fx:Object>
              </s:typicalItem>
              <s:AsyncListView list="{getAllEmployeeResult.lastResult}"/>
         </s:DataGrid>
    </s:Application>
    Here the code of the itemRenderer:
    <?xml version="1.0" encoding="utf-8"?>
    <s:GridItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009"
                             xmlns:s="library://ns.adobe.com/flex/spark"
                             xmlns:mx="library://ns.adobe.com/flex/mx"
                             xmlns:departmentservice="services.departmentservice.*"
                             width="172" height="34" clipAndEnableScrolling="true">
         <fx:Script>
              <![CDATA[
                   import mx.controls.Alert;
                   import mx.events.FlexEvent;
                   override public function prepare(hasBeenRecycled:Boolean):void {
                        lblData.text = data[column.dataField]
                   protected function dropDownList_creationCompleteHandler(event:FlexEvent):void
                        getAllDepartmentResult.token = departmentService.getAllDepartment();
              ]]>
         </fx:Script>
         <fx:Declarations>
              <s:CallResponder id="getAllDepartmentResult"/>
              <departmentservice:DepartmentService id="departmentService"
                                                            fault="Alert.show(event.fault.faultString + '\n' + event.fault.faultDetail)"
                                                            showBusyCursor="true"/>
         </fx:Declarations>
         <s:Label id="lblData" top="9" left="7"/>
         <s:DropDownList id="dropDownList" x="34" y="5" width="128"
                             creationComplete="dropDownList_creationCompleteHandler(event)"
                             labelField="department">
              <s:AsyncListView list="{getAllDepartmentResult.lastResult}"/>
         </s:DropDownList>
    </s:GridItemRenderer>

  • Dynamically load content into a "template" swf from text file

    I have a dream....
    Well, I have a concept. I have not actively pursued Flash in
    several years, though I've continued to have it in my arsenal. I've
    not done much in the action scripting realm for a while though.
    I am trying to create a template that will be used for about
    100 different product pages.
    It would have two tabs, basically, 2 different graphical
    button sets. One will have up to 4 links to similar products, each
    tab will be on the side of a square, and I need the ability to not
    display a tab if there is no actual link.
    As for the other tab, Its a menu that consists of a series of
    lines. This can be an external menu, I just need a way to have
    flash load the right menu. This menu, when you mouse over a line,
    the name of the product appears, as well as a product image that
    gets loaded with the menu. The product images would be external,
    allowing me to simply replace an image if a new higher end version
    of the product comes out.
    So, I am totally not an actionscripter. Looks like I need to
    load variables from an external file. Can I set a property in the
    flash code on the html that tells the movie what dataset to grab
    from?
    Here's basically what I am looking for
    property: value
    (load variables for:)
    item: 44
    (menu1)
    faster: 54b.html
    slower: 34d.html
    left: 43d.html
    right: 45c.html
    (menu2)
    menu:graph5.swf
    (menu loads images from external source)
    link51: 51d.html
    link52: 52c.html
    link53: 53c.html
    link54: 54d.html
    link55: 55b.html
    link56: 56d.html
    A possible third menu would be text driven, and would use
    html to link to various items.
    This is a static site, so urls will be fixed.
    Is it best to build a php page that serves up data for a
    single item, or do one big text file with all 100 or so items? Is
    that even possible?
    My Flash since MX is very rusty. I am using Flash Pro8. I
    would love to create a single file so modifications are to the text
    files, unless a new item is released, then it's updating a single
    flash menu and updating the text file.
    Been spending way too much time in InDesign lately! I used to
    be pretty good at Flash!

    well sorry there fanmap - but I don't think you're going to
    be able to get this to work. here's why: the link points to a php
    file - which gathers dynamic info from a DB - the return from the
    php is generating a string that is based on the DOM and
    'constructs' a javascript method that in turn writes to the html
    document. although we can embed html into a textField in Flash
    there are a limited number of supported html tags - and JS methods
    will not operate internally. in addition, (i'm not certain someone
    correct this if i'm off) there's no way to 'change' the output of
    the php call, therefore you will not be able to read the return
    because it is designed to use the DOM and write solely to the
    current document. Even if you were to access the JS method from the
    swf file (which one can) it will still only write the content of
    the php return to the html document - and the output is not
    compatible with the textField class.

  • Dynamically load content based on parameters

    Hi guys,
    I have a got a CQ design question here:
    We are building a site which will render various header, footer, list of products and some sections of the main body depending on a set of parameters.
    There are over 300 variations of these parameters, therefore we need to create a machnism which helps to determine what content/page to render at runtime.
    We have thought about couple solutions but still not having a clear idea how they will work in CQ:
    1. Use good old queryString, get the parse the queryString, then in the main jsp page, add some logic and decide which jsp to page to include. But this means we will need potentially hundreds if not thousands of jsp pages to render different content.
    2. Use dynamic selector to include dynamic content. But does that eliminate the need of hundreds of jsp pages?
    Also, in CQ, what is the best practice to store these parameters in http session? Or should they be stored in sling http session instead?
    Many thanks!!!

    If your page consists of a combination of distinct building blocks, and for each building block you have a small number a variantions (3-5), you could use SSI on the dispatcher webserver to build the complete page. Then each individual building block can be cached at the dispatcher, reducing the load on CQ5 publishing dramatically.
    cheers,
    Jörg

  • CSV FILES DOESN'T LOAD WITH RIGHT DATA USING SQL LOADER

    Hi pals, I have the following information in csv file:
    MEXICO,Seretide_Q110,2010_SEE_01,Sales Line,OBJECTIVE,MEXICO,Q110,11/01/2010,02/04/2010,Activo,,,MEXICO
    MEXICO,Seretide_Q210,2010_SEE_02,Sales Line,OBJECTIVE,MEXICO,Q210,05/04/2010,25/06/2010,Activo,,,MEXICO
    When I use SQLLOADER the data is loaded as follow:*
    EXICO,Seretide_Q110,2010_SEE_01,Sales Line,OBJECTIVE,MEXICO,Q110,11/01/2010,02/04/2010,Activo,,,MEXICO
    And for the next data in a csv file too:
    MX_001,MEXICO,ASMA,20105912,Not Verified,General,,RH469364,RH469364,Change Request,,,,,,,Y,MEXICO,RH469364
    MX_002,MEXICO,ASMA,30094612,Verified,General,,LCS1405,LCS1405,Change Request,,,,,,,Y,MEXICO,LCS1405
    the data is loaded as follow:
    X_001,MEXICO,ASMA,20105912,Not Verified,General,,RH469364,RH469364,Change Request,,,,,,,Y,MEXICO,RH469364
    X_002,MEXICO,ASMA,30094612,Verified,General,,LCS1405,LCS1405,Change Request,,,,,,,Y,MEXICO,LCS1405
    I mean the first character is truncated and this bug happens with all my data. Any suggestion? I really hope you can help me.
    Edited by: user11260938 on 11/06/2009 02:17 PM
    Edited by: Mariots on 12/06/2009 09:37 AM
    Edited by: Mariots on 12/06/2009 09:37 AM

    Your table and view don't make sense so I created a "dummy" table to match your .ctl file.
    SQL> create table CCI_SRC_MX
      2  (ORG_BU               varchar2(30)
      3  ,name                 varchar2(30)
      4  ,src_num              varchar2(30)
      5  ,src_cd               varchar2(30)
      6  ,sub_type             varchar2(30)
      7  ,period_bu            varchar2(30)
      8  ,period_name          varchar2(30)
      9  ,prog_start_dt        date
    10  ,prog_end_dt          date
    11  ,status_cd            varchar2(30)
    12  ,X_ACTUALS_CALC_DATE  date
    13  ,X_ACTUAL_UPDATE_SRC  varchar2(30)
    14  ,prod_bu              varchar2(30)
    15  ,ROW_ID               NUMBER(15,0)
    16  ,IF_ROW_STAT          VARCHAR2(90)
    17  ,JOB_ID               NUMBER(15,0)
    18  );
    Table created.
    SQL> create sequence GSK_GENERAL_SEQ;
    Sequence created.I simplified your .ctl file and moved all the constant and sequence stuff to the end. I also changed the format masks to match the dates in your data.
    LOAD DATA
    INFILE 'SBSLSLT.txt'
    BADFILE 'SBSLSLT.bad'
    DISCARDFILE 'SBSLSLT.dis'
    APPEND
    INTO TABLE CCI_SRC_MX
    FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
    TRAILING NULLCOLS
    (ORG_BU
    ,NAME
    ,SRC_NUM
    ,SRC_CD
    ,SUB_TYPE
    ,PERIOD_BU
    ,PERIOD_NAME
    ,PROG_START_DT          DATE 'dd/mm/yyyy'
    ,PROG_END_DT            DATE 'dd/mm/yyyy'
    ,STATUS_CD
    ,X_ACTUALS_CALC_DATE    DATE 'dd/mm/yyyy'
    ,X_ACTUAL_UPDATE_SRC
    ,PROD_BU
    ,row_id                 "GSK_GENERAL_SEQ.nextval"
    ,if_row_stat            CONSTANT 'UPLOADED'
    ,job_id                 constant 36889106
    {code}
    When I run SQL Loader, I get this:
    {code}
    SQL> select * from CCI_SRC_MX;
    ORG_BU  NAME           SRC_NUM      SRC_CD      SUB_TYPE   PERIOD_BU  PERIOD_NAME  PROG_START_DT        PROG_END_DT          STATUS_CD  PROD_BU  ROW_ID IF_ROW_STAT    JOB_ID
    MEXICO  Seretide_Q110  2010_SEE_01  Sales Line  OBJECTIVE  MEXICO     Q110         11-JAN-2010 00:00:00 02-APR-2010 00:00:00 Activo     MEXICO        1 UPLOADED     36889106
    MEXICO  Seretide_Q210  2010_SEE_02  Sales Line  OBJECTIVE  MEXICO     Q210         05-APR-2010 00:00:00 25-JUN-2010 00:00:00 Activo     MEXICO        2 UPLOADED     36889106
    {code}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Loading FLat file data using FDMEE having 1 to many mapping

    Hi All,
    I need to load a data from Flat file to hyperion planning applcation using FDMEE having one to many mapping
    For e.g Data file has 2 records
    Acc Actual Version1 Scene1 1000
    Acc Actual Version1 Scene2 2000
    now target application has 5 dimension and data need to be load as
    acc Actual Version1 entity1 Prod2 1000
    Acc Actual Version1 Entity2 Prod2 2000
    Please suggest
    Regards
    Anubhav

    From your exmple I don't see the one too many mapping requirement. You have one source data line that maps to a single target intersection. Where is the one to many mapping requirement in your example?

  • How to delete large data using XML batch in chunk

    public void DeleteListItems(SPWeb web, SPList list)
    RMPExceptionManager.LogErrorInFile("--------Delete List Items from : " + list + " starts--------", true);
    try
    web.AllowUnsafeUpdates = true;
    StringBuilder builder = new StringBuilder();
    builder.Append("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Batch>");
    string s = "<Method>" +
    "<SetList Scope=\"Request\">" + list.ID + "</SetList>" +
    "<SetVar Name=\"ID\">{0}</SetVar>" +
    "<SetVar Name=\"Cmd\">Delete</SetVar>" +
    "</Method>";
    foreach (SPListItem item in list.Items)
    builder.Append(string.Format(s, item.ID.ToString()));
    builder.Append("</Batch>");
    web.ProcessBatchData(builder.ToString());
    web.AllowUnsafeUpdates = false;
    RMPExceptionManager.LogErrorInFile("--------Delete List Items from : " + list + " ends--------", true);
    catch (Exception ex)
    RMPExceptionManager.LogErrorInFile("--------delete List Items exception--------", bIsLogEnabled);
    RMPExceptionManager.LogErrorInFile(ex.Message, bIsLogEnabled);
    RMPExceptionManager.LogErrorInFile(ex.Source, bIsLogEnabled);
    RMPExceptionManager.LogErrorInFile(ex.StackTrace, bIsLogEnabled);
    RMPExceptionManager.LogErrorInFile("-------------------------------------------------------", bIsLogEnabled);
    I am using the above code to delete the data from list.
    currently its not deleting properly as its executing huge xml batch.
    How can I change the above code in to chunk of 1000 so that I can delete 25000 records easily?

    I tried the below code but its not working properly.
    first time when it comes in do loop its deleting the records one by one and not using batch of 1000.
    after some time(aprox 30 min) it starts executeing batch of 1000 but not deleting whole records. out of 10,000 its deleting hardly 7000 then stops the delete process and jumps on next step.
    I am not getting why its showing this behaivour ? Is it time out after some time in xml batch? but its still executing the other code after comming out of delete function.
    web.AllowUnsafeUpdates = true;
    StringBuilder builder = new StringBuilder();
    builder.Append("<?xml version=\"1.0\" encoding=\"UTF-8\"?><Batch>");
    string s = "<Method>" +
    "<SetList Scope=\"Request\">" + list.ID + "</SetList>" +
    "<SetVar Name=\"ID\">{0}</SetVar>" +
    "<SetVar Name=\"Cmd\">Delete</SetVar>" +
    "</Method>";
    // Query to get the unprocessed items.
    SPQuery query = new SPQuery();
    query.RowLimit = 1000;
    query.Query = "<Where></Where>";
    do
    SPListItemCollection remainingItems = list.GetItems(query);
    foreach (SPListItem item in remainingItems)
    builder.Append(string.Format(s, item.ID.ToString()));
    builder.Append("</Batch>");
    web.ProcessBatchData(builder.ToString());
    query.ListItemCollectionPosition = remainingItems.ListItemCollectionPosition;
    RMPExceptionManager.LogErrorInFile("--------Delete batch remaining : " + remainingItems.ListItemCollectionPosition + " --------", true);
    } while (query.ListItemCollectionPosition != null);
    any body got this type of issue?
    is there any problem in above code?
    is there any other way to do this deletion process in better way?

Maybe you are looking for

  • Safari doesn't open after i updated it to 1.6.8

    Safari doesn't open after i updated it to 1.6.8

  • Mail deleted account lost inbox and sent mail

    I was editing an account with on IT(not a MAC user) person yesterday to check my work mail from a diferent server. In the process my old work account got deleted so I lost all of my incoming and sent mail from the account that was deleted. After that

  • Importing black & white raw photos doesn't work from a Canon Rebel XT

    I have a Canon rebel XT digital SLR camera. I usually take pictures in RAW format and they import fine to iphoto but recently I decided to change the settings on the the camera to take in black and white. When I import these RAW (cr2) black and white

  • How do I locate the errors I am given when I save?

    When I save my workbook it tells me "Some cells or styles in this workbook contain formatting that is not supported by the selected file format. These formats will be converted to the closest format available." And that it happens 11 times. Is there

  • Error in LDAP Server

    warning<20805> -Backend DataBase- conn=519183 op=0 msgId=1-search is not indexed. I am getting this error daily every time.I got the root cause for this error.I have increased the nsslapd-allidsthreshold value and nsslapd-dbcachesize.I am getting the