RE: requiredif validation challenge

2003-12-12 Thread Udaya Allu
Hi Clark,

The following is similar validation in struts 1.1 final release working fine, for the 
case first  field is necessary when second field is null, otherwise one of the two 
shall be available. Do not bother about additional condition of page attribute of page.
It is just show how to use two fields in required if.
The error your code is in in  var-name 
change from field-test[0] to fieldTest[0] in final release of struts 1.1
can find this in struts validation doc.
Hope this will help
-Udaya 

   



  
field[0]
currentPage
  
  
fieldTest[0]
EQUAL

  
fieldValue[0]
1
  
  
field[1]
domain
  
  
fieldTest[1]
NULL
  
  
fieldJoin
AND






mask

^[a-zA-Z0-9]+([-.]*[a-zA-Z0-9])*$





-Original Message-
From: Clark Kent [mailto:[EMAIL PROTECTED]
Sent: Friday, December 12, 2003 12:01 PM
To: Struts Users Mailing List
Subject: requiredif validation challenge



I use Struts 1.1 and tried to add the patch for the requiredif validator in 
validator-rules.xml.  

Following is the code that I added in the validation.xml for the form.  The form has 2 
fields and only one of them can be filled inorder to perform a search.





field[0]
userID



field-test[0]
NULL









field[0]
acctID



field-test[0]
NULL
 



It seems like inspite of the above, it still doesnt seem to validate requiredif 
validator and proceeds with the submit anyway.  Can someone guide me?

Clark


-
Do you Yahoo!?
New Yahoo! Photos - easier uploading and sharing

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



RE: Conditional check for depends clause in Validation.xml

2003-12-11 Thread Udaya Allu
use requiredif or validatewhen in the place of required

-Original Message-
From: Clark Kent [mailto:[EMAIL PROTECTED]
Sent: Thursday, December 11, 2003 3:59 PM
To: usergroup
Subject: Conditional check for depends clause in Validation.xml



I have a scenario where I have 2 textboxes in a form and I need to have the user enter 
either one of the fields but not both.  





   

Is there a way that we can provide conditional checks within the depends clause?

Thanks,

CK.

 

 



-
Do you Yahoo!?
New Yahoo! Photos - easier uploading and sharing

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



RE: problem in javascript for select enabled/disabled by checkbox in a list with in logic iterate

2003-12-11 Thread Udaya Allu
HI Firat,
I am using it for for the whole select.

It is working fine out side logic iterate in normal html select when I tried as follws.
But in logic iterate I could not provide reference of name for select
like sampleSelect in indexed way like sampleSelectArray[index].sampleSelect 
dynamically.
Thank you for understanding.
-Udaya Allu



Select Card
Visa -5678 10/2005
Amex -6854 12/2005
Amex -4211 10/2005
Visa -5678 10/2004
 


 

-Original Message-
From: Firat TIRYAKI [mailto:[EMAIL PROTECTED]
Sent: Thursday, December 11, 2003 10:25 AM
To: Struts Users Mailing List
Subject: Re: problem in javascript for select enabled/disabled by
checkbox in a list with in logic iterate 


Well, sorry but you can't use the disabled property for one of a select
element's options, you can use it for the whole select.

F.

- Original Message - 
From: "Udaya Allu" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, December 11, 2003 5:17 PM
Subject: problem in javascript for select enabled/disabled by checkbox in a
list with in logic iterate


Hi All,
Please help me on
select enabled/disabled by checkbox in a list with in logic iterate
I am not able to pass the index for disableing select box basing on check
box enale/disable
please look at  the code part
onclick="this.form.subscriptions['<%=index
%>'].selectedWalletItemId.disabled=this.checked?false:true;"
in the following code.
I tried it different ways ...but no success.
Other wise also if  I want to use simple onclick=" sumbit()", to do
something action class and refresh,
I do not know how to pass the index or other parameters through
Any amount of help is really appreciated as this is code in production.
Thank you
-Udaya Allu



Select Credit Card


">

   - 
/






 


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



problem in javascript for select enabled/disabled by checkbox in a list with in logic iterate

2003-12-11 Thread Udaya Allu
Hi All,
Please help me on 
select enabled/disabled by checkbox in a list with in logic iterate
I am not able to pass the index for disableing select box basing on check box 
enale/disable
please look at  the code part  onclick="this.form.subscriptions['<%=index 
%>'].selectedWalletItemId.disabled=this.checked?false:true;"
in the following code.
I tried it different ways ...but no success.
Other wise also if  I want to use simple onclick=" sumbit()", to do something action 
class and refresh,
I do not know how to pass the index or other parameters through 
Any amount of help is really appreciated as this is code in production.
Thank you
-Udaya Allu



Select Credit 
Card


">

   - 
/






 


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



RE: Problem in validation requiredif in struts 1.1 that worked fine in Struts 1.1 RC1

2003-08-17 Thread Udaya Allu
Thank you very much, Greg Ludington
That must be the reason of failure.
But can you advise me whether the validator dtd will be automatically
upgraded/comes with Struts1.1 final or I have to change/configure it or not necessary 
to bother about it i.e there is no relation to it.
Please clarify.
Thank you very much
-Udaya Allu

-Original Message-
From: Greg Ludington [mailto:[EMAIL PROTECTED]
Sent: Sunday, August 17, 2003 11:25 AM
To: Udaya Allu; [EMAIL PROTECTED]
Subject: RE: Problem in validation requiredif in struts 1.1 that worked
fine in Struts 1.1 RC1


The format of the variable names changed before Struts 1.1 final.

In your validator, try replacing your var-names field-test[0] and
field-value[0] with fieldTest[0] and fieldTest[0], respectively.

You can see this format in the example at
http://jakarta.apache.org/struts/userGuide/dev_validator.html

-Greg Ludington




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



requiredif - Is this correct or wrong ? -Help me

2003-08-17 Thread Udaya Allu

Hello Dear All,
Please help me to find fault in hte following code 
for requiredif validation and identical(password) comparision
that worked fine in Struts 1.1 RC1 but giving
java.lang.NullPointerException with Struts 1.1 final release
at org.apache.struts.validator.FieldChecks.validateRequiredIf(FieldChecks.java:200)
Please help me.
Thanks -Udaya






  
field[0]
currentPage
  
  
field-test[0]
EQUAL

  
field-value[0]
2
  

secondProperty
confirmpassword
  



 


   
public static boolean validateIdentical(Object bean, ValidatorAction va,
Field field, ActionErrors errors, HttpServletRequest request) {
String value = ValidatorUtil.getValueAsString(bean, field.getProperty());
String sProperty2 = field.getVarValue("secondProperty");
String value2 = ValidatorUtil.getValueAsString(bean, sProperty2);

if (!GenericValidator.isBlankOrNull(value)) {
try {
if (!value.equals(value2)) {
errors.add(field.getKey(),
Resources.getActionError(request, va, field));

return false;
}
} catch (Exception e) {
errors.add(field.getKey(),
Resources.getActionError(request, va, field));

return false;
}
}

return true;
}

Caused by: java.lang.NullPointerException
at 
org.apache.struts.validator.FieldChecks.validateRequiredIf(FieldChecks.java:200)
... 43 more
12:01:23,995 ERROR [Validator] reflection: null
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at 
org.apache.commons.validator.Validator.validateFieldForRule(Validator.java:435)
at org.apache.commons.validator.Validator.validateField(Validator.java:512)

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



Problem in validation requiredif in struts 1.1 that worked fine in Struts 1.1 RC1

2003-08-17 Thread Udaya Allu

Hello Dera All,
I am resending this request as I could not ascertain whether it is delivered to user 
group or not
-Udaya

Dear All,
Validation requiredif  worked fine in my project
when using Struts 1.1 RC1
I upgraded or using now struts 1.1.
suddenly the requiredif validation is not working.
So much of my validation stopped working.
The error is as follows.
Please help me.
Thank you very much in advance.


Caused by: java.lang.NullPointerException
at 
org.apache.struts.validator.FieldChecks.validateRequiredIf(FieldChecks.java:200)
... 43 more
12:01:23,995 ERROR [Validator] reflection: null
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at 
org.apache.commons.validator.Validator.validateFieldForRule(Validator.java:435)
at org.apache.commons.validator.Validator.validateField(Validator.java:512)

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



Request to Please help me implement array of radionbuttons

2003-08-14 Thread Udaya Allu
Dear All,
I need help  how to implement Radio buttons in struts. in two situations and  other 
two related to tranfer of data between objects.
1)an array of radio buttons i.e in iterate tag
and selected radio button sould catch an object or a foem as its  the value.
Do radio button value can be an object  or it can only be string?

2)Table of radion buttons in a jsp.
each row is an array of radio buttons and one in each row will be selected.
and array of such selections to be updated in to form

3)In both of the above cases how to pass the arraylists related to selected radio 
buttons  to next page
i.e can I put the array of objects in request atrribute  and get them in next page by 
giving redirect as false.
Or only solution is putting in session.
Or can I pass objects or arrays as hidden attributes(sorry this may be absurd or 
blunder)
4)If I can pass only string values(ID of object )through radio button values to next 
page or action class,
is it preferable to make a dabase call for getting details of object based on Id or 
better put array in session
and retrieve the details by Id.
Please help me.
Thanks a lot In advance
-Udaya Allu




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