RE: Help drasticaly needed ; indexed properties

2003-10-03 Thread shirishchandra.sakhare
Hi,

The problem seems to be that when you are using bean:write, the data you write is not 
included in the request when the page is displayed.So if you want to resedn the same 
data as part of request, use html:hidden along with bean:write.

I did not go in much detail of your code.But I think what you are looking for is 
indexed and nested property.

You have to understand how struts prepolutaion tries to call properties on form from 
param name.

1.IF porperty is signal.code, when prepopulating, it will resolve to 
youForrm.getSignal.setCode(String aa)
2.IF porperty is signal[i].code, when prepopulating, it will resolve to 
youForrm.getSignal(i).setCode(String aa).


Hope this helps.
Regards,
Shirish


-Original Message-
From: Frederic Dernbach [mailto:[EMAIL PROTECTED]
Sent: Friday, October 03, 2003 12:15 PM
To: struts-layout; struts-user
Subject: Help drasticaly needed ; indexed properties



I recently asked for some help on indexed properties and I still some
assistance. However, I made some progress in the understanding of the
issue. I traced the Struts source code to understand a little better why
I'm loosing collection date in between Struts actions.

I have a very simple JSP (not using struts-layout here since I wanted to
test the most simple example possible). It uses a 'signals' property of
a my form names 'strategyForm'. See below.

When I hit the validate button, I have lost the 'signals' property. I
debugged Strsts source files and I realized that the request does not
have the 'signals' parameter (RequestUtils.populate() which calls
BeanUtils.populate() ).

==> QUESTIONS 
- How do I make sure that an indexed property will be populated in the
form of a Struts action
- How to I make sure in the JSP file that the 'signals' property in the
HTML form ? Should I add a hidden field ? But how ?

Any response will be appreciated.

Below, you will find the entire JSP file and the relevant part of my
strategy form source code.

Thanks in advance for your help.

Fred




Test Indexed property











Order
Code













Validate








import com.rubis.web.system.OrderedSignalBean;

public class StrategyForm extends ValidatorActionForm implements
java.io.Serializable {

public OrderedSignalBean getSignals(int index) {
return signals[index];
}
public OrderedSignalBean[] getSignals() {
return signals;
}
public void setSignals(int index, OrderedSignalBean signal) {
signals[index] = signal;
}
public void setSignals(OrderedSignalBean[] array) {
this.signals = array;
}
public String getCode() {
return this.code;
}
public void setCode(String code) {
this.code = code;
}
public String getLabel() {
return this.label;
}
public void setLabel(String label) {
this.label = label;
}
public void reset(ActionMapping mapping, HttpServletRequest request) {

this.code   = null;
this.label  = null;
this.signals= null;
}   



-
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]



Help drasticaly needed ; indexed properties

2003-10-03 Thread Frederic Dernbach

I recently asked for some help on indexed properties and I still some
assistance. However, I made some progress in the understanding of the
issue. I traced the Struts source code to understand a little better why
I'm loosing collection date in between Struts actions.

I have a very simple JSP (not using struts-layout here since I wanted to
test the most simple example possible). It uses a 'signals' property of
a my form names 'strategyForm'. See below.

When I hit the validate button, I have lost the 'signals' property. I
debugged Strsts source files and I realized that the request does not
have the 'signals' parameter (RequestUtils.populate() which calls
BeanUtils.populate() ).

==> QUESTIONS 
- How do I make sure that an indexed property will be populated in the
form of a Struts action
- How to I make sure in the JSP file that the 'signals' property in the
HTML form ? Should I add a hidden field ? But how ?

Any response will be appreciated.

Below, you will find the entire JSP file and the relevant part of my
strategy form source code.

Thanks in advance for your help.

Fred




Test Indexed property











Order
Code













Validate








import com.rubis.web.system.OrderedSignalBean;

public class StrategyForm extends ValidatorActionForm implements
java.io.Serializable {

public OrderedSignalBean getSignals(int index) {
return signals[index];
}
public OrderedSignalBean[] getSignals() {
return signals;
}
public void setSignals(int index, OrderedSignalBean signal) {
signals[index] = signal;
}
public void setSignals(OrderedSignalBean[] array) {
this.signals = array;
}
public String getCode() {
return this.code;
}
public void setCode(String code) {
this.code = code;
}
public String getLabel() {
return this.label;
}
public void setLabel(String label) {
this.label = label;
}
public void reset(ActionMapping mapping, HttpServletRequest request) {

this.code   = null;
this.label  = null;
this.signals= null;
}   



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