RE: Multibox problem

2005-07-06 Thread Apte, Dhanashree (Noblestar)


Code where i put the values back:
map.put(districtIds, stringArr);
where stringArr is an array of what the user selected.


- This is not the same as calling setDistrictIds. You need to call
setDistrictIds(stringArr) explicitly.


Checkbox question

2005-06-29 Thread Apte, Dhanashree (Noblestar)
Hi all,

I have a jsp which shows rows of data. Each row is preceded by a checkbox. i
can check the boxes and hit a delete button and it is supposed to delete the
selected rows. In my page i have:

logic:iterate id=aBean name=myForm property=allRecords
tr
class=%RecordCounter++;
bgcolor = alternateRow;
if (RecordCounter % 2 == 1)
bgcolor = normalRow;
out.print(bgcolor);%
td width=1%html:checkbox name=aBean property=temporaryId
value=temporaryId //td 
td class=formDebean:write name=aBean property=attr1 //td
td class=formDebean:write name=aBean property=attr2 //td
td class=formDebean:write name=aBean property=attr3 //td
td class=formDebean:write name=aBean property=attr4 //td
td class=formDebean:write name=aBean property=attr5 //td  
/tr
/logic:iterate

I am unable to identify the rows uniquely by clicking on the checkboxes. The
syntax for one of the two would help:

I would like to use the value of the RecordCounter to get submitted as the
checkbox value. (but i dont know the syntax). OR..

I would like to have the vaue of the field temporaryId passed back. right
now, with what i have, i just get a String array called temporaryId and
temporaryId[0] = temporaryId, temporaryID[1]=temporaryId. I want the
actual value of the temporaryId attribute back instead of just
temporaryId.

Any help is appreciated.

Thanks!
Dhanashree.



html:multibox question

2005-05-25 Thread Apte, Dhanashree (Noblestar)

I have a page that has a series of check-boxes that a user can
select/deselect at will. When the page loads up, some of the checkboxes are
already checked. The user can then either select new ones or deselect
existing ones. However, when I submit the page, the unselected ones are
still a part of my selectedItems[] array.

How do I make sure that only the selected ones get through?

Thanks a bunch,
Dhanashree/



Beginner question...

2005-03-31 Thread Apte, Dhanashree (Noblestar)

This is the first time I am doing web programming and using struts as well.
I have been meaning to ask this ever since I started. At the risk of
sounding stupid, here is the question:

If struts is smart enough to figure out logic:iterate and put out the
attributes of each bean from the collection neatly for editing, why is it
not smart enough to figure out which element the user edited and put the
changed value back in the right property of the right bean in original
collection? Why do I need to have both:
* the Collection attribute for loading up my edit page AND
* the string array for every editable attribute to track the edits made by
the user?

Thanks!
Dhanashree.


RE: passing object in request from jsp to action

2005-03-31 Thread Apte, Dhanashree (Noblestar)
... meaning in the Action you want to reference it by doing 
request.getParameter(someAttribute); 
Is that correct? If so, on the jsp, in the link to your action, add that
parameter as well. Instead of just 
a href=/someAction.do 
use
   a href=/someAction.do?someAttribute=123.

Hope this helps,
Dhanashree.

-Original Message-
From: temp temp [mailto:[EMAIL PROTECTED] 
Sent: Thursday, March 31, 2005 1:11 PM
To: user@struts.apache.org
Subject: passing object in request from jsp to action

I want pass an object  from a jsp to an struts action  in request attribute.

I have a jsp it got  link to an action upon click the action is invoked. How
can I pass object to this action  using request Attribute.
thanks  regards




__
Do you Yahoo!? 
Yahoo! Small Business - Try our new resources site!
http://smallbusiness.yahoo.com/resources/ 

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



RE: passing object in request from jsp to action

2005-03-31 Thread Apte, Dhanashree (Noblestar)
the same... my bad I wrote request.getParameter()   instead of
request.getAttribute().
:) Sorry!

