How to get input fields based on selection

Hi
i have dropdown which cointains 1 to 10 numbers,as soon as we select 2 in dropdown 2 input fields should be displayed.can u please help me in solving this problem
thanks
kishore

HI,
1:Add one child TransparentContainer to RootContainer with id TransparentContainer1
2:Take one attribute of type integer in context
3:When dropdown selected set the selected value to this attribute like
wdContext.currentcontextElement().set<value>(wdContext.current<DDNode>Element().get<DDValue>);
4:And in do modify view Method, put following code
IWDTransparentContainer tc=(IWDTransparentContainer)view.getElement("TransparentContainer1");
if(tc!=null)
     tc.destroyAllChildren();
    int number=wdContext.currentContextElement().getNumber();
    IWDNodeInfo info=wdContext.getNodeInfo();
    if(!(wdContext.isEmpty()))
          wdContext.getContext().reset(false);
    for(int i=0;i<number;i++)
         IWDInputField inp=(IWDInputField)view.createElement(IWDInputField.class,"inp"+i);
         info.addAttribute("val"+i,"com.sap.dictionary.double");
         inp.bindValue("val"+i);
         tc.addChild(inp);
Regards
LakshmiNarayana

Similar Messages

  • How to get Input field value?

    Hi All,
    I have some problem in getting of input value from View to customcontroller.
    My problem is I have created a Input field in the view and if Iam giving the value to that field I can capture the value from View to customcontroller and send it as BAPI input.But My input filed is in the view Context.
    How can i capture InputFiled value from View to CustomController.
    Advance thanks
    Nageswara.
    Message was edited by: nageswar mandapati

    Thanks for your response Patrick,
    In my customcontrollerView all my BAPI mathods instances and execute methods are declared.All the attributes directly getting from model class.
    But I have two views , in first view I created a input field(for that i created valueAttribute in that context).
    Here I want give the conditions If  the input field is empty then directly call the execute method of BAPI.
    Otherwise give any input to the inputfiled then capture that value and send it input to BAPI from view to BAPI.
    In my customcontroller
    BAPI b = new BAPI();
    b.Param1();
    b.param2();
    and
    execute BAPI()
    I done like this.
    How can i capture the view input value how to send as a b.parama();
    Please guide me .
    Any snippests appriciate.
    Thanks
    nageswara.

  • Automatically fill input fields based on selection from dynamic drop down

    Hi All,
    I tried to search before posting, but i cannot find appropriate thread (maybe wrong keyword).
    My scenario:
    1. In my offline interactive form, I have:
        a.  Material Number --> drop down field with "Allow Custom Text Entry" ticked
        b.  1 execution button to call web service
        c.  Material Group - Input Field (Read Only)
    2. User will enter material number with wild card character (eg: ABC*).
        User will then click the execution button.
        Web Service in result will return all materials that match the entered material number.
        Dynamic binding will do the magic to generate the drop down list.
    3. Beside material number, web service will also return material description and material group.
        Below is the illustration:
         Material        Description       Material Group
         ABC              Material ABC               GRP01
         ABCDE        Material ABCDE          GRP02
    --- so far so good ---
    My requirement:
    Every time user select material from the drop down list, i want to auto-populate field "Material Group" (which value is also returned by web service).
    I know i need to put the script on event change of the drop down field.
    But i don't know how to read internal table returned by web service.
    Hope someone can enlighten me.
    Thanks in Advance !!!

    Solved after reading:
    1. /people/juergen.hauser2/blog/2007/09/03/accessing-data-nodes-in-sap-interactive-forms
    2. Chapter 7 of Live Cycle Designer Scripting Basics
    (http://help.adobe.com/en_US/livecycle/9.0/LiveCycle_Designer_Scripting_Basics.pdf)
    Thanks.

  • How to get required fields in the selection screen while filling a set tabl

    hai,
    i was filling the set up table for 2lis_13_vditm.but while filling the set up table in the selection conditions in the tcode OLI9BW.
    I would like to have the a field added in the selection condition which is not existing in the OLI9BW.
    kindly help me out of ths.
    with regards
    soumya.

    As far as I know, you're just limited to whatever fields are in the transaction... That applies for any of the setup tables processes.
    If you need to limit the data that goes to BW, you can do so by putting the logic in CMOD, EXIT_SAPLRSAP_001, Include ZXRSAU01 for the specific extractor.

  • How to enable/disable the input fields based on the data entered/user action in the web dynpro abap?

    How to enable/disable the input fields based on the data entered in the web dynpro application abap?  If the user enters data in one input field then only the next input field should be enabled else it should be in disabled state. Please guide.

    Hi,
    Try this code.
    First create a attribute with the name readonly of type wdy_boolean and bind it read_only property of input field of which is you want to enable or disable.
    Next go to Init method.
    Set the readonly value as 'X'.
    DATA lo_el_context TYPE REF TO if_wd_context_element.
         DATA ls_context TYPE wd_this->element_context.
         DATA lv_visible TYPE wd_this->element_context-visible.
    *   get element via lead selection
         lo_el_context = wd_context->get_element( ).
    *   @TODO handle not set lead selection
         IF lo_el_context IS INITIAL.
         ENDIF.
    *   @TODO fill attribute
    *   lv_visible = 1.
    *   set single attribute
         lo_el_context->set_attribute(
           name =  `READONLY`
           value = 'X').
    After that Go to the Action  ENTER.
    First read the input field ( first input field, which is value entered field) , next give a condition
    if input value is not initial  then set the readonly value is '  '.
    DATA lo_nd_input TYPE REF TO if_wd_context_node.
         DATA lo_el_input TYPE REF TO if_wd_context_element.
         DATA ls_input TYPE wd_this->element_input.
         DATA lv_vbeln TYPE wd_this->element_input-vbeln.
    *   navigate from <CONTEXT> to <INPUT> via lead selection
         lo_nd_input = wd_context->get_child_node( name = wd_this->wdctx_input ).
    *   @TODO handle non existant child
    *   IF lo_nd_input IS INITIAL.
    *   ENDIF.
    *   get element via lead selection
         lo_el_input = lo_nd_input->get_element( ).
    *   @TODO handle not set lead selection
         IF lo_el_input IS INITIAL.
         ENDIF.
    *   get single attribute
         lo_el_input->get_attribute(
           EXPORTING
             name =  `VBELN`
           IMPORTING
             value = lv_vbeln ).
    if lv_vbeln IS not INITIAL.
        DATA lo_el_context TYPE REF TO if_wd_context_element.
        DATA ls_context TYPE wd_this->element_context.
        DATA lv_visible TYPE wd_this->element_context-visible.
    *  get element via lead selection
        lo_el_context = wd_context->get_element( ).
    *  @TODO handle not set lead selection
        IF lo_el_context IS INITIAL.
        ENDIF.
    *  @TODO fill attribute
    *  lv_visible = 1.
    *  set single attribute
        lo_el_context->set_attribute(
          name =  `READONLY`
          value = ' ' ).

  • How to set focus on a input field in a selected row of a table?

    In a previous discussion (http://scn.sap.com/thread/3564789) I asked how to access an input (sap.m.Input) field of a selected row in a table. In the answer that was supplied I was shown how to get the items of the table. Then using the selected index to get the selected item get the cells. Then I could set editable on the proper cell(s). This worked fine.
    Now I need to set the focus on one of the fields. I tried something like this:
                var oNewLink = table.getSelectedItem();
                var oNewLinkName = oNewLink.getCells()[1];
                oNewLinkName.focus();
    But this doesn't seem to work.
    I have searched through other discussions and have seen this technique for putting focus on a field if you have its ID:
    sap.ui.getCore().byId(id_of_the_input_field).$().focus();
    In my case though I do not have an ID since the row and its cells are generated. How can I set focus on the cell of a certain row in a table?

    Hello Venkatesh. Yes that code does work. First I tried it on a table cell that was already rendered and it did work. The next time I tried it on a table row that was being added and it did not work there. So I added an on after rendering function for the table and added that code there. That did not work until I added a delay (timeout) to do a context switch before calling the focus and that worked.
    Once last thing though sometimes when I call focus on an input field (actually in a table row cell) if the field has text in it already the flashing cursor is at the beginning of the text and other times it is at the end of the text (which is the desired way). It depends on where I click in the row. Is there anyway to make sure the flashing cursor is at the end of the text when the focus is applied to a field that contains text?

  • How do we validate input fields on the selection screen

    How do we validate input fields on the selection screen

    hi balram,
    u can validate input fields using <b>AT SELECTION-SCREEN</b>  Event.
    PARAMETERS : p_werks TYPE marc-werks.
    AT SELECTION-SCREEN ON p_werks.
    SELECT SINGLE *
    FROM t001w
    WHERE werks = p_werks.
    IF sy-subrc <> 0.
    MESSAGE 'Invalid Plant' TYPE 'I'.
    ENDIF.
    Like this, we can validate user input for plant.
    check this link:
    http://help.sap.com/saphelp_nw04s/helpdata/en/9f/db9a2e35c111d1829f0000e829fbfe/frameset.htm
    http://help.sap.com/saphelp_nw2004s/helpdata/en/56/1eb6c705ad11d2952f0000e8353423/content.htm
    Reware me if useful......
    Harimanjesh AN

  • How to hide input fields on selection screen using variant attribute

    Hello all,
    I want to know how to hide input fields on selection screen using variant attribute conpletely.
    As you know, when setting the attribute of variant "Hide field" checked, the field is temporarily hidden, but when clicking "All Selections(F7)" button on the selection screen, the fileds become appeared.
    I want to hide the field completely. Di you know how to do ?
    Thank you for your support.
    Regards,
    Hideki Kozai

    Use this attribute hide field and save the variant. Then create transaction for this program setting default variant for parameter Start with variant . The user who runs it will have it by defualt set.
    Otherwise
    in PBO simply use LOOP at screen and output = 0 for this field. This will ensure that field is invisible in any case.
    Regards
    Marcin

  • How to get a field that using variable in order to create a query

    Hi,
    I found a difficulty when creating a query. so, I would like to ask you some question.
    1. How to get a field that using variable which that field I want to put it in my query?
    For example, I would like to take quantity field in inventory audit report. And when I put my cursor in
    quantity field, there was only variable, item, etc. How to get this and put it in query?
    2. How to combined the invoice quantity with inventory audit report quantity?
    3. I have a query like this:
    SELECT distinct T0.[DocDate] as 'Tanggal', T0.[DocNum] as 'No.Faktur', T1.[ItemCode] as 'Kode Barang',
    T1.[Dscription] as 'Deskripsi', T1.[Quantity] as 'Quantity', ((T1.[LineTotal])/(T1.[Quantity])) as 'Harga
    Satuan', T1.[LineTotal] as 'Harga Total', T3.[CalcPrice] as 'HPP Satuan', ((T3.[CalcPrice]) * (T1.
    [Quantity])) as 'HPP Total', T4.[ItmsGrpNam] as 'Jenis Barang', T5.[SlpName] as 'Nama Sales', T1.
    [WhsCode] as 'Kode Gudang' FROM [dbo].[OINV] T0 INNER JOIN [dbo].[INV1] T1 ON T0.DocEntry =
    T1.DocEntry INNER JOIN OITM T2 ON T1.ItemCode = T2.ItemCode INNER JOIN OINM T3 ON T2.ItemCode
    = T3.ItemCode INNER JOIN OITB T4 ON T2.ItmsGrpCod = T4.ItmsGrpCod INNER JOIN OSLP T5 ON
    T0.SlpCode = T5.SlpCode WHERE T3.[TransType] = '13' and T3.[CreatedBy] = T1.[DocEntry] and T0.
    [DocDate] >=[%0] and T0.[DocDate] <=[%1] and T4.[ItmsGrpNam] =[%2] and T1.[WhsCode] =[%3]
    Is it possible if I just take one invoice with invoice quantity and only show up at once although I have a
    lot item cost for that item? (because I'm using FIFOmethod).
    Please help me.. cause I'm stuck with this thing :l.
    Thank you very much, and I'm waiting your respon soon.
    Regards,
    Sisca

    Try this one:
    SELECT distinct T0.DocDate as 'Tanggal', T0.DocNum as 'No.Faktur', T1.ItemCode as 'Kode Barang',
    T1.Dscription as 'Deskripsi', T1.Quantity as 'Quantity', ((T1.LineTotal)/(T1.Quantity)) as 'Harga
    Satuan', T1.LineTotal as 'Harga Total', T3.CalcPrice as 'HPP Satuan', ((T3.CalcPrice) * (T1.
    Quantity)) as 'HPP Total', T4.ItmsGrpNam as 'Jenis Barang', T5.SlpName as 'Nama Sales', T1.
    WhsCode as 'Kode Gudang'
    FROM dbo.OINV T0 INNER JOIN dbo.INV1 T1 ON T0.DocEntry =T1.DocEntry
    INNER JOIN OITM T2 ON T1.ItemCode = T2.ItemCode
    INNER JOIN OINM T3 ON T2.ItemCode = T3.ItemCode AND T3.TransType = '13' and T3.CreatedBy = T1.DocEntry AND T3.Warehouse = T1.WhsCode
    INNER JOIN OITB T4 ON T2.ItmsGrpCod = T4.ItmsGrpCod
    INNER JOIN OSLP T5 ON T0.SlpCode = T5.SlpCode
    WHERE T0.DocDate >=[%0\] and T0.DocDate <=[%1\] and T4.ItmsGrpNam =[%2\] and T1.WhsCode =[%3\]
    Thanks,
    Gordon

  • How to get fiscal period based on date and Fiscal year?

    Hi Guys,
               Can anybody tell me how to get Fiscal period based on date and Fiscal Year or fiscal year variant?
    Thanks,
    Gopi.

    Hi,
    Please refer the code below:
    *: Report:  ZFISCALYR                                                  :
    *: Date  :  2004                                                       :
    *: Description: Demonstrates how to return the corresponding fiscal    :
    *:              year and posting period for a company code and posting :
    *:              date or posting date and fiscal year variant.          :
    REPORT  zfiscalyr NO STANDARD PAGE HEADING.
    TABLES: ekko.
    PARAMETERS:     p_bukrs TYPE ekko-bukrs,
                    p_bedat TYPE ekko-bedat.
    DATA: gd_fiscalyr  TYPE bapi0002_4-fiscal_year,
          gd_fiscalp   TYPE bapi0002_4-fiscal_period.
    DATA: gd_fiscalyr2 TYPE T009B-BDATJ,
          gd_fiscalp2  TYPE bapi0002_4-fiscal_period.
    DATA: gd_periv     TYPE t009-periv.
    *START-OF-SELECTION.
    START-OF-SELECTION.
    * get fiscal year and period - (requires date and company code)
      CALL FUNCTION 'BAPI_COMPANYCODE_GET_PERIOD'
        EXPORTING
          companycodeid = p_bukrs
          posting_date  = p_bedat
        IMPORTING
          fiscal_year   = gd_fiscalyr
          fiscal_period = gd_fiscalp.
    * Alternative fiscal year function module
    * - (requires date and fiscal year variant code from T009 table)
    * gets first entry in fiscal year variant table (will need to choose
    * correct one from table rather than just using first entry)
      SELECT SINGLE periv
        FROM t009
        INTO gd_periv.
    * get fiscal year and period
      CALL FUNCTION 'DETERMINE_PERIOD'
        EXPORTING
          date                      = p_bedat
    *    PERIOD_IN                 = '000'
          version                   = gd_periv
       IMPORTING
          period                    = gd_fiscalp2
          year                      = gd_fiscalyr2
       EXCEPTIONS
          period_in_not_valid       = 1
          period_not_assigned       = 2
          version_undefined         = 3
          OTHERS                    = 4.
    *END-OF-SELECTION.
    END-OF-SELECTION.
      WRITE:/ 'From function module: BAPI_COMPANYCODE_GET_PERIOD',
            / 'Fiscal year is:', gd_fiscalyr,
            / 'Fiscal period is:', gd_fiscalp.
      SKIP.
      WRITE:/ 'From function module: DETERMINE_PERIOD',
            / 'Fiscal year is:', gd_fiscalyr2,
            / 'Fiscal period is:', gd_fiscalp2.
    Thanks,
    Sriram Ponna.
    Edited by: Sriram Ponna on Apr 17, 2008 8:59 PM

  • How to get the values from html:select? tag..?

    i tried with this, but its not working...
    <html:select styleClass="text" name="querydefs" property="shortcut"
                 onchange="retrieveOptions()" styleId="firstBox" indexed="true">
    <html:options collection="advanced.choices" property="shortcut" labelProperty="label" />
    </html:select>
                        <td align="left" class="rowcolor1">
                        <script language="javascript" type="text/javascript">
                              function retrieveOptions(){
                             var sel = document.querydefs.options;
                             var selectedOption = sel[sel.selectedIndex].value;
                             document.write(selectedOption);
                           </script>

    <td align="left" class="rowcolor1">
                        <script language="javascript" type="text/javascript">
                              function retrieveOptions(){
                             var sel = document.querydefs.options;
                             var selectedOption = sel[sel.selectedIndex].value;
                             document.write(selectedOption);
                           </script>This java script is not working at all..its not printing anything in document.write();
    This is code..
    <td class="rowcolor1" width="20%">
    <html:select styleClass="text" name="querydefs" property="shortcut"
                             onchange="retrieveSecondOptions()" styleId="firstBox"
                             indexed="true">
                             <html:options collection="advanced.choices" property="shortcut"
                                  labelProperty="label"  />
                        </html:select>i tried with this also. but no use..i'm not the getting the seleced option...
    function retrieveOptions(){
    firstBox = document.getElementById('firstBox');
                             if(firstBox.selectedIndex==0){
          return;
        selectedOption = firstBox.options[firstBox.selectedIndex].value;
    }actually , how to get the values from <html:select> ...?
    my idea is to know which value is selected from the combo box(<html:select> ) if that value is equal some string i have enable a hyperlink to open a popup window

  • How to get subquery field in the output

    Hi,
    How to get segment_name in the output.
    select file_name,tablespace_name form dba_data_files where tablespace_name in(SELECT a.tablespace_name from dba_data_files a,user_segments b
    where a.tablespace_name=b.tablespace_name and b.segment_name='EMP')
    Regards,
    Venkat

    Hi,
    Any one can Answer my question.
    Regards,
    Venkat

  • How to get the field COMPLETION in extract layout

    Hi,
    Does anyone knows How to get the field COMPLETION in extract layout? i have not been able to find it and it is imperative to have it for implementing a new evaluation.
    Thanks a lot for your help.
    CAMILO URIBE

    Hi Neil,
    The following steps describe what we did to get the new evaluation:
    1. Define Attributes and Object Types for Evaluations: here we added a new field for evaluation. The field was COMPLETION (degree of processing in percent), with relevant object "TASK". "No Summarization" was configurated as Rule for Summarization
    2. Define Extract Layouts: here we created a new extract layout for evaluation. The objects and attributes to be used were defined (the field COMPLETION  was defined as attribute).
    3. Assign Extract Layouts to Project Types.
    4. Define Evaluations: the new layout for evaluation were created using the attributes.
    5. Define Severity.
    6. Define Threshold Values. In the new evaluation the field COMPLETION was used in the formula.
    After configurating and testing, we have noticed that the values of field COMPLETION are not taking into account. It does not matter which value it has, evaluation always take 0.
    Thanks for your help,
    CAMILO URIBE

  • How to get the field name of an internal table during runtime?

    How to get the field name of an internal table during runtime?

    Hi  Sudhir,
    Declare and Use Get Cursor Field in Your Prm to get the field Name of the Intenal Table
    Example Code:
        <b>  DATA: v_field(60).                        " Insert this code.
         GET CURSOR FIELD v_field.        " Insert this code.</b>
         <b>CHECK v_field = 'ITAB-KUNNR'.    " Insert this code. (or)
    Write: v_field.</b>
    Regards,
    Ramganesan K.

  • How to get the path when i select a directory or a file in a JTree

    How to get the path when i select a directory or a file in a JTree

    import java.lang.*;
    import java.io.*;
    import javax.swing.*;
    import javax.swing.tree.*;
    import java.awt.HeadlessException;
    import javax.swing.event.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.util.Iterator;
    * @author Frederic FOURGEOT
    * @version 1.0
    public class JTreeFolder extends JPanel {
    protected DefaultMutableTreeNode racine;
    JTree tree;
    protected JScrollPane scrollpane;
    final static int MAX_LEVEL = 1; // niveau max de descente "direct" dans l'arborescence
    * Sous-classe FSNode
    * @author Frederic FOURGEOT
    * @version 1.0
    private class FSNode extends DefaultMutableTreeNode {
    File file; // contient le fichier li� au noeud
    * Constructeur non visible
    private FSNode() {
    super();
    * Constructeur par initialisation
    * @param userObject Object
    FSNode(Object userObject) {
    super(userObject);
    * Constructeur par initialisation
    * @param userObject Object
    * @param newFile File
    FSNode(Object userObject, File newFile) {
    super(userObject);
    file = newFile;
    * Definit le fichier lie au noeud
    * @param newFile File
    public void setFile(File newFile) {
    file = newFile;
    * Renvoi le fichier lie au noeud
    * @return File
    public File getFile() {
    return file;
    public JTree getJTree(){
         return tree ;
    * Constructeur
    * @throws HeadlessException
    public JTreeFolder() throws HeadlessException {
    File[] drive;
    tree = new JTree();
    // cr�ation du noeud sup�rieur
    racine = new DefaultMutableTreeNode("Poste de travail");
    // cr�ation d'un noeud pour chaque lecteur
    drive = File.listRoots();
    for (int i = 0 ; i < drive.length ; i++) {
    FSNode node = new FSNode(drive, drive[i]);
    addFolder(drive[i], node); // on descend dans l'arborescence du lecteur jusqu'� MAX_LEVEL
    racine.add(node);
    // Gestion d'evenement sur JTree (on �coute les evenements TreeExpansion)
    tree.addTreeExpansionListener(new TreeExpansionListener() {
    public void treeExpanded(TreeExpansionEvent e) {
    // lorsqu'un noeud est ouvert
    // on descend dans l'arborescence du noeud jusqu'� MAX_LEVEL
    TreePath path = e.getPath();
    FSNode node = (FSNode)path.getLastPathComponent();
    addFolder(node);
    ((DefaultTreeModel)tree.getModel()).reload(node); // on recharche uniquement le noeud
    public void treeCollapsed(TreeExpansionEvent e) {
    // lorsqu'un noeud est referm�
    //RIEN
    // alimentation du JTree
    DefaultTreeModel model = new DefaultTreeModel(racine);
    tree.setModel(model);
         setLayout(null);
    // ajout du JTree au formulaire
    tree.setBounds(0, 0, 240, 290);
    scrollpane = new JScrollPane(tree);
         add(scrollpane);
         scrollpane.setBounds(0, 0, 240, 290);
    * Recuperation des sous-elements d'un repertoire
    * @param driveOrDir
    * @param node
    public void addFolder(File driveOrDir, DefaultMutableTreeNode node) {
    setCursor(new Cursor(3)); // WAIT_CURSOR est DEPRECATED
    addFolder(driveOrDir, node, 0);
    setCursor(new Cursor(0)); // DEFAULT_CURSOR est DEPRECATED
    * Recuperation des sous-elements d'un repertoire
    * (avec niveau pour r�cursivit� et arr�t sur MAX_LEVEL)
    * @param driveOrDir File
    * @param node DefaultMutableTreeNode
    * @param level int
    private void addFolder(File driveOrDir, DefaultMutableTreeNode node, int level) {
    File[] fileList;
    fileList = driveOrDir.listFiles();
    if (fileList != null) {
    sortFiles(fileList); // on tri les elements
    // on ne cherche pas plus loin que le niveau maximal d�finit
    if (level > MAX_LEVEL - 1) {return;}
    // pour chaque �l�ment
    try {
    for (int i = 0; i < fileList.length; i++) {
    // en fonction du type d'�l�ment
    if (fileList[i].isDirectory()) {
    // si c'est un r�pertoire on cr�� un nouveau noeud
    FSNode dir = new FSNode(fileList[i].getName(), fileList[i]);
    node.add(dir);
    // on recherche les �l�ments (r�cursivit�)
    addFolder(fileList[i], dir, ++level);
    if (fileList[i].isFile()) {
    // si c'est un fichier on ajoute l'�l�ment au noeud
    node.add(new FSNode(fileList[i].getName(), fileList[i]));
    catch (NullPointerException e) {
    // rien
    * Recuperation des sous-elements d'un noeud
    * @param node
    public void addFolder(FSNode node) {
    setCursor(new Cursor(3)); // WAIT_CURSOR est DEPRECATED
    for (int i = 0 ; i < node.getChildCount() ; i++) {
    addFolder(((FSNode)node.getChildAt(i)).getFile(), (FSNode)node.getChildAt(i));
    setCursor(new Cursor(0)); // DEFAULT_CURSOR est DEPRECATED
    * Tri une liste de fichier
    * @param listFile
    public void sortFiles(File[] listFile) {
    triRapide(listFile, 0, listFile.length - 1);
    * QuickSort : Partition
    * @param listFile
    * @param deb
    * @param fin
    * @return
    private int partition(File[] listFile, int deb, int fin) {
    int compt = deb;
    File pivot = listFile[deb];
    int i = deb - 1;
    int j = fin + 1;
    while (true) {
    do {
    j--;
    } while (listFile[j].getName().compareToIgnoreCase(pivot.getName()) > 0);
    do {
    i++;
    } while (listFile[i].getName().compareToIgnoreCase(pivot.getName()) < 0);
    if (i < j) {
    echanger(listFile, i, j);
    } else {
    return j;
    * Tri rapide : quick sort
    * @param listFile
    * @param deb
    * @param fin
    private void triRapide(File[] listFile, int deb, int fin) {
    if (deb < fin) {
    int positionPivot = partition(listFile, deb, fin);
    triRapide(listFile, deb, positionPivot);
    triRapide(listFile, positionPivot + 1, fin);
    * QuickSort : echanger
    * @param listFile
    * @param posa
    * @param posb
    private void echanger(File[] listFile, int posa, int posb) {
    File tmpFile = listFile[posa];
    listFile[posa] = listFile[posb];
    listFile[posb] = tmpFile;

Maybe you are looking for

  • Apple Mail: How do I add contacts to address book?

    In the Apple Mail program, there is an option to add sender to address book. But when I do that, it just adds the sender to my address book, oftentimes without a name associated to the contact. So that contact could easily get lost. I'd like to be ab

  • Report for subcontracting material

    Dear all, I need your help. we have two plants suppose plant 1 and 2 plant 1 have sent some material to plant 2 by subcontracting challan so i need a detail like 1) material sent via 57f4 2) input material (raw material) 3) output material (finish ma

  • Delta upload from external tables in BI 7.0

    hi guys! i need to create a delta upload reading the data from an external db what are the options that i have? there is someway to use the timestamp that i have in the source tables and make a comparison between the timestamp in ods and the timestam

  • Migration to new Macbook Air incomplete, disc ejected

    Hi, I am trying to migrate data from an external USB disk with time machine backup of my mid-2007 Macbook to a new Macbook Air 13". I have't found a problem like this in the forums. The data is ca. 46GB, it shows it should take 24 mins but at 30% all

  • How to decide explain plan is optimal?

    hi All, could you please tell me on what basis we can decide explain plan is optimal. Thanks, Santosh.