Renato,
There is another solution that is clean.
We use one action class with multiple (3) mappings to support our
validation needs. With our editor scheme, the user proceeds to a Top
page where they decide to Edit an existing or Add a new item. They then
proceed to a Detail page where
Hi Sudhakar,
Your JSP should populate the form fields in the same way for both add and
modify actions. Specifically, your action class should initialize the form
for the jsp. When the page is rendered, it will be populated the way that
you want.
Nick
Ted,
The origin of this thread had to do with using Indexed Properties and a
Dyna* form. As when using the ActionForm, getting the values to the
browser is not an issue. The area where the difficulty arises is when the
values are returned from the browser.
When using the ActionForm (or
into your form (formName.selectedItems[0].fieldName) then
Struts should
handle the rest.
Does that help at all?
robert
-Original Message-
From: Nicholas L Mohler [mailto:[EMAIL PROTECTED]
Sent: Thursday, December 11, 2003 7:46 AM
To: Struts Users Mailing List
Subject: Re: dynamically
The reason you get the null pointer exception is that the inventoryList
property in your DynaActionForm is created empty. The exception occurs
when Struts tries to populate inventoryList[0].startNumber or
inventoryList[0].endNumber.
Even though I haven't used the DynaActionForm, I know that
Matt,
Find the thread titled Using a collection of Beans within an ActionForm
from yesterday. It has the answer that you need.
Nick
an answer to. Is there a way to do a dynamically sized form using a
DynaForm, instead of a custom form bean class for each one.
Thanks again for any insights,
Matt
- Original Message -
From: Nicholas L Mohler [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Thursday
Ed,
You can find examples of this by searching the archive for indexed
properties. You are getting this exception because the Form collection
does not have enough entries to support the property that you are trying to
populate. You need to insure that the getter that returns a single bean
George,
I have done something similar to this. I haven't looked at browser
compatability yet(we're currently using this with ie6), but the concept
that I use is that I look at the parents of the form field, trying to find
out if the element is hidden. If I find that a parent that is
Is the name of your form correct? Your iterate tag had empForm, but you
state that your form is called EmpForm.
Other thought: Have you declared the logic taglib in your jsp?
Nick
Hi Rajat,
You could use an Array. If your form is in the session, as opposed to the
request, the array will never go away, so the array will retain its size.
I can't do that in our app as our UI presents a spreadsheet and allows
the user to add and remove rows. For that reason, I use an
Hi Vara,
I have implemented client-side validations for indexed properties, but I
have done it through custom validators. Look through the archive for a
thread titled Validation of Indexed properties. I describe how I
implemented the client side validations for indexed properties.
Nick
Nick
http://www.mail-archive.com/[EMAIL PROTECTED]/msg19122.html
is this the message you are talking about or something else ?
Vara Prasad
-Original Message-
From: Nicholas L Mohler
Hi Ranjat,
Take a look at the mail archive. There are at least two threads that I
have posted to that discuss indexed properties. I think that you'll find
just about everything you need in those threads. There is info about (1)
building your page with indexed properties and (2) getting
Haiwei,
Would the bean:define tag meet your needs? The value is available for
use when building the page, but I don't believe that it is in the form
dataset.
Alternatively, you might consider extending the hidden tag for your needs.
Once it works, you could submit the code as a candidate
Saul,
Thanks for the responses to the question. So you are suggesting that I
have a jsp that really has the sole purpose of acting as a javascript
container that will be usable on the client side, but not rendered to the
page. This may be a dumb question: is that possible? The jsp would
I apologize if this is a question that has already been addressed, but I've
not been able to find an answer...
We have implemented the validation framework into our webapp and it works
well. We have noticed that all of the validation javascript is loaded into
the web page, even if the
If you do not specify a name attribute, then an assumption is made that the
specified property is an attribute in the form that is associated with the
mapping.
If you have a mapping (SampleAction) that uses a form (SampleForm), then
the example you gave below assumes that the SampleForm
I have done some work with client-side indexed field validation...mostly, I
have written a couple custom validations that can validate indexed or
non-indexed fields based on a few attributes that I set in validation.xml.
My validators are somewhat pointed towards my particular needs and the
We have a similar situation using action classes based on the
LookupDispatchAction. We have not implemented this yet, but our approach
will be to have two action mappings. We'll do the following:
In the form class, we'll override validate() to do three things:
1) call super.validate().
2)
Cameron,
Are you sure that your request attributes are named that way? I read that
as a 3 dimensional table...do you really have that in your page?
If you are getting those request attributes, then I'm stumped, but I'd love
to know the answer :-)
Otherwise...you need a getter/setter for
Chirag,
I looked at your code, and it looks right. It makes me think that
something must be wrong with the data. Your data should look like this:
- You have an object called Results in scope that has a collection property
called tabledata (tbdata).
- Each object in the tbdata collection
config.xml or my
ActionClass.
The weird thing is that the first iterate works fine - for the column
headings.
And the outer loop in the second iterate works too. It will print out
the collection in cell one of the tabledata for example.
-Original Message-
From: Nicholas L Mohler [mailto
Look at the way that you have named your ColumnNames property in the jsp
and your form. Try it with property=columnNames with form methods
getColumnNames and setColumnNames. We've had seen that problem a couple
times on our team and lining the names up properly does the trick.
Nick
I have a similar function where I allow the user to view the contents of
various DB tables in my system. My process works like this:
1) I build a collection of the column names that will be shown.
2) I then extract the values for each row from the ResultSet using the
collection of column
Not sure why this works when the form is in the session, but I think I see
why it doesn't work in the request...
I am pretty sure this is a naming issue. I would suggest changing the name
of the singular indexedBeans to indexedBean in two places:
1) In your JSP, the id attribute in the
Hi Dave,
There was a good thread about using indexed properties a little over a week
ago (7/28-7/30). Find that thread and you should find all of the answers
that you need in order to use and process indexed properties on your form.
Even though the thread wanders a little, everything that
My experience...you have to explain the consequences in layman's terms (no
geek talk, and yes, I am a computer geek). If you can, instead of
explaining why the software won't work given the requirement, and a
real-life example that the customer can relate to and understand...for
example,
Sridhar,
See the thread from 7/28-7/30 titled inxeded properties. Everything you
need is in that thread. The basic problem here is that your Form class
properties and your jsp names need to line up properly. The thread I
mentioned should help you out.
Nick
.
Hope this gives you the background and thanks once more for taking some
out
to hlep me.
ATTA
- Original Message -
From: Nicholas L Mohler [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Monday, July 28, 2003 1:09 PM
Subject: Re: Indexed Properties
getter/setters for id, name and category.
In ActionForm I also included setCategory(int) and getCategory(int, string)
which doesn't seem to be called at all!
something obvious that i'm missing?
Thanks.
ATTA
- Original Message -
From: Nicholas L Mohler [EMAIL PROTECTED]
To: Struts Users
Hi,
I am currently imple,enting the Struts validator into our web app. All is
going pretty well with the exception of client-side indexed property
validation. I have looked at the Validator documentation, and gone through
this list looking for some idea that will give me a clue as to what I
Atta,
You can use indexed properties in your ActionForm class. The key is having
all of the correct methods in your form class.
1) Getter and setter: You need a get/Set method for the collection that
you refer to in your jsp. for example:
public Collection getLocations()
public void
with the fact that my individual fruit is a string
object rather than being a bean in itself if some getter method(s)?
can you see what's going wrong!
Thanks again.
ATTA
- Original Message -
From: Nicholas L Mohler [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent
34 matches
Mail list logo