The solution below should work for you...
-Original Message-
From: temp temp [mailto:[EMAIL PROTECTED] 
Sent: Thursday, March 31, 2005 1:18 PM
To: Struts Users Mailing List
Subject: RE: passing object in request from jsp to action

I want to use request.getAttribute(string,object);
thanks  regards

--- Apte, Dhanashree (Noblestar)
[EMAIL PROTECTED] wrote:
 ... meaning in the Action you want to reference it by doing
 request.getParameter(someAttribute);
 Is that correct? If so, on the jsp, in the link to your action, add 
 that parameter as well. Instead of just
 a href=/someAction.do
 use
a href=/someAction.do?someAttribute=123.
 
 Hope this helps,
 Dhanashree.
 
 -Original Message-
 From: temp temp [mailto:[EMAIL PROTECTED]
 Sent: Thursday, March 31, 2005 1:11 PM
 To: user@struts.apache.org
 Subject: passing object in request from jsp to action
 
 I want pass an object  from a jsp to an struts action  in request 
 attribute.
 
 I have a jsp it got  link to an action upon click the action is 
 invoked. How can I pass object to this action  using request 
 Attribute.
 thanks  regards
 
 
 
   
 __
 Do you Yahoo!? 
 Yahoo! Small Business - Try our new resources site!
 http://smallbusiness.yahoo.com/resources/
 

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



__
Do you Yahoo!? 
Take Yahoo! Mail with you! Get it on your mobile phone. 
http://mobile.yahoo.com/maildemo 

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



Design question

2005-03-30 Thread Apte, Dhanashree (Noblestar)
 
Hi All,

What would be the way to go with forms when I have multiple tabs on a web
page?
Single form for all the tabs or multiple forms (one for each tab)?
Does anyone know of an example that I could look at?

Thanks a lot!
Dhanashree.


I need help..

2005-03-09 Thread Apte, Dhanashree (Noblestar)
I have a page that needs to display two empty addresses (each address is a
combination of street1, street2, city, state, zip) for user input.
The Form for that page has a collection of AddressBeans and the jsp iterates
over this collection to display the Address section.

The Action that displays this page initializes the form's collection to have
two empty AddressBeans so that when the jsp iterates over it, it will
display the two empty address sections for the user to input data.

The problem is that though the page displays correctly with two empty
addresses, whatever the user types in is not getting set on the
corresponding AddressBeans of the form collection.

Am I doing something wrong here? Any help/suggestions would be appreciated.
I am trying to hit a deadline and I have no clue what is causing this
problem.

Thanks!
Dhanashree.



Partial Validations

2005-01-06 Thread Apte, Dhanashree (Noblestar)

I have a UserForm which holds data for two wizard-type data entry pages,
meaning, a user enters half the information on one page, hits NEXT, enters
the remaining information on the next page and hits SUBMIT.

Example: UserForm has name, id, dob, countryOfResidence being populated from
the first page and street1, street2, street3, city, state, zip being
populated from the second page.

On the first page, the name and countryOfResidence are required fields and
on the second page street1, city, state, zip are required.

How do I setup the struts validator so that I can only run the validations
for name and countryOfResidence piece of the UserForm when the user hits
NEXT on the first page and then run the validations for street1, city,
state, zip when the user hits SUBMIT on the second page?

Thanks for any help,
-Dhanashree.


OT: Syntax checker

2004-12-10 Thread Apte, Dhanashree (Noblestar)
Sorry for the deviation, but is there an easy way to find out what exactly
is causing 
org.apache.jasper.compiler.ParseException: End of content reached while more
parsing required: tag nesting error?
error on a jsp? Maybe run it through some tool which points out the
problematic tag?
 
Thanks!
Dhanashree.


Nested properties with javascript

2004-11-17 Thread Apte, Dhanashree (Noblestar)
Hi,
 
In my jsp, i am using nested properties of a form. 
 
RoleForm has UserForm which has agencies, agencyName and agencyId within it.
The agencies and divisions need to be displayed in dropdown boxes.
 
I got this to display correctly on my jsp using: 
 
html:select property=userForm.agencyId onchange=fillSelect(this.form)

html:option key=select.generic value= / 

html:optionsCollection property=userForm.agencies value=agencyId
label=agencyName /

/html:select

However, in the javascript for the onChange of this dropdown, i need a
handle to this dropdown.
the fillSelect function needs to do:
function fillSelect(el)

{

   var theSelect = el.agencyId;  // == How do i get the dropdown handle
here?

   var num = theSelect.options[theSelect.selectedIndex].value;

  :

  : // more procesing

}

With the above, i get the error: theSelect has no properties.

If i put in var theSelect = el.userForm.agencyId, i get the error:
el.userForm has no properties.
 
What would be the correct way to access the dropdown box?
 
Any help appreciated.
Thanks,
Dhanashree.


RE: Problem with null value

2004-11-16 Thread Apte, Dhanashree (Noblestar)
If you are trying to do different processing in your action based on
different buttons clicked in the form, you can use 
the Struts LookupDispatchAction instead of the normal Action class.

It lets you map the buttons on your page to separate methods in your action.

Please refer the struts API documentation on LookupDispatchAction for more
information.

Hope this helps,
Dhanashree. 

-Original Message-
From: Mauro Morales M. [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, November 16, 2004 9:14 AM
To: [EMAIL PROTECTED]
Subject: Problem with null value

Hi,

In  my .jsp have follow html code

html:submit property=resActualizar value=Actualizar/ html:submit
property=resEliminar value=Eliminar /

First is my update button, second delete button, both in same form.

This is my form code

public String getResActualizar () {
return this.resActualizar;
}
public void setResActualizar (String resActualizar) {
this.resActualizar = resActualizar;
}
public String getResEliminar () {
return this.resEliminar;
}
public void setResEliminar (String resEliminar) {
this.resEliminar = resEliminar;

In my action have follow code

System.out.println(subform.getResActualizar());

then print in STDOUT Actualizar

In case of

System.out.println(subform.getResEliminar());

print in STDOUT null

then in action code when i do

if (subform.getResEliminar().equals(Eliminar))

do it nothing ...

Help me please ...

Thanks,

-- Mauro


-
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: Nested Properties in ActionForms

2004-11-02 Thread Apte, Dhanashree (Noblestar)
:) thanks for pointing that out.. that was a dumb mistake I made while
typing in my question. They are public in the actual class.


-Original Message-
From: Karr, David [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, November 02, 2004 10:39 AM
To: Struts Users Mailing List
Subject: RE: Nested Properties in ActionForms

Your accessors on the Form class are private.  Make them public.

 -Original Message-
 From: Apte, Dhanashree (Noblestar) [mailto:[EMAIL PROTECTED]
 Sent: Monday, November 01, 2004 9:26 AM
 To: 'Struts Users Mailing List'
 Subject: Nested Properties in ActionForms
 
 
 Hi All,
 
 I need to know the correct way to display nested properties of a form 
 on my jsp using struts.
 
 I have an ActionForm of type:
 
 public class EmployeeInfoForm extends ActionForm {
   private Name empName;
   private Name spouseName;
 
   private String getFirstName() {
   return empName.getFirstName();
   }
 
   private void setFirstName(String fn) {
   empName.setFirstName(fn);
   }
 }
 
 and the class Name has the following structure:
 
 public class Name {
   private String firstName;
   private String middleName;
   private String lastName;
 
   public String getFirstName() {
   return firstName;
   }
  
   public void setFirstName(String fn) {
   firstName = fn;
   }
 }
 
 
 On the jsp I have:
 bean:write name=employeeForm property=firstName/
 
 I get the exception: No getter method for property firstName of bean 
 employeeForm.
 
 
 What is the correct way to accomplish what I am trying to do here? Any 
 help appreciated.
 
 Thanks a lot!
 Dhanashree.
 
 
 -
 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]



Nested Properties in ActionForms

2004-11-01 Thread Apte, Dhanashree (Noblestar)
Hi All,

I need to know the correct way to display nested properties of a form on my
jsp using struts.

I have an ActionForm of type:

public class EmployeeInfoForm extends ActionForm {
private Name empName;
private Name spouseName;

private String getFirstName() {
return empName.getFirstName();
}

private void setFirstName(String fn) {
empName.setFirstName(fn);
}
}

and the class Name has the following structure:

public class Name {
private String firstName;
private String middleName;
private String lastName;

public String getFirstName() {
return firstName;
}
 
public void setFirstName(String fn) {
firstName = fn;
}
}


On the jsp I have:
bean:write name=employeeForm property=firstName/

I get the exception: No getter method for property firstName of bean
employeeForm.


What is the correct way to accomplish what I am trying to do here?
Any help appreciated.

Thanks a lot!
Dhanashree.


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



RE: Nested Properties in ActionForms

2004-11-01 Thread Apte, Dhanashree (Noblestar)

With this, I get:

No getter method for property empName.firstName of bean employeeForm.

Thanks! 

-Original Message-
From: Ankur Gupta [mailto:[EMAIL PROTECTED] 
Sent: Monday, November 01, 2004 11:47 AM
To: 'Struts Users Mailing List'
Subject: RE: Nested Properties in ActionForms

bean:write name=employeeForm property=empName.firstName/


-
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: The get() Method in the ActionForm

2004-10-13 Thread Apte, Dhanashree (Noblestar)
Caroline,

It would be the right way or wrong way depending upon where in your class
you are calling this method.
Could you paste the code for your form as well? 

-Dhanashree.
-Original Message-
From: Caroline Jen [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, October 13, 2004 11:17 AM
To: [EMAIL PROTECTED]
Subject: The get() Method in the ActionForm

I have selectRecipientsForm that extends ActionForm.

After the form is populated, I have this:

String[] to =
SelectRecipientsForm.getSelectedEmailAddresses();

I thought that it was the right way to get something in the populated form;
but, the compiler says that the non-static method
getSelectedEmailAddresses() cannot be referenced from a static context.

What should I do?

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com 

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



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