Re: Synchronise Collection with ActionForm

2003-12-24 Thread François Richard
the solution :
in the logic:iterate the id must be choosen carefully ... you have 
to use the same value as property
I found the explanation here (/Indexed References/) :
http://jakarta.apache.org/struts/api/org/apache/struts/taglib/bean/package-summary.html#doc.Properties

for me :
html:form action=societeValid
logic:iterate id=societes name=societeForm property=societes 
scope=session indexId=index
html:text name=societes property=code indexed=true /
html:text name=societes property=raisonSociale indexed=true /
/logic:iterate
/html:form

François Richard wrote:

Merry Christmas,

I have got an ActionForm with a collection.
The first synchronization (ActionForm object  form html) works great, 
on page load.
but, on form submitting, the second synchronization (form html  
ActionForm object)doesn't work. the old values are still present.

The ActionForm (SocieteForm) object is stocked in the session.

my jsp :

html:form action=societeValid
logic:iterate id=societe name=societeForm property=societes 
scope=session indexId=index
html:text name=societe property=code indexed=true /
html:text name=societe property=raisonSociale indexed=true /
/logic:iterate
/html:form

Thanks,

François



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Synchronise Collection with ActionForm

2003-12-23 Thread François Richard
no one have an idea !!

my ActionForm :

public class SocieteForm extends ActionForm {
  
   private ArrayList societes;

   public ActionErrors validate(ActionMapping mapping, 
HttpServletRequest request) {
   ActionErrors errors = new ActionErrors();
  return errors;
   }

   public ArrayList getSocietes()   {  return societes;   }
   public void setSocietes(ArrayList liste){ societes = liste;  }
}
my struts-config.xml (only for submit) :

   action
   attribute=societeForm
   name=societeForm
   path=/societeValid
   scope=session
   type=com.sofice.cra.action.SocieteValidAction
   validate=true
   input=/lstSocietes.do
   forward name=success path=/lstSocietes.do /
   /action
any advice would be appreciated. ;-)

François



François Richard wrote:

Merry Christmas,

I have got an ActionForm with a collection.
The first synchronization (ActionForm object  form html) works great, 
on page load.
but, on form submitting, the second synchronization (form html  
ActionForm object)doesn't work. the old values are still present.

The ActionForm (SocieteForm) object is stocked in the session.

my jsp :

html:form action=societeValid
logic:iterate id=societe name=societeForm property=societes 
scope=session indexId=index
html:text name=societe property=code indexed=true /
html:text name=societe property=raisonSociale indexed=true /
/logic:iterate
/html:form

Thanks,

François



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Synchronise Collection with ActionForm

2003-12-23 Thread Richard Yee
François,
Show us your Action class. From your struts_config, it
seems like you are in al loop in that you forward to
the same action that is your input. How does the user
ever get past this action?

-Richard

--- François_Richard [EMAIL PROTECTED] wrote:
 no one have an idea !!
 
 my ActionForm :
 
 public class SocieteForm extends ActionForm {

 private ArrayList societes;
 
 public ActionErrors validate(ActionMapping
 mapping, 
 HttpServletRequest request) {
 ActionErrors errors = new ActionErrors();
return errors;
 }
 
 public ArrayList getSocietes()   {  return
 societes;   }
 public void setSocietes(ArrayList liste){
 societes = liste;  }
 }
 
 my struts-config.xml (only for submit) :
 
 action
 attribute=societeForm
 name=societeForm
 path=/societeValid
 scope=session

 type=com.sofice.cra.action.SocieteValidAction
 validate=true
 input=/lstSocietes.do
 forward name=success
 path=/lstSocietes.do /
 /action
 
 any advice would be appreciated. ;-)
 
 François
 
 
 
 François Richard wrote:
 
  Merry Christmas,
 
  I have got an ActionForm with a collection.
  The first synchronization (ActionForm object 
 form html) works great, 
  on page load.
  but, on form submitting, the second
 synchronization (form html  
  ActionForm object)doesn't work. the old values are
 still present.
 
  The ActionForm (SocieteForm) object is stocked in
 the session.
 
  my jsp :
 
  html:form action=societeValid
  logic:iterate id=societe name=societeForm
 property=societes 
  scope=session indexId=index
  html:text name=societe property=code
 indexed=true /
  html:text name=societe property=raisonSociale
 indexed=true /
  /logic:iterate
  /html:form
 
  Thanks,
 
  François
 
 
 
 

