can't make addSetTop work with Digester

V

Vincent Fuchs

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
 
G

Guru

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
 
G

Guru

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

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

--guru.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,997
Messages
2,570,239
Members
46,827
Latest member
DMUK_Beginner

Latest Threads

Top