Re: Real Dynamic Forms - Using DynaBeans & MapBackedForms

2004-01-12 Thread Christian Burger

Return Receipt
   
Your  Re: Real Dynamic Forms - Using DynaBeans & MapBackedForms
document   
:  
   
was   Christian Burger/HER/Europe/PUMA 
received   
by:
   
at:   01/12/2004 09:26:13 AM   
   





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



Re: Real Dynamic Forms - Using DynaBeans & MapBackedForms

2004-01-12 Thread hhlow
Hi Oliver,

i am doing a simple login form.
well i am using Struts bean.
anyway i print the bean out by using



but recently i have this no getter method for the bean i dun understand why.
coz i have initialised the bean.

check out the tut here..it demostrates some simple features
www.reumann.net/do/struts/lesson1
www.reumann.net/do/struts/lesson2
www.reumann.net/do/struts/lesson3

Clement

- Original Message - 
From: "Oliver Thiel" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, January 12, 2004 3:31 PM
Subject: Real Dynamic Forms - Using DynaBeans & MapBackedForms


> Hi @all,
>
>
> I am relative new to Strut, but I have to | want to do a struts project
> for my studies at the university of applied science.  I try to build a
> 'real' dynamic registration form using DynaBeans and Maps (all HashMaps
> will be filled by a database call later).
>
> What I have so far is:
>
> CreateFormAction.java:
>
> DynaActionForm mappedForm2 = (DynaActionForm) form;
> HashMap mappedForm = new HashMap();
>
> mappedForm.put("username", "test");
> mappedForm.put("email", "[EMAIL PROTECTED]");
> mappedForm.put("password", "xyz");
> mappedForm.put("conf_pwd", "xyz");
>
> mappedForm2.set("mappedForm", mappedForm);
> request.setAttribute("mappedForm2", mappedForm2);
>
>
>
> struts-config.xml
>
>  type="org.apache.struts.action.DynaActionForm">
> 
> 
> 
>
>
>
> mappedForm.jsp
>
> 
>  type="java.util.HashMap"/>
> 
> 
>  property="key"/>:
>  property="key" />"
>  value=""
> class="Feld">
> 
>   
>   
> 
>  />
> 
> 
>
>
> mappedForm.java (extends DynaActionForm)
>
> String getEmail= (String)this.get("getEmail");
> In the mappedForm.java I can only access the getMail value!
>
> Questions:
> 1. How can I access the values from the map in my mappedForm
> validate() method? To validate them I want to use another Map, filed
> with Regular Expressions?
> 2. Can I use more than one Map? Cause I also want the (input
> type="text") to be dynamic too, so that I can switch between text and
> password for example.
> 3. How can I out print a 'dynamic' bean massage?
> Something like that:  property="value"/>" /> But this does not work!
> 4. Is their a better way in Struts to do this?
> 5. Has any one done something like that before and can provide my
> some examples or code snippets?
>
>
> Thanks in advanced
> Oliver
>
>
>


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



Real Dynamic Forms - Using DynaBeans & MapBackedForms

2004-01-12 Thread Oliver Thiel
Hi @all,
 
 
I am relative new to Strut, but I have to | want to do a struts project
for my studies at the university of applied science.  I try to build a
'real' dynamic registration form using DynaBeans and Maps (all HashMaps
will be filled by a database call later).
 
What I have so far is:
 
CreateFormAction.java:
 
DynaActionForm mappedForm2 = (DynaActionForm) form;
HashMap mappedForm = new HashMap();
 
mappedForm.put("username", "test");
mappedForm.put("email", "[EMAIL PROTECTED]");
mappedForm.put("password", "xyz");
mappedForm.put("conf_pwd", "xyz");
 
mappedForm2.set("mappedForm", mappedForm);
request.setAttribute("mappedForm2", mappedForm2);
 
 
 
struts-config.xml
 




 
 
 
mappedForm.jsp
 




:
"  
 value=""
class="Feld">

  
   
 



 
 
mappedForm.java (extends DynaActionForm)
 
String getEmail= (String)this.get("getEmail");
In the mappedForm.java I can only access the getMail value! 
 
Questions:
1.  How can I access the values from the map in my mappedForm
validate() method? To validate them I want to use another Map, filed
with Regular Expressions?
2.  Can I use more than one Map? Cause I also want the (input
type="text") to be dynamic too, so that I can switch between text and
password for example.
3.  How can I out print a 'dynamic' bean massage?
Something like that: " /> But this does not work!
4.  Is their a better way in Struts to do this?
5.  Has any one done something like that before and can provide my
some examples or code snippets?
 
 
Thanks in advanced 
Oliver
 
 


completely dynamic forms and jsp?

2003-10-20 Thread Sonam Belbase
How would you do this using Struts?

User goes to a page where they can add profiles to a repository. There are
two
types of profiles a user can add. But the user can add as many profiles
of each type as they want on that page.

Profile type A requires input from 3 text boxes, and profile type B needs
input from 1 textbox and 1 drop down. Each has it own action to save it to
the repository.

At initial load of page, there are two buttons: "add profile of type A" and
"add profile of type B".

So, if user comes to the page and clicks ""add profile of type A" once, and
"add profile of type B" twice, at the end there should be 3 sections, the
first one with the 3 text boxes for profile type A, followed by the two
sections  each with the input fields for profile type B. Each section also
has it's own "save" button so although the user can set up the page to add 3
profiles, he/she can only save one profile at a time.

The main question is how do you dynamically add properties to the form and
display them at runtime? If one form is needed per profile added, how do you
keep adding   to your jsp at runtime? Can tiles help?

Thanks,

SB


--
NOTICE: If received in error, please destroy and notify sender.  Sender does
not waive confidentiality or privilege, and use is prohibited.



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



Re: Really Dynamic Forms

2003-09-13 Thread Mark Lowe
DynaForms aren't as dynamic as there name suggest, at least not until  
you start using indexed properties.If the case of forms you'll still be  
wanting to use struts html tags, as jstl doesn't cover this yet until  
java servers faces is released.

For most cases nesting beans works

//in struts config


I'm using arraylist rather than User[] .. I still need to find out  
whether there's an advantage.

..
//in the bean
public class User {
String name;
getName() {
return name;
}
setName(String str) {
this.name = str;
}
}
..
//in the action
User user = new User();
user.setName("Brian Blessed");
User anotherUser = new User();
anotherUser.setName("Brian Clough");
ArrayList list = new ArrayList();
list.add(user);
list.add(anotherUser);
theForm.set("user",list);
..


	
	
	


...

ArrayList userList = (ArrayList) theForm.get("user");

for(int i = 0;i < userList.size();i++) {
User user = (User) userList.get(i);
System.out.println(user.getName());
}
..

Cheers Mark

On Friday, September 12, 2003, at 02:54 PM, [EMAIL PROTECTED] wrote:

Ok.

So to use variable names they reccomend using

<%
for (int i = 0; i < 10; i++) {
String name = "value(foo-" + i + ")";
%>


<%
}
%>
I would like to use JSTL, but you can't put jstl tags inside struts  
tags and
someone mentioned at one point that I should use EL...  soo, any links  
as to
where I can read about this?

Thanks,

Denis
- Original Message -
From: <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Friday, September 12, 2003 9:43 AM
Subject: Re: Really Dynamic Forms

Well.  So after I write, I found

http://jakarta.apache.org/struts/userGuide/ 
building_controller.html#map_action_form_classes
Thanks anyway.

Regards,

Denis
- Original Message -
From: <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Friday, September 12, 2003 9:40 AM
Subject: Really Dynamic Forms
Hello,

So I have a problem, and I just can't get out of the box to look at it
anymore so I am writing you all:
I have a user registration page and action i am writing.  User can  
have a
variable number of properties with different names that need to be  
filled
in.  User also has some properties that always need to be filled in.