-
  To unsubscribe, e-mail:
 [EMAIL PROTECTED]
  For additional commands, e-mail:
 [EMAIL PROTECTED]
 
 
 
 
 

-
 To unsubscribe, e-mail:
 [EMAIL PROTECTED]
 For additional commands, e-mail:
 [EMAIL PROTECTED]
 


__
Do you Yahoo!?
New Yahoo! Photos - easier uploading and sharing.
http://photos.yahoo.com/

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Synchronise Collection with ActionForm

2003-12-23 Thread François Richard
there are 2 actions and one jsp, one action to load the page (list of 
society) from the database and the other to submit changes (creation, 
modification and suppression). In all circumstances (error or not) the 
user returns to the list of society (via the action).
Note : the synchro works fine for all the objects in the ActionForm 
(SocieteForm) expects for the ArrayList (only form  object)

the action class(submit)

public class SocieteValidAction extends Action {
   public ActionForward execute(ActionMapping mapping, ActionForm form,
   HttpServletRequest request,
   HttpServletResponse response)
throws IOException, ServletException,
   ClassNotFoundException, SQLException
   {
   ActionErrors errors = new ActionErrors();
   SocieteForm societeForm = (SocieteForm)form;
  // updating database
   // .
   if (!errors.isEmpty()) saveErrors(request, errors);
   return (mapping.findForward(success));
   }
}
Richard Yee wrote:

François,
Show us your Action class. From your struts_config, it
seems like you are in al loop in that you forward to
the same action that is your input. How does the user
ever get past this action?
-Richard

--- François_Richard [EMAIL PROTECTED] wrote:
 

no one have an idea !!

my ActionForm :

public class SocieteForm extends ActionForm {
  
   private ArrayList societes;

   public ActionErrors validate(ActionMapping
mapping, 
HttpServletRequest request) {
   ActionErrors errors = new ActionErrors();
  return errors;
   }

   public ArrayList getSocietes()   {  return
societes;   }
   public void setSocietes(ArrayList liste){
societes = liste;  }
}
my struts-config.xml (only for submit) :

   action
   attribute=societeForm
   name=societeForm
   path=/societeValid
   scope=session
  
type=com.sofice.cra.action.SocieteValidAction
   validate=true
   input=/lstSocietes.do
   forward name=success
path=/lstSocietes.do /
   /action

any advice would be appreciated. ;-)

François



François Richard wrote:

   

Merry Christmas,

I have got an ActionForm with a collection.
The first synchronization (ActionForm object 
 

form html) works great, 
   

on page load.
but, on form submitting, the second
 

synchronization (form html  
   

ActionForm object)doesn't work. the old values are
 

still present.
   

The ActionForm (SocieteForm) object is stocked in
 

the session.
   

my jsp :

html:form action=societeValid
logic:iterate id=societe name=societeForm
 

property=societes 
   

scope=session indexId=index
html:text name=societe property=code
 

indexed=true /
   

html:text name=societe property=raisonSociale
 

indexed=true /
   

/logic:iterate
/html:form
Thanks,

François



 

-
 

To unsubscribe, e-mail:
 

[EMAIL PROTECTED]
   

For additional commands, e-mail:
 

[EMAIL PROTECTED]
   

 

   

-
 

To unsubscribe, e-mail:
[EMAIL PROTECTED]
For additional commands, e-mail:
[EMAIL PROTECTED]
   



__
Do you Yahoo!?
New Yahoo! Photos - easier uploading and sharing.
http://photos.yahoo.com/
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


 



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Synchronise Collection with ActionForm

2003-12-22 Thread François Richard
Merry Christmas,

I have got an ActionForm with a collection.
The first synchronization (ActionForm object  form html) works great, on page load.
but, on form submitting, the second synchronization (form html  ActionForm 
object)doesn't work. the old values are still present.
The ActionForm (SocieteForm) object is stocked in the session.

my jsp :

html:form action=societeValid
logic:iterate id=societe name=societeForm property=societes scope=session 
indexId=index
html:text name=societe property=code indexed=true /
html:text name=societe property=raisonSociale indexed=true /
/logic:iterate
/html:form
Thanks,

François



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]