can't make addSetTop work with Digester

Discussion in 'Java' started by Vincent Fuchs, Dec 21, 2004.

  1. Hi all,

    I have a problem with Digester : I want to set a parent-child
    relationship between 2 objects, and I want to use Digester's addSetTop
    method. Here is my XML file :

    <?xml version="1.0" encoding="ISO-8859-1"?>

    <docExcel>
    <onglet name="Lot1">
    <cellule positionX="F" positionY="4" type="pourcent">
    <seuilBas positionX="E" positionY="4"/>
    <seuilHaut positionX="D" positionY="4"/>
    <indicateur name="transfert_de_fichiers" periodicite="hebdo"/>
    </cellule>
    </onglet>
    </docExcel>


    I want to set the relationship between cellule and onglet, by calling
    a setOnglet(Onglet ong) method on a Cellule object. Here is my code :

    Digester mapping=new Digester();
    mapping.setValidating(false);

    mapping.addObjectCreate("docExcel",DocExcel.class);
    mapping.addObjectCreate("docExcel/onglet",Onglet.class);
    mapping.addSetProperties("docExcel/onglet");

    mapping.addObjectCreate("docExcel/onglet/cellule",Cellule.class);
    mapping.addSetTop("docExcel/onglet/cellule","setOnglet","divData2csv.excel.Onglet");
    mapping.addSetProperties("docExcel/onglet/cellule");

    So, in the Digester's stack, from bottom to top, I have a DocExcel, an
    Onglet, and a Cellule. According to the documentation, the addSetTop
    method should call the setOnglet method on the top object (Cellule),
    passing the top-1 object (Onglet) as an argument.
    When I execute my program, I have this in the log file :
    - Fire begin() for SetTopRule[methodName=setOnglet,
    paramType=divData2csv.exel.Onglet]
    - Fire begin() for SetPropertiesRules[]
    and the properties are set, but nothing else about setOnglet.

    Am I misunderstanding the way it should work ? I couldn't find any
    example using addSetTop, so if I have some, I would be glad to have a
    look at it.

    thanks

    --
    Vince
    Vincent Fuchs, Dec 21, 2004
    #1
    1. Advertising

  2. Vincent Fuchs

    Guru Guest

    Struts dynamic Checkbox.

    Hi,
    I have a database table with text and boolean.
    i need to show the text in a label and depending upon
    the boolean i need to show a check box with state off or on. I should do
    this in struts.

    Here comes the problem:
    How to populate the checkbox dynamically ?
    As we do not know the check box count, how to generate setter and getter for
    that in the form bean ?

    --guru
    Guru, Dec 21, 2004
    #2
    1. Advertising

  3. Vincent Fuchs

    Guru Guest

    Re: Struts dynamic Checkbox.

    I am sorry. I have replied my problem to another
    question.

    As i am a new user of the OE,please forgive me :) !

    --guru.

    "Guru" <> wrote in message
    news:...
    > Hi,
    > I have a database table with text and boolean.
    > i need to show the text in a label and depending upon
    > the boolean i need to show a check box with state off or on. I should do
    > this in struts.
    >
    > Here comes the problem:
    > How to populate the checkbox dynamically ?
    > As we do not know the check box count, how to generate setter and getter

    for
    > that in the form bean ?
    >
    > --guru
    >
    >
    Guru, Dec 21, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ruben Stranders

    Parsing a composite pattern with Digester

    Ruben Stranders, Jul 17, 2003, in forum: Java
    Replies:
    0
    Views:
    522
    Ruben Stranders
    Jul 17, 2003
  2. CG

    Digester package

    CG, Sep 16, 2003, in forum: Java
    Replies:
    0
    Views:
    496
  3. marcelino
    Replies:
    0
    Views:
    494
    marcelino
    Jan 26, 2004
  4. Markos Charatzas

    Digester and illegal characters

    Markos Charatzas, Mar 5, 2004, in forum: Java
    Replies:
    2
    Views:
    582
    Markos Charatzas
    Mar 5, 2004
  5. Xeno Campanoli
    Replies:
    1
    Views:
    338
    James Britt
    Jul 1, 2005
Loading...

Share This Page