I am not sure how to do this using struts forms of any kind.  It  
seems to
me
that I need to define at least the names of the properties in advance,
when
that will be changing (I know the client will be adding and removing
properties in the future so I can't hardcode them).
Right now I am using a regular form, I have my fixed properties  
hardcoded,
and variable ones are preloaded in a map in the setup action and I  
iterate
over them to display them.  Then in the action I retrieve them.

This is fine until I want to validate something, and I really like  
struts
forms validation, so i'd like to use them if possible.

To summarize:
I have  a map of properties, as well as some regular properties.
I want to use a struts form to retrieve the data.
I don't know how to do it so the names are dynamic.
Regards,

Denis

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


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


Re: Really Dynamic Forms

2003-09-12 Thread denis
Ok.

So to use variable names they reccomend using

<%
for (int i = 0; i < 10; i++) {
String name = "value(foo-" + i + ")";
%>


<%
}
%>


I would like to use JSTL, but you can't put jstl tags inside struts tags and
someone mentioned at one point that I should use EL...  soo, any links as to
where I can read about this?

Thanks,

Denis
- Original Message - 
From: <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Friday, September 12, 2003 9:43 AM
Subject: Re: Really Dynamic Forms


> Well.  So after I write, I found
>
http://jakarta.apache.org/struts/userGuide/building_controller.html#map_action_form_classes
> Thanks anyway.
>
> Regards,
>
> Denis
> - Original Message - 
> From: <[EMAIL PROTECTED]>
> To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> Sent: Friday, September 12, 2003 9:40 AM
> Subject: Really Dynamic Forms
>
>
> Hello,
>
> So I have a problem, and I just can't get out of the box to look at it
> anymore so I am writing you all:
>
> I have a user registration page and action i am writing.  User can have a
> variable number of properties with different names that need to be filled
> in.  User also has some properties that always need to be filled in.
>
> I am not sure how to do this using struts forms of any kind.  It seems to
me
> that I need to define at least the names of the properties in advance,
when
> that will be changing (I know the client will be adding and removing
> properties in the future so I can't hardcode them).
>
> Right now I am using a regular form, I have my fixed properties hardcoded,
> and variable ones are preloaded in a map in the setup action and I iterate
> over them to display them.  Then in the action I retrieve them.
>
> This is fine until I want to validate something, and I really like struts
> forms validation, so i'd like to use them if possible.
>
> To summarize:
> I have  a map of properties, as well as some regular properties.
> I want to use a struts form to retrieve the data.
> I don't know how to do it so the names are dynamic.
>
>
> Regards,
>
> Denis
>
>
> -
> 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: Really Dynamic Forms

2003-09-12 Thread denis
Well.  So after I write, I found
http://jakarta.apache.org/struts/userGuide/building_controller.html#map_action_form_classes
Thanks anyway.

Regards,

Denis
- Original Message - 
From: <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Friday, September 12, 2003 9:40 AM
Subject: Really Dynamic Forms


Hello,

So I have a problem, and I just can't get out of the box to look at it
anymore so I am writing you all:

I have a user registration page and action i am writing.  User can have a
variable number of properties with different names that need to be filled
in.  User also has some properties that always need to be filled in.

I am not sure how to do this using struts forms of any kind.  It seems to me
that I need to define at least the names of the properties in advance, when
that will be changing (I know the client will be adding and removing
properties in the future so I can't hardcode them).

Right now I am using a regular form, I have my fixed properties hardcoded,
and variable ones are preloaded in a map in the setup action and I iterate
over them to display them.  Then in the action I retrieve them.

This is fine until I want to validate something, and I really like struts
forms validation, so i'd like to use them if possible.

To summarize:
I have  a map of properties, as well as some regular properties.
I want to use a struts form to retrieve the data.
I don't know how to do it so the names are dynamic.


Regards,

Denis


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



Really Dynamic Forms

2003-09-12 Thread denis
Hello, 

So I have a problem, and I just can't get out of the box to look at it anymore so I am 
writing you all:

I have a user registration page and action i am writing.  User can have a variable 
number of properties with different names that need to be filled in.  User also has 
some properties that always need to be filled in.  

I am not sure how to do this using struts forms of any kind.  It seems to me that I 
need to define at least the names of the properties in advance, when that will be 
changing (I know the client will be adding and removing properties in the future so I 
can't hardcode them).

Right now I am using a regular form, I have my fixed properties hardcoded, and 
variable ones are preloaded in a map in the setup action and I iterate over them to 
display them.  Then in the action I retrieve them.

This is fine until I want to validate something, and I really like struts forms 
validation, so i'd like to use them if possible.

To summarize:
I have  a map of properties, as well as some regular properties.
I want to use a struts form to retrieve the data.
I don't know how to do it so the names are dynamic.


Regards, 

Denis

Re: radio buttons in dynamic forms

2003-08-19 Thread Hary
I had a similar problem and this is how I fixed it.

Define a new variable somedata in your parent form
because you want to tie this to one of the values from
your child

e.g OrderForm 
  private String selected;
  private ArrayList orderList;

OrderLine
  OID, price,  



 



..

Hope this helps.
If you find a better way let me know.

Hary

--- Claire Suttle <[EMAIL PROTECTED]> wrote:
> Hi,
> 
> I am dynamically creating a form, by preopulating a
> DynaActionForm. The form is made from an ArrayList,
> and each object in the array contains the data for
> one row of a table. I need the user, looking at this
> page, to be able to select one and only one row in
> the table - which I am trying to do using radio
> buttons.
> 
> So my table looks something like:
> radiobuttonsomedatasometext (All from
> ArrayList[0])
> radiobuttonsomedatasometext (All from
> ArrayList[1])
> radiobuttonsomedatasometext (All from
> ArrayList[2])
> 
> and I need all these radio buttons to be part of the
> same group, however they are expanded in the jsp
> page to each be in their own group:
> 
> 
> 
> 
> 
> Does anyone know of a way to place all these radio
> buttons in one group? I also somehow need to
> preserve the relationship between each radio button
> and its row of data, so that I know which row has
> been selected.
> 
> Thanks,
> Claire
> 


__
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

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



radio buttons in dynamic forms

2003-08-19 Thread Claire Suttle
Hi,

I am dynamically creating a form, by preopulating a DynaActionForm. The form is made 
from an ArrayList, and each object in the array contains the data for one row of a 
table. I need the user, looking at this page, to be able to select one and only one 
row in the table - which I am trying to do using radio buttons.

So my table looks something like:
radiobuttonsomedatasometext (All from ArrayList[0])
radiobuttonsomedatasometext (All from ArrayList[1])
radiobuttonsomedatasometext (All from ArrayList[2])

and I need all these radio buttons to be part of the same group, however they are 
expanded in the jsp page to each be in their own group:





Does anyone know of a way to place all these radio buttons in one group? I also 
somehow need to preserve the relationship between each radio button and its row of 
data, so that I know which row has been selected.

Thanks,
Claire


Help with using nested tags with dynamic forms

2003-07-31 Thread Katie Wright
Hello,

After joining the mailing list today, I found out that I had posted the an
e-mail to the wrong group (developers as opposed to users) so I am posting
here in hopes of getting help on the following:

I am trying to create an HTML form like so: 
Item1Label   Item1Textbox 
Item2Label   Item2Textbox 
Item3Label   Item3Textbox 

What is new to me is the fact that in this case, the number of items
vary and the item labels vary. 

I can display the page fine with the populated values for edit but when
I try to do a save, I get the following struts exception: 
javax.servlet.ServletException:BeanUtils.populate at
org.apache.struts.util.RequestUtils.populate RequestUtils.java:1254) at
org.apache.struts.action.RequestProcessor.processPopulate(RequestProcess
or.java:821) at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:
254) at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482) 

I have traced the struts code and see the generic exception being wrapped in
RequestUtils and don't know how to get more debugging information out of
this exception short of taking the struts source, marking it up and then
repackaging it.  I would like to avoid this.

It seems to be having trouble activating my setter in my form but not
sure why. I think because I have setup something improperly in my bean/form
but don't know
what.

Any assistance will be appreciated since this is day 3 of me trying to
figure this out, I am getting a little frustrated.

Thanks,

Katie Wright

The following is pruned version of the code:

JSP:





   
   
    
   
   
   
   





Form:

class ItemBeanFactory implements Factory {
public ItemBeanFactory() {
}
public Object create() {
return new ItemBean();
}
}


public  final class ItemForm extends CommonDTOForm {
private Collection _itemList = new ArrayList();
public ItemForm() {
try {
this._itemList = ListUtils.lazyList(new ArrayList(), new
ItemBeanFactory());
} catch (Exception e) {
}
}
public void setItemList(Collection list) {
   this._itemList = ListUtils.lazyList((ArrayList) list, new
ItemBeanFactory());
}
public Collection getItemList() {
return (this._itemList) ;
}
public void reset(ActionMapping mapping, HttpServletRequest request) {
super.reset(mapping,request);
this._itemList = new ArrayList();
}

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

Bean:

public  final class ItemBean {
private String _name = null;
private String _description = null;

public void setName(String name) {
this._name=name;
}

public String getName() {
return (this._name) ;
}

public void setDescription(String desc) {
this._description=desc;
}

public String getDescription() {
return (this._description) ;
}
}



 

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



creating dynamic forms for unknown attribute types

2003-05-31 Thread Nathan Coast
Hi,

I'd like to be able to dynamically create forms based on the properties 
of the class as defined by the PropertyDescriptors.  What I'd like to do 
is to have a mapping between the data type of the property and the input 
type used for the form.

e.g. for Strings a  for boolean / Boolean a  
with  , for Date use some 
form of calendar.

Has anyone tried anything like this?  I'd like to be able to define my 
own tag which performed the mapping and then delegated to the 
appropriate struts tag once the tag class had been selected.

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


Dynamic Forms & Indexed properties (was RE: [Struts FAQ] Update #3)

2003-04-02 Thread Wendy Smoak
John wrote:
> Struts FAQ - Update #3
> http://www.scioworks.net/servlets/ShowPage?pid=54&dp=3
> Q3: What are "indexed" struts-html tags and how to use them?

These are great, thanks!  I was just saying yesterday that indexed
properties might solve a problem I have, but looking at the example I'm not
sure if I can use them with a DynaValidatorForm.

In the example, does the programmer have to code the "Person" class with
phoneNo and name properties, or does that happen somehow automatically?

And how does this work:
 public void getPerson(int index) { ... }

Shouldn't that return a Person object, or at the very least an Object,
rather than void?

-- 
Wendy Smoak
Applications Systems Analyst, Sr.
Arizona State University PA Information Resources Management




RE: Help finding the right code for dynamic forms

2003-03-13 Thread Kris Schneider
Forgot that you also need a DTO interface and impl. Part of the decision about
code generation vs. dynamic class instantiation depends on how the rest of the
application interacts with these objects. For example, if the application
expects DTOs to be DynaBeans, you don't really need a DTO interface and it would
probably be pretty easy to dynamically create the DTO classes on the fly. In a
simlilar vein, if the application interacts with the DTOs through the beanutils
package, you could also leverage DynaBeans (or whatever else you want) without
the need for a statically defined interface and impl. On the other hand, if the
application needs a specific interface type to be able to invoke specific
methods, then code generation seems to make more sense.

If you go the code gen route, you'd want a process where the XML can serve as a
base for both the DTO and the ActionForm. If you're familiar with XSLT, you
might consider using it to generate a  element for a DynaActionForm
instead of generating a Java source file.

Quoting Wendy Smoak <[EMAIL PROTECTED]>:

> Kris wrote:
> {snip summary of how it works}
> > Not sure what you mean by "The database behind the DAO layer is
> multivalued".
> > Since you're not using JDBC, is there another way to get metadata from
> the
> > database about the fields you're interested in?
> 
> Multivalued as in non-first normal form.  I have fields that hold more than
> one value, and some of those are positinally related.  I believe the
> equivalent concept in SQL is "nested tables".
> 
> The database metadata does not change very often, so I'm currently planning
> to generate the XML from the database to a text file, then feed that to
> something Java based.  Sounds like "Digester" is the concept I was hunting
> for.
> 
> But yes, there's a Java API (UniObjects for Java) that allows direct access
> to the database from Java.  The metadata is stored in a "dictionary" that's
> essentially just another data file.
> 
> I'm still waffling on code generation vs. dynamic class instantiation of
> these DTO'S though.  Since the metadata rarely changes, I think it would be
> "cheaper" and probably easier to debug if I just generate the .java file
> for
> the interface & implementation and then compile it with the whole project
> as
> if it's a "normal" DTO.
> 
> Thanks for the ideas!
> 
> -- 
> Wendy Smoak
> Applications Systems Analyst, Sr.
> Arizona State University PA Information Resources Management
> 


-- 
Kris Schneider 
D.O.Tech   

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



RE: Help finding the right code for dynamic forms

2003-03-13 Thread Wendy Smoak
Kris wrote:
{snip summary of how it works}
> Not sure what you mean by "The database behind the DAO layer is
multivalued".
> Since you're not using JDBC, is there another way to get metadata from the
> database about the fields you're interested in?

Multivalued as in non-first normal form.  I have fields that hold more than
one value, and some of those are positinally related.  I believe the
equivalent concept in SQL is "nested tables".

The database metadata does not change very often, so I'm currently planning
to generate the XML from the database to a text file, then feed that to
something Java based.  Sounds like "Digester" is the concept I was hunting
for.

But yes, there's a Java API (UniObjects for Java) that allows direct access
to the database from Java.  The metadata is stored in a "dictionary" that's
essentially just another data file.

I'm still waffling on code generation vs. dynamic class instantiation of
these DTO'S though.  Since the metadata rarely changes, I think it would be
"cheaper" and probably easier to debug if I just generate the .java file for
the interface & implementation and then compile it with the whole project as
if it's a "normal" DTO.

Thanks for the ideas!

-- 
Wendy Smoak
Applications Systems Analyst, Sr.
Arizona State University PA Information Resources Management


Re: Help finding the right code for dynamic forms

2003-03-12 Thread Mark
Unfortunately, their website is hosed right now, but http://www.exolab.org was home to 
Castor which may interest you.

Regards,
Mark

*** REPLY SEPARATOR  ***

On 03/12/2003 at 2:56 PM Kris Schneider wrote:

>Not sure if this is what you're after, but the Digester rules that Struts uses
>to parse its configuration are encapsulated in
>org.apache.struts.config.ConfigRuleSet. The creation of the Digester itself
>happens in ActionServlet.initConfigDigester. ActionServlet.initModuleConfig is
>where the Digester is actually kicked off (which is called from
>ActionServlet.init). Once the configuration is parsed, initModuleConfig will
>look through all the FormBeanConfig instances and will invoke
>DynaActionFormClass.createDynaActionFormClass for each DynaActionForm instance.
>So, if you want to trace through it, the code trail is something like:
>
>init
>  initModuleConfig
>initConfigDigester
>DynaActionFormClass.createDynaActionFormClass
>
>The bridge between DynaActionForm and JSTL is DynaActionForm's getMap method. It
>allows you to use an expression like ${dynaForm.map.propName} or
>${dynaForm.map["prop.name"]}.
>
>Not sure what you mean by "The database behind the DAO layer is multivalued".
>Since you're not using JDBC, is there another way to get metadata from the
>database about the fields you're interested in? If so, you could probably put
>together a PlugIn that dynamically builds a FormBeanConfig from
>FormPropertyConfig instances that map to each of the fields. Once you have the
>FormBeanConfig, the PlugIn can just invoke config.addFormBeanConfig and
>DynaActionFormClass.createDynaActionFormClass. In theory at least...;-)
>
>Quoting Wendy Smoak <[EMAIL PROTECTED]>:
>
>>
>> I'm trying to make the back-end of my Struts webapp more flexible, and I'm
>> interested in the mechanism by which a dynamic form is created.  I'm
>> currently using the DAO pattern, so I have a ton of Data Transport Objects.
>> I've just hit a file with 129 data fields and I'm just not excited about
>> writing (or even using a code generator to produce) all those get/set
>> methods.  Twice, because there will be an interface and an implementation.
>>
>> The database behind the DAO layer is multivalued.  I'm not using a JDBC
>> driver, so none of the existing magic will work.
>>
>> The next version (UniData 6.0) is supposed to speak XML, so I think I could
>> produce something like the  structure from the
>> data dictionary.
>>
>> Given that, some sort of XML file describing the data fields, what do I
>> look
>> at to transform that into a class that conforms to the JavaBeans spec?  It
>> would need to work with JSTL as I often have a DTO sitting in the session
>> that I use JSTL to display pieces of.
>>
>> I've looked around in the code but I've only found the actual DynaWhatever
>> classes, not the bits that read the XML and create the objects.  Where is
>> that hiding?  And if anyone could give a high level overview of what
>> actually happens, that would help.
>>
>> Thanks!  (Not technically Struts related, I know... please reply
>> privately.)
>>
>> --
>> Wendy Smoak
>> Applications Systems Analyst, Sr.
>> Arizona State University PA Information Resources Management
>>
>
>
>--
>Kris Schneider 
>D.O.Tech   
>
>-
>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: Help finding the right code for dynamic forms

2003-03-12 Thread Rick Reumann
On Wed, 12 Mar 2003 11:28:04 -0700
Wendy Smoak <[EMAIL PROTECTED]> wrote:
 
> Thanks!  (Not technically Struts related, I know... please reply
> privately.)

Actually could you please post what you come up with to the list or to
my privately. I'd be curious to see what you came up with. Considering
all the [OT] stuff people post on the list (including myself:) this
topic is not way OT at all. I'd be interested in hearing what you
or others come up with.

Thanks,

-- 
Rick Reumann

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



Re: Help finding the right code for dynamic forms

2003-03-12 Thread Kris Schneider
Not sure if this is what you're after, but the Digester rules that Struts uses
to parse its configuration are encapsulated in
org.apache.struts.config.ConfigRuleSet. The creation of the Digester itself
happens in ActionServlet.initConfigDigester. ActionServlet.initModuleConfig is
where the Digester is actually kicked off (which is called from
ActionServlet.init). Once the configuration is parsed, initModuleConfig will
look through all the FormBeanConfig instances and will invoke
DynaActionFormClass.createDynaActionFormClass for each DynaActionForm instance.
So, if you want to trace through it, the code trail is something like:

init
  initModuleConfig
initConfigDigester
DynaActionFormClass.createDynaActionFormClass

The bridge between DynaActionForm and JSTL is DynaActionForm's getMap method. It
allows you to use an expression like ${dynaForm.map.propName} or
${dynaForm.map["prop.name"]}.

Not sure what you mean by "The database behind the DAO layer is multivalued".
Since you're not using JDBC, is there another way to get metadata from the
database about the fields you're interested in? If so, you could probably put
together a PlugIn that dynamically builds a FormBeanConfig from
FormPropertyConfig instances that map to each of the fields. Once you have the
FormBeanConfig, the PlugIn can just invoke config.addFormBeanConfig and
DynaActionFormClass.createDynaActionFormClass. In theory at least...;-)

Quoting Wendy Smoak <[EMAIL PROTECTED]>:

> 
> I'm trying to make the back-end of my Struts webapp more flexible, and I'm
> interested in the mechanism by which a dynamic form is created.  I'm
> currently using the DAO pattern, so I have a ton of Data Transport Objects.
> I've just hit a file with 129 data fields and I'm just not excited about
> writing (or even using a code generator to produce) all those get/set
> methods.  Twice, because there will be an interface and an implementation.
> 
> The database behind the DAO layer is multivalued.  I'm not using a JDBC
> driver, so none of the existing magic will work.
> 
> The next version (UniData 6.0) is supposed to speak XML, so I think I could
> produce something like the  structure from the
> data dictionary.
> 
> Given that, some sort of XML file describing the data fields, what do I
> look
> at to transform that into a class that conforms to the JavaBeans spec?  It
> would need to work with JSTL as I often have a DTO sitting in the session
> that I use JSTL to display pieces of.
> 
> I've looked around in the code but I've only found the actual DynaWhatever
> classes, not the bits that read the XML and create the objects.  Where is
> that hiding?  And if anyone could give a high level overview of what
> actually happens, that would help.
> 
> Thanks!  (Not technically Struts related, I know... please reply
> privately.)
> 
> -- 
> Wendy Smoak
> Applications Systems Analyst, Sr.
> Arizona State University PA Information Resources Management
> 


-- 
Kris Schneider 
D.O.Tech   

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



Re: Help finding the right code for dynamic forms

2003-03-12 Thread Robert McIntosh
I've been using DynaBeans outside of Struts, and in short, there is no 
standard tool for reading the XML and generating the DynaClass/DynaBean, 
although you could look at the source code for struts and see how it is 
done (which uses the Digester). Or, you can create your own format and 
do it yourself. It isn't that hard really. Assuming you want to use the 
BasicDynaBean, the process I followed was basically:

- Create a DynaProperty for each property needed
- Create a DynaClass supplying the array of DynaProperties created above
- Use it :-)
However if you want JavaBean compliant objects, you can either create 
your own code generator, which I have done before using Velocity for the 
code templates, or use the BCEL library 
(http://jakarta.apache.org/bcel/), which can generate class files at 
runtime.

HTH,
Robert
Wendy Smoak wrote:

I'm trying to make the back-end of my Struts webapp more flexible, and I'm
interested in the mechanism by which a dynamic form is created.  I'm
currently using the DAO pattern, so I have a ton of Data Transport Objects.
I've just hit a file with 129 data fields and I'm just not excited about
writing (or even using a code generator to produce) all those get/set
methods.  Twice, because there will be an interface and an implementation.
The database behind the DAO layer is multivalued.  I'm not using a JDBC
driver, so none of the existing magic will work.
The next version (UniData 6.0) is supposed to speak XML, so I think I could
produce something like the  structure from the
data dictionary.
Given that, some sort of XML file describing the data fields, what do I look
at to transform that into a class that conforms to the JavaBeans spec?  It
would need to work with JSTL as I often have a DTO sitting in the session
that I use JSTL to display pieces of.
I've looked around in the code but I've only found the actual DynaWhatever
classes, not the bits that read the XML and create the objects.  Where is
that hiding?  And if anyone could give a high level overview of what
actually happens, that would help.
Thanks!  (Not technically Struts related, I know... please reply privately.)

 



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


RE: Help finding the right code for dynamic forms

2003-03-12 Thread Petterson F. Paula
I'm interested in this problem too.

Petterson Ferreira de Paula
Consultor
Lúcida Tecnologia
Fone.: +55 11 3704 5004


-Original Message-
From: Wendy Smoak [mailto:[EMAIL PROTECTED]
Sent: quarta-feira, 12 de março de 2003 15:28
To: Struts Users Mailing List (E-mail)
Subject: Help finding the right code for dynamic forms



I'm trying to make the back-end of my Struts webapp more flexible, and I'm
interested in the mechanism by which a dynamic form is created.  I'm
currently using the DAO pattern, so I have a ton of Data Transport Objects.
I've just hit a file with 129 data fields and I'm just not excited about
writing (or even using a code generator to produce) all those get/set
methods.  Twice, because there will be an interface and an implementation.

The database behind the DAO layer is multivalued.  I'm not using a JDBC
driver, so none of the existing magic will work.

The next version (UniData 6.0) is supposed to speak XML, so I think I could
produce something like the  structure from the
data dictionary.

Given that, some sort of XML file describing the data fields, what do I look
at to transform that into a class that conforms to the JavaBeans spec?  It
would need to work with JSTL as I often have a DTO sitting in the session
that I use JSTL to display pieces of.

I've looked around in the code but I've only found the actual DynaWhatever
classes, not the bits that read the XML and create the objects.  Where is
that hiding?  And if anyone could give a high level overview of what
actually happens, that would help.

Thanks!  (Not technically Struts related, I know... please reply privately.)

--
Wendy Smoak
Applications Systems Analyst, Sr.
Arizona State University PA Information Resources Management


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



Help finding the right code for dynamic forms

2003-03-12 Thread Wendy Smoak

I'm trying to make the back-end of my Struts webapp more flexible, and I'm
interested in the mechanism by which a dynamic form is created.  I'm
currently using the DAO pattern, so I have a ton of Data Transport Objects.
I've just hit a file with 129 data fields and I'm just not excited about
writing (or even using a code generator to produce) all those get/set
methods.  Twice, because there will be an interface and an implementation.

The database behind the DAO layer is multivalued.  I'm not using a JDBC
driver, so none of the existing magic will work.

The next version (UniData 6.0) is supposed to speak XML, so I think I could
produce something like the  structure from the
data dictionary.

Given that, some sort of XML file describing the data fields, what do I look
at to transform that into a class that conforms to the JavaBeans spec?  It
would need to work with JSTL as I often have a DTO sitting in the session
that I use JSTL to display pieces of.

I've looked around in the code but I've only found the actual DynaWhatever
classes, not the bits that read the XML and create the objects.  Where is
that hiding?  And if anyone could give a high level overview of what
actually happens, that would help.

Thanks!  (Not technically Struts related, I know... please reply privately.)

-- 
Wendy Smoak
Applications Systems Analyst, Sr.
Arizona State University PA Information Resources Management


RE: Dynamic Forms Problem

2003-01-10 Thread Siggelkow, Bill
Use square brackets '[' instead of parenthesis when you build the 'name' like:

<% for (int i=0; i<10; i++) {
String name = "value(" + i + ")";
%>

<%
}
%>

-Original Message-
From: ashokd [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 09, 2003 5:37 PM
To: Struts Users Mailing List
Subject: Dynamic Forms Problem


MessageHi,

In my application the form fields are dynamic.
For this functionlity in FormAction class I defined the following code:

private final List values = new ArrayList();

public void setValue(int key, Object value) {
values.set(key, value);
}

public Object getValue(int key) {
return values.get(key);
}


How to define these controls in JSP page?


I defined like below:

<% for (int i=0; i<10; i++) {
String name = "value(" + i + ")";
%>

<%
}
%>


But it is throwing exception:

No getter method for property value(0) of bean 
org.apache.struts.taglib.html.BEAN: javax.servlet.jsp.JspException: No getter method 
for property value(0) of bean org.apache.struts.taglib.html.BEAN

Can any one help on this (How to set in JSP page)

Thanks in Advace,

Ashok.D


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




Dynamic Forms Problem

2003-01-09 Thread ashokd
MessageHi,

In my application the form fields are dynamic.
For this functionlity in FormAction class I defined the following code:

private final List values = new ArrayList();

public void setValue(int key, Object value) {
values.set(key, value);
}

public Object getValue(int key) {
return values.get(key);
}


How to define these controls in JSP page?


I defined like below:

<% for (int i=0; i<10; i++) {
String name = "value(" + i + ")";
%>

<%
}
%>


But it is throwing exception:

No getter method for property value(0) of bean 
org.apache.struts.taglib.html.BEAN: javax.servlet.jsp.JspException: No getter method 
for property value(0) of bean org.apache.struts.taglib.html.BEAN

Can any one help on this (How to set in JSP page)

Thanks in Advace,

Ashok.D




Re: Dynamic Forms

2003-01-01 Thread Affan Qureshi
You have quite a few options for this scenario. Either use Map-backed form
bean properties. Or use Nested Extension. I would prefer the latter.

Affan

- Original Message -
From: "ashokd" <[EMAIL PROTECTED]>
To: "Struts" <[EMAIL PROTECTED]>
Sent: Tuesday, April 30, 2002 1:36 PM
Subject: Dynamic Forms


Hi,

In my project, I am displaying all exisiting data in row format, user can
update any row(We don't know how many rows will come every time, it depends
upon the records exist in database).

For this type of project shall I use Struts, If yes how can I create
FormBeans for this type of forms.

Please give your suggestion on this.

Thanks & Regards,
Ashok.D



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




Re: Dynamic Forms

2003-01-01 Thread David M. Karr
> "ashokd" == ashokd  <[EMAIL PROTECTED]> writes:

ashokd> Hi,
ashokd> In my project, I am displaying all exisiting data in row format, user can 
update any row(We don't know how many rows will come every time, it depends upon the 
records exist in database).

ashokd> For this type of project shall I use Struts, If yes how can I create 
FormBeans for this type of forms.

ashokd> Please give your suggestion on this.

Well, you'll likely be using at least indexed properties, and perhaps indexed
tags.  The former is defined in the JavaBeans specification, and the latter is
specific to Struts.  The Struts web site has a "FAQ/How To" area that has a
section on indexed properties and tags.

-- 
===
David M. Karr  ; Java/J2EE/XML/Unix/C++
[EMAIL PROTECTED]   ; SCJP



--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Dynamic Forms

2003-01-01 Thread ashokd
Hi,

In my project, I am displaying all exisiting data in row format, user can update any 
row(We don't know how many rows will come every time, it depends upon the records 
exist in database).

For this type of project shall I use Struts, If yes how can I create FormBeans for 
this type of forms.

Please give your suggestion on this.

Thanks & Regards,
Ashok.D



RE: Dynamic Forms using XML

2002-10-25 Thread Bhamani, Nizar A TL56E
Can you clarify that the standard  &  tag lib were
sufficient
to render these beans as user input fields? Or did you have to build your
own rendering taglibs ?


Nizar Bhamani 
Senior Software Engineer
YouDecide.com Inc, a subsidiary of Ace INA Holdings Corp
[EMAIL PROTECTED]
(770) 291 7180
http://www.youdecide.com


-Original Message-
From: Affan Qureshi [mailto:quereshi@;etilize.com]
Sent: Friday, October 25, 2002 3:09 AM
To: Struts Users Mailing List
Subject: Re: Dynamic Forms using XML


Did you get a reply to this?

I am faced with a similar situation but in my case the information is coming
form a database. I created my Beans which had the properties to specify the
field type. Display Label, ids(name), etc. When I unmarshall my information
from the database I construct a collection of these beans. This colleciton
is passed on to the presentation to the Custom Tags that do the needed
rendering of the HTML fields.

Any comments/suggestions/improvements?

/* A

- Original Message -
From: "Bhamani, Nizar A TL56E" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, October 24, 2002 3:46 PM
Subject: Dynamic Forms using XML


> I have a scenario where, I need to develop Dynamic forms using an XML.
> i.e. the XML will specify what fields (all types of fields) need to be
> displayed
> on what page (i.e. page1, page2, etc). Has anybody out there worked on
> a similar scenario using Struts? Any help/input on this will be greatly
> appreciated.
>
> Thanks,
>
> Nizar Bhamani
>
> 
> CONFIDENTIALITY
> This e-mail and any attachments are confidential and also may be
privileged.
> If you are not the named recipient, or have otherwise received this
> communication in error, please delete it from your inbox, notify the
sender
> immediately, and do not disclose its contents to any other person,
> use them for any purpose, or store or copy them in any medium.
> Thank you for your cooperation.
> 
>
>
> --
> To unsubscribe, e-mail:
<mailto:struts-user-unsubscribe@;jakarta.apache.org>
> For additional commands, e-mail:
<mailto:struts-user-help@;jakarta.apache.org>
>


--
To unsubscribe, e-mail:
<mailto:struts-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail:
<mailto:struts-user-help@;jakarta.apache.org>

CONFIDENTIALITY
This e-mail and any attachments are confidential and also may be privileged.
If you are not the named recipient, or have otherwise received this 
communication in error, please delete it from your inbox, notify the sender
immediately, and do not disclose its contents to any other person, 
use them for any purpose, or store or copy them in any medium. 
Thank you for your cooperation. 



--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@;jakarta.apache.org>




Re: Dynamic Forms using XML

2002-10-25 Thread Affan Qureshi
Did you get a reply to this?

I am faced with a similar situation but in my case the information is coming
form a database. I created my Beans which had the properties to specify the
field type. Display Label, ids(name), etc. When I unmarshall my information
from the database I construct a collection of these beans. This colleciton
is passed on to the presentation to the Custom Tags that do the needed
rendering of the HTML fields.

Any comments/suggestions/improvements?

/* A

- Original Message -
From: "Bhamani, Nizar A TL56E" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, October 24, 2002 3:46 PM
Subject: Dynamic Forms using XML


> I have a scenario where, I need to develop Dynamic forms using an XML.
> i.e. the XML will specify what fields (all types of fields) need to be
> displayed
> on what page (i.e. page1, page2, etc). Has anybody out there worked on
> a similar scenario using Struts? Any help/input on this will be greatly
> appreciated.
>
> Thanks,
>
> Nizar Bhamani
>
> 
> CONFIDENTIALITY
> This e-mail and any attachments are confidential and also may be
privileged.
> If you are not the named recipient, or have otherwise received this
> communication in error, please delete it from your inbox, notify the
sender
> immediately, and do not disclose its contents to any other person,
> use them for any purpose, or store or copy them in any medium.
> Thank you for your cooperation.
> 
>
>
> --
> To unsubscribe, e-mail:
<mailto:struts-user-unsubscribe@;jakarta.apache.org>
> For additional commands, e-mail:
<mailto:struts-user-help@;jakarta.apache.org>
>


--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@;jakarta.apache.org>




Dynamic Forms using XML

2002-10-24 Thread Bhamani, Nizar A TL56E
I have a scenario where, I need to develop Dynamic forms using an XML.
i.e. the XML will specify what fields (all types of fields) need to be
displayed 
on what page (i.e. page1, page2, etc). Has anybody out there worked on 
a similar scenario using Struts? Any help/input on this will be greatly
appreciated.

Thanks,

Nizar Bhamani 


CONFIDENTIALITY
This e-mail and any attachments are confidential and also may be privileged.
If you are not the named recipient, or have otherwise received this 
communication in error, please delete it from your inbox, notify the sender
immediately, and do not disclose its contents to any other person, 
use them for any purpose, or store or copy them in any medium. 
Thank you for your cooperation. 



--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@;jakarta.apache.org>




dynamic forms and map-backed ActionForm beans

2002-08-29 Thread Donald Ball

Hi guys. I'm back to playing with the map-backed ActionForm beans again.
I've got a dynamically created HTML form that I'm trying to make play
nicely with a map-backed ActionForm. The ActionForm uses get/setProperty as
described by Ted Husted and works nicely. The problem I'm having is
accessing properties on the JSP page where the property is not known until
request-time. Here's the stupid example I'm working with:

<%@taglib uri='WEB-INF/struts-html.tld' prefix="html"%>

  
Foo Test
  
  
Foo Test


  bar: 
  <% String name1 = "bat"; %>
  bat: 
  <% String name2 = "fubar"; %>
  fubar: 
  

  


assuming my bean defines set/getProperty and set/getBat, this example will
compile and run, but the third HTML input's name is '<%=name2%>' and that's
also the name of the property it sets on the map-backed bean. Obviously, I
want the input's name and bean property to be 'fubar' instead. I'm not much
of a JSP expert so I bet I'm doing something stupid, but I've tried about a
half a dozen different things and nothing works right. Any suggestions?

Eventually, the name of the property is going to come from a List - I'm
going to be iterating over a List of name/value pairs and generating HTML
inputs for them. I was planning on using the logic:iterate tag to help with
that, dunno if that affects the suggested solutions or not.


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Dynamic Forms for sub/nested forms

2002-08-28 Thread Struts Rodolphe



Hi,

Is it possible that we can use Dynamic Forms for sub/nested forms 
declaratively?

Say I have the following scenario:

- I want to display a page  of "Vehicle Information" in which the user 
has the ability to add N vehicle(s) information as he/she wishes. Say 
the information consists of the following fields: "Year", "Model", 
"Color"..etc

Looking at that I'd need a simple form that consists of the above 3 
attributes, then a parent form that essentiallys get/set a LIST of simple 
forms.

Any Ideas?

Thanks,

 



-
Do You Yahoo!?
Yahoo! Finance - Get real-time stock quotes


RE: generating dynamic forms from XML at run-time (not initialisation time)

2002-08-15 Thread Oliver Burn

Hi,

I am working on a project that has a similar requirement to
dynamically construct and validate forms at runtime based on
information received from a back-end server. We are building a
front-end to a document management system.

I have spent a little bit of time researching into how Struts can be
used to support this requirement. I quickly came to the same
conclusion as you, that since Struts is driven from configuration
files, it is not truly dynamic.

The current approach I think will work is to use the underlying
Commons Validator and BeanUtils packages directly. A brief
investigation into the Validator shows that it is possible to supply
validation rules without requiring a static file. Equally I am sure
that the BeanUtils can be used to construct a dynamic form (that is
the point of it after all :-).

I intend to model the code in Struts to create an action that will
populate a dynamic bean and validate it.

Another big challenge is how to generate the HTML page. Since the form
is truly dynamic, it is not possible to use a simple JSP. I am not
sure what is the best approach to take here - especially as I would
like to the Struts tag libraries for form population (and hopefully
JavaScript validation). Some thoughts are:

- Write a JSP that loops over the fields to display, and have a
  massive case statement for each support type

- Use straight Java code and generate the HTML directly

- Write a custom tag library (variation on previous idea)


If any body out there has some real life experience out there with
these problems, it would be great to hear from you.

Regards,
Oliver

> -Original Message-
> From: Alex Birch [mailto:[EMAIL PROTECTED]]
> Sent: Friday, 16 August 2002 01:08
> To: [EMAIL PROTECTED]
> Subject: generating dynamic forms from XML at run-time (not
> initialisation time)
> 
> 
> Hi,
> 
> I'm having difficulty working out how to do the
> following using struts:
> 
> 3 separate pages:
> 
> 1. question.jsp... asks how many text boxes on the  
> next page and what the form name of each text box
> should be
> 
> 2. dynamicForm.jsp... displays a form with the number
> of text boxes specified in question.jsp - each named
> accordingly
> 
> 3. results.jsp... concatenates all the text box
> entries into a single string and displays it as simple
> text.
> 
> Is that possible? I can't find a way to do it (without
> some heavy rewriting). I've seen examples using
> indexed properties but I'd like to emulate the way
> DynaActionForms does it from the struts-config.xml.
> The problem is that the FormBeanConfigs are frozen
> (with freeze()) at init stage of the ActionServlet.
> 
> I want to generate a particular form at run-time from
> an xml file (similar to the form-beans section of
> struts-config.xml 1.1b2) which is also generated at
> run time.
> 
> I'd like to load the XML file inside an Action, edit
> the FormBeanConfig for the correct mapping ActionForm
> instance and forward to the dynamic form displaying
> page with an appropriate bean.
> 
> Can anybody tell me if this is possible (and how) with
> struts?
> 
> thanks
> 
> Alex
> 
> 
> 
> __
> Do You Yahoo!?
> Everything you'll ever need on one web page
> from News and Sport to Email and Music Charts
> http://uk.my.yahoo.com
> 
> --
> To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
> 

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




generating dynamic forms from XML at run-time (not initialisation time)

2002-08-15 Thread Alex Birch

Hi,

I'm having difficulty working out how to do the
following using struts:

3 separate pages:

1. question.jsp... asks how many text boxes on the  
next page and what the form name of each text box
should be

2. dynamicForm.jsp... displays a form with the number
of text boxes specified in question.jsp - each named
accordingly

3. results.jsp... concatenates all the text box
entries into a single string and displays it as simple
text.

Is that possible? I can't find a way to do it (without
some heavy rewriting). I've seen examples using
indexed properties but I'd like to emulate the way
DynaActionForms does it from the struts-config.xml.
The problem is that the FormBeanConfigs are frozen
(with freeze()) at init stage of the ActionServlet.

I want to generate a particular form at run-time from
an xml file (similar to the form-beans section of
struts-config.xml 1.1b2) which is also generated at
run time.

I'd like to load the XML file inside an Action, edit
the FormBeanConfig for the correct mapping ActionForm
instance and forward to the dynamic form displaying
page with an appropriate bean.

Can anybody tell me if this is possible (and how) with
struts?

thanks

Alex



__
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Dynamic Forms & FormBeans

2002-07-18 Thread JensStutte


Hi,

i had quite the same problem, one method is to use normal, non-struts input
boxes within a struts form for the dynamic part of the form. The generated
parameters can then be evaluated in the FormBeans validate function, since
you get the HttpRequest object there. I do not know a pure struts way to
achieve this (but after i made this workaround, i did not search any more ;
-).

Regards,

Jens Stutte



   
  
"Neil.Axtell"  
  
<[EMAIL PROTECTED]To: 
"'[EMAIL PROTECTED]'" 
ritsu.com><[EMAIL PROTECTED]> 
  
  cc:  
  
    18/07/2002 17.27  Subject: Dynamic Forms & FormBeans   
  
Please respond to  
  
"Struts Users  
  
Mailing List"  
  
   
  
   
  





Hello Struts-World.

Here's a Struts Newbie query I've got.

I really like being able to associate a FormBean with a Struts form and
then
doing the validation etc. at the server end. I understand about having to
have attributes in the FormBean that match the names of the input elements
in the HTML form.

However, I cannot think of a way of creating a FormBean that can cope with
a
form that has entirely dynamically generated output. For example, one that
creates a list of items in a shopping cart where every item has an
associated "delete" checkbox. I can ensure that each checkbox has a similar
name, (I'm using the name to indicate the cart item to which it relates
rather than the value at the moment) but how can I map these to attributes
in the Form bean? At design-time I will not know how many attributes I need
to supply, or what their full names will be. If I use the same name for
each
checkbox (i.e. all map to the same FormBean attribute) and hold the cart
item ID in the value how will I be able to store the different values?

I'm sure that there's a good "Struts way" to do this but I cannot see one
at
the moment. Can anyone out there enlighten me?

Many thanks.

Neil.

P.S. I'm currently using Struts 1.0.1 and would prefer to stay that way
until I get the current iteration of the project out of the way.



Neil Axtell
Principal Engineer (MMI/Web Technologies)
ANRITSU LIMITED
European Measurement Division - Engineering
200 Capability Green
Luton, UK
Tel:  +44 (0) 1582 433347
Fax: +44 (0) 1582 433276
E-Mail: [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>





-
This email message, together with any attachments, is for the exclusive and
confidential use of the addressee(s).  If you have received this message in
error, please notify the sender by email immediately, then delete the
message and any copies.  Any views or opinions presented herein are solely
those of the author and do not necessarily represent those of the Anritsu
group of companies.
-


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






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




Dynamic Forms & FormBeans

2002-07-18 Thread Neil.Axtell


Hello Struts-World.

Here's a Struts Newbie query I've got.

I really like being able to associate a FormBean with a Struts form and then
doing the validation etc. at the server end. I understand about having to
have attributes in the FormBean that match the names of the input elements
in the HTML form.

However, I cannot think of a way of creating a FormBean that can cope with a
form that has entirely dynamically generated output. For example, one that
creates a list of items in a shopping cart where every item has an
associated "delete" checkbox. I can ensure that each checkbox has a similar
name, (I'm using the name to indicate the cart item to which it relates
rather than the value at the moment) but how can I map these to attributes
in the Form bean? At design-time I will not know how many attributes I need
to supply, or what their full names will be. If I use the same name for each
checkbox (i.e. all map to the same FormBean attribute) and hold the cart
item ID in the value how will I be able to store the different values?

I'm sure that there's a good "Struts way" to do this but I cannot see one at
the moment. Can anyone out there enlighten me?

Many thanks.

Neil.

P.S. I'm currently using Struts 1.0.1 and would prefer to stay that way
until I get the current iteration of the project out of the way.



Neil Axtell
Principal Engineer (MMI/Web Technologies)
ANRITSU LIMITED
European Measurement Division - Engineering
200 Capability Green
Luton, UK
Tel:  +44 (0) 1582 433347
Fax: +44 (0) 1582 433276
E-Mail: [EMAIL PROTECTED] 





-
This email message, together with any attachments, is for the exclusive and
confidential use of the addressee(s).  If you have received this message in
error, please notify the sender by email immediately, then delete the
message and any copies.  Any views or opinions presented herein are solely
those of the author and do not necessarily represent those of the Anritsu
group of companies.
-


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




FW: Really dynamic forms (regex)

2002-07-12 Thread Michael Connor

I have not been able to find a way to provide this functionality.  Olivier
is more concerned with how to declare the fields that will be returned as
opposed to how to present them on the form.  You have to declare the fields
in the struts-config file to work with the DynaActionForm.  You could of
course do it the old fashioned way and just pull it out of the request but I
assume you're using the new validator and want to take advantage of
enforcing types.  From posts I've seen in the past, there is no way out of
the box to do this.

It would be cool if you could declare your parameter names using regular
expressions so you could say something like





So that you could have numbered parameters with the same root name and
validation could be done across all entries.

Anyone have any ideas?

Michael Connor

-Original Message-
From: Jon.Ridgway [mailto:[EMAIL PROTECTED]]
Sent: Friday, July 12, 2002 5:59 AM
To: 'Struts Users Mailing List'
Subject: RE: Really dynamic forms


Hi Olivier

In your case you could have an action create and populate an ArrayList with
empty passenger objects, add the list to a form, put the form into scope and
forward to a jsp. Then in the jsp iterate over the list displaying input
fields for each passenger object...easy...ish...

Jon Ridgway


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] 
Sent: 11 July 2002 16:40
To: [EMAIL PROTECTED]
Subject: Really dynamic forms

Hi !

Contrary to DynaActionForm which are rather declarative forms than dynamic
forms, I have a need for building forms that are parametric. For instance,
the Internet user specifies the number of elements he requires, and the
system builds dynamically a JSP form containing as many fields as the given
number. For instance, for a trip, he gives the number of passengers (let's
say 3) and the next form he sees contains 3 fields named for instance
passengerName1, passengerName2 and passengerName3.
Since I don't know how many fields there will be, how can I design an
ActionForm handling this ? If I were to use a DynaActionForm, I would
nonetheless be compelled to specify the fields in the struts-config.xml
file.
Hope this makes sense.
Thanks for your help.

Olivier Schmeltzer






Les donnees et renseignements contenus dans ce message sont personnels,
confidentiels et secrets. Ce message est adresse a l'individu ou l'entite
dont les coordonnees figurent ci-dessus. Si vous n'etes pas le bon
destinataire, nous vous demandons de ne pas lire, copier, utiliser ou
divulguer cette communication. Nous vous prions de notifier cette erreur a
l'expediteur et d'effacer immediatement cette communication de votre
systeme.

The information contained in this message is privileged, confidential, and
protected from disclosure. This message is intended for the individual or
entity adressed herein. If you are not the intended recipient, please do not
read, copy, use or disclose this communication to others ;also please notify
the sender by replying to this message, and then delete it from your system.


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


The contents of this email are intended only for the named addressees and
may contain confidential and/or privileged material. If received in error
please contact UPCO on +44 (0) 113 201 0600 and then delete the entire
e-mail from your system. Unauthorised review, distribution, disclosure or
other use of this information could constitute a breach of confidence. Your
co-operation in this matter is greatly appreciated. 



RE: Really dynamic forms

2002-07-12 Thread Jon.Ridgway

Hi Olivier

In your case you could have an action create and populate an ArrayList with
empty passenger objects, add the list to a form, put the form into scope and
forward to a jsp. Then in the jsp iterate over the list displaying input
fields for each passenger object...easy...ish...

Jon Ridgway


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] 
Sent: 11 July 2002 16:40
To: [EMAIL PROTECTED]
Subject: Really dynamic forms

Hi !

Contrary to DynaActionForm which are rather declarative forms than dynamic
forms, I have a need for building forms that are parametric. For instance,
the Internet user specifies the number of elements he requires, and the
system builds dynamically a JSP form containing as many fields as the given
number. For instance, for a trip, he gives the number of passengers (let's
say 3) and the next form he sees contains 3 fields named for instance
passengerName1, passengerName2 and passengerName3.
Since I don't know how many fields there will be, how can I design an
ActionForm handling this ? If I were to use a DynaActionForm, I would
nonetheless be compelled to specify the fields in the struts-config.xml
file.
Hope this makes sense.
Thanks for your help.

Olivier Schmeltzer






Les donnees et renseignements contenus dans ce message sont personnels,
confidentiels et secrets. Ce message est adresse a l'individu ou l'entite
dont les coordonnees figurent ci-dessus. Si vous n'etes pas le bon
destinataire, nous vous demandons de ne pas lire, copier, utiliser ou
divulguer cette communication. Nous vous prions de notifier cette erreur a
l'expediteur et d'effacer immediatement cette communication de votre
systeme.

The information contained in this message is privileged, confidential, and
protected from disclosure. This message is intended for the individual or
entity adressed herein. If you are not the intended recipient, please do not
read, copy, use or disclose this communication to others ;also please notify
the sender by replying to this message, and then delete it from your system.


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


The contents of this email are intended only for the named addressees and
may contain confidential and/or privileged material. If received in error
please contact UPCO on +44 (0) 113 201 0600 and then delete the entire
e-mail from your system. Unauthorised review, distribution, disclosure or
other use of this information could constitute a breach of confidence. Your
co-operation in this matter is greatly appreciated. 

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




Really dynamic forms

2002-07-11 Thread olschmeltzer

Hi !

Contrary to DynaActionForm which are rather declarative forms than dynamic
forms, I have a need for building forms that are parametric. For instance,
the Internet user specifies the number of elements he requires, and the
system builds dynamically a JSP form containing as many fields as the given
number. For instance, for a trip, he gives the number of passengers (let's
say 3) and the next form he sees contains 3 fields named for instance
passengerName1, passengerName2 and passengerName3.
Since I don't know how many fields there will be, how can I design an
ActionForm handling this ? If I were to use a DynaActionForm, I would
nonetheless be compelled to specify the fields in the struts-config.xml
file.
Hope this makes sense.
Thanks for your help.

Olivier Schmeltzer






Les donnees et renseignements contenus dans ce message sont personnels, confidentiels 
et secrets. Ce message est adresse a l'individu ou l'entite dont les coordonnees 
figurent ci-dessus. Si vous n'etes pas le bon destinataire, nous vous demandons de ne 
pas lire, copier, utiliser ou divulguer cette communication. Nous vous prions de 
notifier cette erreur a l'expediteur et d'effacer immediatement cette communication de 
votre systeme.

The information contained in this message is privileged, confidential, and protected 
from disclosure. This message is intended for the individual or entity adressed 
herein. If you are not the intended recipient, please do not read, copy, use or 
disclose this communication to others ;also please notify the sender by replying to 
this message, and then delete it from your system.


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




How to use nested: tags on dynamic forms?

2002-07-02 Thread @Basebeans.com

Subject: How to use nested: tags on dynamic forms?
From: <[EMAIL PROTECTED]>
 ===
Hello,

I try to use the nested tags on (dynamic) forms, and I have a problem.:(
To display a few records from collection list (or from other data) and
when the user selected the record (line) must by displayed additional
information about this record (from other collection), how to make this;
used
nested tags, struts?
Any idea or example, please. What is the preferred method for realized this?

Thomas



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




'nested tags' on dynamic forms - problem

2002-06-28 Thread @Basebeans.com

Subject: 'nested tags' on dynamic forms - problem
From: "Tomas" <[EMAIL PROTECTED]>
 ===

Od: "Tomas" <[EMAIL PROTECTED]>
Temat: 'nested tags' on dynamic forms - problem (struts)
Data: 28 czerwca 2002 10:31

hello,

can you help me:

how to used 'nested tags' on dynamic forms? do you have some example or
link?

please

Tomas






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




RE: Dynamic Forms

2002-06-21 Thread David Morris

Koen,

It is pretty simple. The following should work. 

ArrayList dynValues = new ArrayList();
...
public ArrayList getDynValues() {
  return dynValues;
}
public void setDynValues(ArrayList dynValues)
  this.dynValues = dynValues;
}

For the example I gave was simplified. I always use 
a bean for updatable properties so on my form I declare 
that bean, which contains the ArrayList and has the 
actual getter and setter. If that bean is named someBean 
on the form, the nested:iterate tag property is actually 
something like property="someBean.dynValues".

David Morris

>>> [EMAIL PROTECTED] 06/21/02 01:34AM >>>
David,

This is probably a very newbie question, but how are you gonna define
your getters and setters in your form bean?

Greetz,
Koen

-Original Message-
From: David Morris [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, June 20, 2002 7:49 PM
To: [EMAIL PROTECTED] 
Subject: RE: Dynamic Forms


Adrian,

Would it work to store your property name/values pairs 
in an arrayList and then use iterate or the nested tags 
to loop through the values when you display them? The 
generated text tag would then be something like 
property="dynValues[0].value" value="Some Value". You 
would build the arrayList of dynProps each one having a 
value, name pair.

  

  

  

David Morris


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




RE: Dynamic Forms

2002-06-21 Thread Koen Puttevils

David,

This is probably a very newbie question, but how are you gonna define
your getters and setters in your form bean?

Greetz,
Koen

-Original Message-
From: David Morris [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 20, 2002 7:49 PM
To: [EMAIL PROTECTED]
Subject: RE: Dynamic Forms


Adrian,

Would it work to store your property name/values pairs 
in an arrayList and then use iterate or the nested tags 
to loop through the values when you display them? The 
generated text tag would then be something like 
property="dynValues[0].value" value="Some Value". You 
would build the arrayList of dynProps each one having a 
value, name pair.

  

  

  

David Morris

>>> [EMAIL PROTECTED] 06/20/02 08:14AM >>>
Hi,

I have checked through almost the entire archive and encountered loads
of articles covering dynamic forms, but all use the DynaActionForm,
which requres the properties to specified in the struts-config.xml
file.

In most cases this is fine but for a few JSP's the property names are
being dynamically generated at run-time so I can't add them to the
struts-config file.

Adrian.

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

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




RE: Dynamic Forms

2002-06-20 Thread James Mitchell

I'm interested to know how you are dynamically persisting these fields?
Certainly not in a RDBMS.  Perhaps this can be resolved with better design.

It almost sounds like someone is shoving this design at you and expecting
you to code it this way.  Is this the case?  If not, there are better ways
to structure your application so you don't have to do such a hack job on the
front-end.



James Mitchell
Software Engineer\Struts Evangelist
Struts-Atlanta, the "Open Minded Developer Network"
http://struts-atlanta.open-tools.org




> -Original Message-
> From: Adrian Cunningham [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, June 20, 2002 10:14 AM
> To: Struts Users Mailing List
> Subject: RE: Dynamic Forms
>
>
> Hi,
>
> I have checked through almost the entire archive and encountered loads
> of articles covering dynamic forms, but all use the DynaActionForm,
> which requres the properties to specified in the struts-config.xml file.
>
>
> In most cases this is fine but for a few JSP's the property names are
> being dynamically generated at run-time so I can't add them to the
> struts-config file.
>
> Adrian.
>
> >  -Original Message-
> > From:   James Holmes <[EMAIL PROTECTED]>@KAINOS
> > Sent:   20 June 2002 14:29
> > To: Struts Users Mailing List
> > Subject:Re: Dynamic Forms
> >
> >
> > Check the mailing list archives.  This question was
> > answered in the past couple of days.
> >
> > http://www.mail-archive.com/struts-user@jakarta.apache.org
> >
> > -james
> > [EMAIL PROTECTED]
> > http://www.jamesholmes.com/struts/
> >
> >
> > --- Adrian Cunningham <[EMAIL PROTECTED]> wrote:
> > > Hi,
> > >
> > > I am writing a JSP that will contain a dynamic form.
> > >  It basically
> > > consists of a table in which each row contains
> > > various form elements,
> > > the number of rows in the table is variable.  For
> > > example:
> > >
> > > ...
> > >
> > > <%
> > >  for(int i = 0; i < 3; i++)
> > >  {
> > > %>
> > >
> > > 
> > >  
> > >   
> > >  
> > >  
> > >   
> > >  
> > >  
> > >   
> > >  
> > > 
> > >
> > > <%
> > >  }
> > > %>
> > >
> > > As you can see from the example I use a for loop to
> > > dynamically create
> > > the rows in the table.  As a result I need to
> > > specify unique names for
> > > each of the properites in the form so I also
> > > dynamically create the
> > > property names.  For this reason I can't use the
> > > ActionForm as it
> > > requires the properties, getters and setters to be
> > > defined.
> > >
> > > I thought the solution to my problem would be
> > > DynaActionForm but again
> > > it requires the properties to be specified in the
> > > struts-config.xml
> > > file, same problem.
> > >
> > > So how can I implement dynamic forms using Struts
> > > without having to
> > > write the form class and defining all my properties,
> > > getters and
> > > setters.
> > >
> > > Any help on this would be greatly appreciated.
> > >
> > > Thanks in advance.
> > >
> > > Adrian Cunningham
> > >
> > >
> > >
> > > --
> > >
> > > This e-mail is confidential and is intended for the
> > > named recipient only. If
> > > you receive it in error please destroy the message
> > > and all copies. Kainos
> > > Software Ltd. does not accept liability for damage
> > > sustained as a result of
> > > malicious software (e.g. viruses). Kainos does not
> > > accept liability for, or
> > > permit; the creation of contracts on its behalf by
> > > e-mail, the publication of
> > > any defamatory statement by its employees by e-mail,
> > > or changes subsequently
> > > made to the original message. The Company's
> > > registered office is located at
> > > 4-6 Upper Crescent, Belfast, BT7 1NT, Northern
> > > Ireland, Tel +44 28 9057 1100.
> > >
> >
> >
> > __
> > Do You Yahoo!?
> > Yahoo! - Official partner of 2002 FIFA World Cup
> > http://fifaworldcup.yahoo.com
> >
> > --
> > To unsubscribe, e-mail:
> > <mailto:[EMAIL PROTECTED]>
> > For additional commands, e-mail:
> > <mailto:[EMAIL PROTECTED]>
> >
>
>
> --
>
> This e-mail is confidential and is intended for the named
> recipient only. If
> you receive it in error please destroy the message and all copies. Kainos
> Software Ltd. does not accept liability for damage sustained as a
> result of
> malicious software (e.g. viruses). Kainos does not accept
> liability for, or
> permit; the creation of contracts on its behalf by e-mail, the
> publication of
> any defamatory statement by its employees by e-mail, or changes
> subsequently
> made to the original message. The Company's registered office is
> located at
> 4-6 Upper Crescent, Belfast, BT7 1NT, Northern Ireland, Tel +44
> 28 9057 1100.
>
> --
> To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>



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




RE: Dynamic Forms

2002-06-20 Thread David Morris

Adrian,

Would it work to store your property name/values pairs 
in an arrayList and then use iterate or the nested tags 
to loop through the values when you display them? The 
generated text tag would then be something like 
property="dynValues[0].value" value="Some Value". You 
would build the arrayList of dynProps each one having a 
value, name pair.

  

  

  

David Morris

>>> [EMAIL PROTECTED] 06/20/02 08:14AM >>>
Hi,

I have checked through almost the entire archive and encountered loads
of articles covering dynamic forms, but all use the DynaActionForm,
which requres the properties to specified in the struts-config.xml
file.

In most cases this is fine but for a few JSP's the property names are
being dynamically generated at run-time so I can't add them to the
struts-config file.

Adrian.

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




Re: Dynamic forms again

2002-05-28 Thread Adolfo Miguelez


AFAIK,

teorethically, you should be able to define the properties as String[] or 
ArrayList in struts-config and use dynabeans. I could do work both:

1. creating a form with dynabeans in the struts config,
2. creating an ActionForm with String[] and/or ArrayList properties, which 
could be used for dynamically generated forms,

but I have not been able to make them work together. I do not know if by my 
mistake or as a consequence of some bug. If you are able to make it work 
please drop a line.

Adolfo.

>From: Marcin Stañski <[EMAIL PROTECTED]>
>Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
>To: <[EMAIL PROTECTED]>
>Subject: Dynamic forms again
>Date: Tue, 28 May 2002 10:35:42 +0200
>
>Hi,
>
>I have a problem with dynamic forms in Struts.
>
>I use forms which content is dynamic - the number of properties (fields) 
>and
>their names are taken from database and can be changed during the session.
>
>I can't use DynaActionForm, because it requires to define its properties in
>struts-config.xml (or maybe I'm wrong ?).
>
>I was searching the Mail Archive, but I didn't find any solution.
>
>Can you suggest me something ?
>
>Thanks in advance
>Marcin Stanski
>
>
>--
>To unsubscribe, e-mail:   
><mailto:[EMAIL PROTECTED]>
>For additional commands, e-mail: 
><mailto:[EMAIL PROTECTED]>





  
 Adolfo's signature
  
  
 Adolfo Rodriguez Miguelez

  
  





_
MSN Photos is the easiest way to share and print your photos: 
http://photos.msn.com/support/worldwide.aspx


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




RE: Dynamic forms again

2002-05-28 Thread Mahesh Babu J

Hi,

I feel we cannot use DynaActionForm directly by extending. The source code I
downloaded checks for
formType="org...DynaActionForm" only. So I am not sure extending it, we
would get the required behavior
for dynamic properties in a DynaActionForm.

Thanks,
Mahesh


-Original Message-
From: Marcin Stański [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, May 28, 2002 2:06 PM
To: [EMAIL PROTECTED]
Subject: Dynamic forms again


Hi,

I have a problem with dynamic forms in Struts.

I use forms which content is dynamic - the number of properties (fields) and
their names are taken from database and can be changed during the session.

I can't use DynaActionForm, because it requires to define its properties in
struts-config.xml (or maybe I'm wrong ?).

I was searching the Mail Archive, but I didn't find any solution.

Can you suggest me something ?

Thanks in advance
Marcin Stanski


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



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




Dynamic forms again

2002-05-28 Thread Marcin Stański

Hi,

I have a problem with dynamic forms in Struts.

I use forms which content is dynamic - the number of properties (fields) and
their names are taken from database and can be changed during the session.

I can't use DynaActionForm, because it requires to define its properties in
struts-config.xml (or maybe I'm wrong ?).

I was searching the Mail Archive, but I didn't find any solution.

Can you suggest me something ?

Thanks in advance
Marcin Stanski


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




RE: Require sample code for Dynamic Forms

2002-05-16 Thread Michael Marrotte

I need help figuring out how to generate and use dynamic forms with Struts.

Is there already an eloquent MVC solution in Struts?

Is DynaActionForm the answer?

I can't see how extending the ActionForm behavior accomplishes this.  It
seems that to really implement a dynamic form, the form Bean would need to
be defined and instantiated at run-time, based on the HttpResponse generated
by the forms JSP.

For example:

Say the JSP for looks like the following:

<%-- myDynamic.jsp --%>




property="x-"





This will not work since "property" is required in the  tag.
However, if it did work, then it seems there would need to be some Action
that gets the HttpResponse from "myDynamic.jsp" and generates the source
(Java) form definition, e.g.:

// MyDynamicAction.java
...

for(Iterator i = A.iterator(); i.hasNext;)
 a = i.next();
 buffer.append("public setX-" +  a.getB() + "(String s) { ");
 buffer.append("  x-" + a.getB() + " = s ;");

...

And, then compiles and instantiates it.

Does this make any sense, whatsoever?  If I'm completely lost, then someone
please try and help point me in the right direction.


I got the JSP, found below,  to work within my application for implementing
dynamic forms.  The HTML 's are "named" dynamically with Struts
's, all within .  The Action that handles this
form processes the HttpServletRequest, filtering for parameters names that
start with the constant values, e.g.  "withholdingAmount_".  Since the
"names" in each row of the iteration are suffixed with the same key, e.g.
countyNumber-caseNumber, the parameters can be associated and processed
accordingly in the Action.

While this works, I get the feeling I'm re-inventing the wheel.  Is there a
100% Struts technique that renders this type of dynamicism? Any thoughts are
greatly appreciated.

Thanks,

Michael Marrotte

 

  

  
  

  
  

  
  

  
  
-">
  January
  February
...
/
-">
  1
  2
...
/
-"
   size="4" maxlength="4">
  
  
$-"
value= size="10" maxlength="10">
  

  

-Original Message-
From: veenak [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 15, 2002 10:41 PM
To: [EMAIL PROTECTED]
Subject: Require sample code for Dynamic Forms


Hi All,

I am developing an application which requires the generation of forms
dynamically.
My Form bean class is extending from "DynaActionForm " class.
Currently my application is not working and I am getting an exception
"javax.servlet.ServletException: Exception creating bean of class
FormBean{1}"

I need more information about the  implementing  "DynaActionForm "
class and
also about writing the Dynamic Form jsp file.

Can any one please help me  with set of sample code or the URL that has
example
for implementing the Dynamic forms.

Regards
Veena




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


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




Require sample code for Dynamic Forms

2002-05-15 Thread veenak

Hi All,

I am developing an application which requires the generation of forms
dynamically.
My Form bean class is extending from "DynaActionForm " class.
Currently my application is not working and I am getting an exception
"javax.servlet.ServletException: Exception creating bean of class
FormBean{1}"

I need more information about the  implementing  "DynaActionForm "
class and
also about writing the Dynamic Form jsp file.

Can any one please help me  with set of sample code or the URL that has
example
for implementing the Dynamic forms.

Regards
Veena




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




Dynamic Forms?

2002-05-15 Thread Michael Marrotte

I need help figuring out how to generate and use dynamic forms with Struts.

Is there already an eloquent MVC solution in Struts?

Is DynaActionForm the answer?

I can't see how extending the ActionForm behavior accomplishes this.  It
seems that to really implement a dynamic form, the form Bean would need to
be defined and instantiated at run-time, based on the HttpResponse generated
by the forms JSP.

For example:

Say the JSP for looks like the following:

<%-- myDynamic.jsp --%>




property="x-"





This will not work since "property" is required in the  tag.
However, if it did work, then it seems there would need to be some Action
that gets the HttpResponse from "myDynamic.jsp" and generates the source
(Java) form definition, e.g.:

// MyDynamicAction.java
...

for(Iterator i = A.iterator(); i.hasNext;)
 a = i.next();
 buffer.append("public setX-" +  a.getB() + "(String s) { ");
 buffer.append("  x-" + a.getB() + " = s ;");

...

And, then compiles and instantiates it.

Does this make any sense, whatsoever?  If I'm completely lost, then someone
please try and help point me in the right direction.

Thanks,

--Michael Marrotte


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




Implementing Dynamic Forms, mixing Struts tags with plain HTML controls...

2002-05-15 Thread Michael Marrotte

I got the JSP, found below,  to work within my application for implementing
dynamic forms.  The HTML 's are "named" dynamically with Struts
's, all within .  The Action that handles this
form processes the HttpServletRequest, filtering for parameters names that
start with the constant values, e.g.  "withholdingAmount_".  Since the
"names" in each row of the iteration are suffixed with the same key, e.g.
countyNumber-caseNumber, the parameters can be associated and processed
accordingly in the Action.

While this works, I get the feeling I'm re-inventing the wheel.  Is there a
100% Struts technique that renders this type of dynamicism? Any thoughts are
greatly appreciated.

Thanks,

Michael Marrotte

 

  

  
  

  
  

  
  

  
  
-">
  January
  February
...
/
-">
  1
  2
...
/
-"
   size="4" maxlength="4">
  
  
$-"
value= size="10" maxlength="10">
  

  



Re: Dynamic Forms?

2002-05-15 Thread Adolfo Miguelez


Hi Michael,

I run in the same issue days ago. I could not find a proper solution for 
Struts 1.0.*. The right answer, I think is using String[] as type of data in 
ActionForms. By instance, you can wrap all HTML inputs () in a unique parameter:

String[] inputs with get and set methods in handling the String[]. In the 
JSP, you set property as equals input[1], input[2] for the different 
inputs. The same could be applied for checkboxes, radios, or selects.

- In Struts 1.1b1, if you set a breakpoint at validate() method in 
ActionForm, by instance, you will find the parameter input filled with 
values collected from the JSP, so you can process them. Same applies for the 
selects, radios and checkboxes. This behaviour does not seems to work in 
Struts 1.0.*, I guess that by some bug in fetching indexed property values.

- Either in Struts 1.0.* or 1.1b1, if you preset the String[] with values, 
JSP will show them when displayed.

I have not test it, by I suppose you can use DynaActionForms and define 
String[] in the struts-config

Hope it helps.

Adolfo

>From: "Michael Marrotte" <[EMAIL PROTECTED]>
>Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
>To: <[EMAIL PROTECTED]>
>Subject: Dynamic Forms?
>Date: Wed, 15 May 2002 08:07:18 -0700
>
>I need help figuring out how to generate and use dynamic forms with Struts.
>
>Is there already an eloquent MVC solution in Struts?
>
>Is DynaActionForm the answer?
>
>I can't see how extending the ActionForm behavior accomplishes this.  It
>seems that to really implement a dynamic form, the form Bean would need to
>be defined and instantiated at run-time, based on the HttpResponse 
>generated
>by the forms JSP.
>
>For example:
>
>Say the JSP for looks like the following:
>
><%-- myDynamic.jsp --%>
>
>
>
>
>   property="x-"
>
>
>
>
>
>This will not work since "property" is required in the  tag.
>However, if it did work, then it seems there would need to be some Action
>that gets the HttpResponse from "myDynamic.jsp" and generates the source
>(Java) form definition, e.g.:
>
>// MyDynamicAction.java
>...
>
>for(Iterator i = A.iterator(); i.hasNext;)
>  a = i.next();
>  buffer.append("public setX-" +  a.getB() + "(String s) { ");
>  buffer.append("  x-" + a.getB() + " = s ;");
>
>...
>
>And, then compiles and instantiates it.
>
>Does this make any sense, whatsoever?  If I'm completely lost, then someone
>please try and help point me in the right direction.
>
>Thanks,
>
>--Michael Marrotte
>
>
>--
>To unsubscribe, e-mail:   
><mailto:[EMAIL PROTECTED]>
>For additional commands, e-mail: 
><mailto:[EMAIL PROTECTED]>
>


_
Chat with friends online, try MSN Messenger: http://messenger.msn.com


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




Dynamic Forms?

2002-05-15 Thread Michael Marrotte

I need help figuring out how to generate and use dynamic forms with Struts.

Is there already an eloquent MVC solution in Struts?

Is DynaActionForm the answer?

I can't see how extending the ActionForm behavior accomplishes this.  It
seems that to really implement a dynamic form, the form Bean would need to
be defined and instantiated at run-time, based on the HttpResponse generated
by the forms JSP.

For example:

Say the JSP for looks like the following:

<%-- myDynamic.jsp --%>




property="x-"





This will not work since "property" is required in the  tag.
However, if it did work, then it seems there would need to be some Action
that gets the HttpResponse from "myDynamic.jsp" and generates the source
(Java) form definition, e.g.:

// MyDynamicAction.java
...

for(Iterator i = A.iterator(); i.hasNext;)
 a = i.next();
 buffer.append("public setX-" +  a.getB() + "(String s) { ");
 buffer.append("  x-" + a.getB() + " = s ;");

...

And, then compiles and instantiates it.

Does this make any sense, whatsoever?  If I'm completely lost, then someone
please try and help point me in the right direction.

Thanks,

--Michael Marrotte


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




Dynamic forms - same action

2001-11-27 Thread Anil Mandava

Hi,
I am looking at Amazon.com's kind of shopping page, where they have multiple
forms, one for each item.
Pressing "Add to cart" on any form will probably invoke the same application
on their server, even though their actions (encoded with item ID) were
different. Perhaps, that application will use the form's action to decipher
which item user wanted.

Could we do this kind of thing with Struts ?
It seems to me that the action URL is tied closely to the Struts action, so
there is no way to map a set of actions URLs (based on some pattern) to
invoke the same Struts action.

Any help is greatly appreciated.
Thank you,
Anil

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Dynamic forms

2001-09-21 Thread Arkadiusz Janowski



Hello again,
I think I have to ask an old question.
Is there a way to define a form with struts-tags, 
that has a not specified number of fields?
I am creating an application to maintain 
DB-tables, but I don't want to define a separate mapping and an ActionForm 
for every table. Is there a way to do it?
Thanks for suggestions
Arkadiusz
 


Dynamic Forms

2001-06-25 Thread Andrew Paul Swift

I have a form that has a variable number of fields determined by an XML
document.
e.g.



etc...


I can't think of any ways in which to use the struts framework to handle
this. 
If I am right in thinking that I have to hardcode a form object.

Any ideas??

cheers in advance

Andrew



 


-
To send us encrypted mail, please refer to:
http://www.millionhandshakes.com/emailpolicy/pgp.html

Million Handshakes