html:text area

2005-04-19 Thread Srilatha Salla
Hi,
Can we restrict the length of textarea with any of the attributes?
I have textarea that should not accept more than 250 characters, so I want to 
know if I can restrict the length with textarea attibutes.
 
Thanks.

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

disable a text field.

2005-04-13 Thread Srilatha Salla
Hi,
 
I have a dropdownlist. When I select fixedwidth option I have to make the 
textfield mapSet.delimiter noneditable/readonly, if I select delimiter option 
I should be able to enter data. I wrote an onchange event but I cannot make the 
textfield readonly. How do I change the attribute readonly to true/false on 
selection of an option dynamically.
 
TD align=rightSTRONGbean:message key=label.fileformat 
bundle=mappingResources/:/STRONG/TD
TDSTRONG html:select property=fileFormat 
onchange=makeNonEditable(this.value)
html:option value=--Select One--/html:option
 html:options name=fileFormatType 
labelName=fileFormatType /
/html:select/STRONG/TD
 
 
html:text property=mapSet.delimiter name=mapSetForm/
 
 
function makeNobEditable(value) {
if(value==Fixed Width) {
document.forms[0].elements['mapSet.delimiter'].readonly=true;
}
}
 
Thanks


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

Validating a required field

2005-04-07 Thread Srilatha Salla
Hi,
 
I have a object called Record as a form property.
Record has name, status etc as its properties.
In the jsp
I have
 bean:write property=record.name  name=exampleForm /
 I want to validate the name as a required field in validation.xml file.
 Is this the way to do it?
formset
form name=exampleForm 
  field property=record.name depends=required
arg0 key=record.name resource=false/
  /field
  /formset
Can the field property have a value similar to this? I mean not a direct form 
property, but
a nested property?
 
Thanks.


-
Do you Yahoo!?
 Better first dates. More second dates. Yahoo! Personals 

dependent drops/onchange function

2005-03-15 Thread Srilatha Salla
Hi,
There are these struts tags in my jsp. I need to write a javascript function so 
that when a button addrow is clicked a new row with
these 2 dropdown lists(tables, columns) is displayed. how to add a row with 
javascript function.
the second dropdown options depend on the table selected in the first dropdown. 
how do I write a onchange function to get the columns of the table selected.
I have the javascript function to get tables and columns. 

 nested:iterate id=conversion name=updateForm property=rowSet.rows 
type=com.net.menuentry
  TR class=tblcellwhite
  TD height=21
nested:select name=rows 
property=repColumn.repTable.repTableId
  logic:iterate id=repTable 
name=updateForm property=tableList type=com.net.RepTable
html:option 
value=%=repTable.getRepTableId().toString()%%=repTable.getDisplayName()%/html:option
  /logic:iterate
/nested:select
  /TD
  TD
nested:select name=rows 
property=repColumn.repColumnId
  logic:iterate id=repTable 
name=updateForm property=tableList type=com.cnet.RepTable
nested:equal name=conversion 
property=repositoryColumn.repositoryTable.repTableId 
value=%=repTable.getRepTableId().toString()%
  nested:iterate id=repColumn 
name=repTable property=repColumns type=com.cnet.RepColumn
html:option 
value=%=repColumn.getRepColumnId().toString()%%=repColumn.getDisplayName()%/html:option
  /nested:iterate
/nested:equal
  /logic:iterate
/nested:select
  /TD

function getTables() {
  var tables = [ 
 %
  List list = updateForm.getTableList();
if (list != null) {
  int tableCount = list.size();
  for(int i=0; itableCount; i++) {
RepTable table = (RepTable) list.get(i);
out.write(\ + table.getDisplayName() + \);
if (itableCount-1) {
  out.write( ,);
}
  }
}
%
  ];
  return tables;
}
function getColumnList(tableIndex) {
  var columnList = [
 %
if (list != null) {
  int tableCount = list.size();
  for(int i=0; itableCount; i++) {
RepTable table = (RepTable) list.get(i);
Set columns = table.getRepColumns();
if (columns != null) {
  out.write([ );
  int columnCount = columns.size();
  int col = 0;
  for (Iterator iter=columns.iterator(); iter.hasNext();) {
RepColumn column = (RepColumn) iter.next();
out.write(\ + column.getDisplayName() + \);
if (colcolumnCount-1) {
  out.write( ,);
}
col++;
  }
  out.write( ]);
  if (itableCount-1) {
out.write(,\r\n);
  }
   }
  }
}
%
  ];
  return columnList[tableIndex];
}
 
 
thanks.

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

dependent dropdowns

2005-03-15 Thread Srilatha Salla
Hi,
There are these struts tags in my jsp. I need to write a javascript function so 
that when 
a button addrow is clicked a new row withthese 2 dropdown lists(tables, columns)
is displayed. how to add a row with javascript function.
the second dropdown options depend on the table selected in the first dropdown. 
how do I write a onchange function to get the columns of the table selected.
I have the javascript function to get tables and columns. 

 nested:iterate id=conversion name=updateForm property=rowSet.rows 
type=com.net.menuentry
TR class=tblcellwhite
  TD height=21
nested:select name=rows property=repColumn.repTable.repTableId
logic:iterate id=repTable name=updateForm property=tableList 
type=com.net.RepTable
   html:option 
value=%=repTable.getRepTableId().toString()%%=repTable.getDisplayName()%/html:option
 /logic:iterate
/nested:select
  /TD
  TD
  nested:select name=rows property=repColumn.repColumnId
   logic:iterate id=repTable name=updateForm property=tableList 
type=com.cnet.RepTable
   nested:equal name=conversion 
property=repositoryColumn.repositoryTable.repTableId 
value=%=repTable.getRepTableId().toString()%
nested:iterate id=repColumn name=repTable property=repColumns 
type=com.cnet.RepColumn
 html:option 
value=%=repColumn.getRepColumnId().toString()%%=repColumn.getDisplayName()%/html:option
  /nested:iterate
  /nested:equal
  /logic:iterate
   /nested:select
  /TD  

 
 
function getTables() {
  var tables = [ 
 %
  List list = updateForm.getTableList();
if (list != null) {
  int tableCount = list.size();
  for(int i=0; itableCount; i++) {
RepTable table = (RepTable) list.get(i);
out.write(\ + table.getDisplayName() + \);
if (itableCount-1) {
  out.write( ,);
}
  }
}
%
  ];
  return tables;
}
function getColumnList(tableIndex) {
  var columnList = [
 %
if (list != null) {
  int tableCount = list.size();
  for(int i=0; itableCount; i++) {
RepTable table = (RepTable) list.get(i);
Set columns = table.getRepColumns();
if (columns != null) {
  out.write([ );
  int columnCount = columns.size();
  int col = 0;
  for (Iterator iter=columns.iterator(); iter.hasNext();) {
RepColumn column = (RepColumn) iter.next();
out.write(\ + column.getDisplayName() + \);
if (colcolumnCount-1) {
  out.write( ,);
}
col++;
  }
  out.write( ]);
  if (itableCount-1) {
out.write(,\r\n);
  }
   }
  }
}
%
  ];
  return columnList[tableIndex];
}
 


-
Do you Yahoo!?
 Yahoo! Small Business - Try our new resources site! 

showing alert message

2005-03-10 Thread Srilatha Salla
Hi,
 
I have a list which I am iterating and displaying data in each row.
I have check box for each row.
For the value of check box I am sending the objectID for each row.
I have 2 buttons delete, update.
When these buttons are clicked, I need to send ids.
I neew ids only and not status in the action class. With the existing code I 
can get Id's from the request.(request, selectedSets).
When the delete button is clicked I need to check the status(if inprocess ) 
of the object in each row and
show alert if any of the checked rows had staus as inproces. how do i do this?
 TD width='20'
  input type=checkbox id=allrows name=allrows  
 
onclick=makeAllSelection(this.checked,document.UpdateForm,document.UpdateForm.selectedSets)
 --  
/TD  
   
  logic:iterate id=recordSet name=list indexId=ctr
 type=com.abc.ObjectA

TD
input type=checkbox 
 name=selectedSets 
 value=%=recordSet.getRecordSetId()%
  /TD
I have code here which gets name, id and status of the object on each row.

/logic:iterate
 input type=button 
   value=update 
   onclick=performAction('update')
   class=button
input type=button 
   value=delete 
   onclick=performAction('delete')
   class=button
===
function makeAllSelection(form, isChecked) {
  var checkboxes = form.allrows;
  for (i = 0; i  checkboxes.length; i++) {
checkboxes[i].checked = isChecked;
  }
}
function performActiob(action1) {
  alert(operation);
document.UpdateForm.operation.value=action1;
document.UpdateForm.submit();
  }
 
 
Thanks

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

populate another dropdownlist depending on selection i one dropdownlist

2005-03-07 Thread Srilatha Salla
Hi 

I have a dropdownlist of tables, I have to display a dropdownlist of columns of 
that table depending on the table selected.
And I have to add a row when clicked on add row button.
This row consists of dropdownlist of tables, dropdownlist of columns(this 
dropdownlist has to chnage depending on the table selected), other textfiields
This application I am doing is based on struts, so what should I be doing in 
the action class and jsp?
I think I have to use logic tags to add the rows. But can I change the 
columnlist  in each row depending on table selected?
 
I cant assume the number of tables or columns for the first time? But once I 
get the data first time I can store them in some static variables. How do I do 
this?
 
Thanks.


-
Celebrate Yahoo!'s 10th Birthday! 
 Yahoo! Netrospective: 100 Moments of the Web 

Re: how to pass values selected in a html select tag to a javascript function when a page loads

2004-11-11 Thread Srilatha Salla
Hi,

I call a javascript function when a option is selected in a drop down list. 
onchange=showTextField(actionselected,index). and display a textfield for some 
options.
logic:iterate name=autoForm property=menuEntriesid=menuEntries 
indexId=idx
html:select name=menuEntries property=menuAction
onchange='%=showOrHidePhoneNumber(this.value, +idx+);%'

I have to call same function when the page loads and display a text field for 
some options which were selected earlier for the same user.

so,how do i call pass the arguments onloading since I have the html select in a 
loop , I mean I have 11 dropdownlists and have to pass the option selected and 
index for each drop down list.

Thanks.
 







Erik Weber [EMAIL PROTECTED] wrote: I'm not sure if I understand completely, 
but could how about a 
JavaScript body onload call?

Erik


Srilatha Salla wrote:

Hi,
 
In my application I have menu.jsp which has a ligic tag,
 

 
 
 
 
 
 
 '
 Select A Action
 
 
 
 
  style=DISPLAY: none
 
 
 

 
 
 
 
 so I have the javascript function -

 function showOrHidePhoneNumber(actionselected,index) {
 alert(index);
 alert(actionselected);
 if(actionselected==Transfer with prompt) {
 document.getElementById(index).style.display = inline;
 } else if(actionselected==Transfer without prompt){
 document.getElementById(index).style.display = inline;
 }else if(actionselected==Transfer to operator){
 document.getElementById(index).style.display = inline;
 }else {
 document.getElementById(index).style.display = none;
 }
 }
 which displays the textfield for phoneNumber only when the option selected is 
 Transfer with prompt/Transfer without prompt/Reach operator, otherwise the 
 textfield for phone number is not displayed.
 
 This is working fine when i add a menuentry.
 But when I have to come to this page to edit 
 I have to call the  showOrHidePhoneNumber(actionselected,index) 
 function 
 when the page loads and display phonenumber only if the options are as I 
 mentioned above. Please help me figure how out how to do this.
 
Thanks,
Latha.
 

 
-
Do you Yahoo!?
 Check out the new Yahoo! Front Page. www.yahoo.com
 


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





-
Do you Yahoo!?
 Check out the new Yahoo! Front Page. www.yahoo.com

RE: form submision using javascript using html:link tag

2004-11-09 Thread Srilatha Salla
Hi Girish,
 
Can you please let me know how to set the value for form fields in the 
javascript method.
For example if I have name as a form property, how to set its value in the 
javascript method.
 
Thanks,
Latha.

Girish Kumar K. P. [EMAIL PROTECTED] wrote:

I guess U may call a javascript like onclick=javascript:fnSubmit() and
in that function u can set the values for the form fields and then on
last line of the function, call 'document.menuForm.submit()'


-Original Message-
From: Srilatha Salla [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, November 09, 2004 2:32 AM
To: [EMAIL PROTECTED]
Subject: form submision using javascript using html:link tag

Hi,

In my application there is a jsp page 

for example menu.jsp which has

there is a link Menu Hours
in the menu.jsp which goes to the hours.jsp

I want to submit the form when i click the link, so that I can access
the values entered in the menu.jsp. in HoursMenuAction.

I tried onclick=document.menuForm.submit()
but i couldnot access the form properties. I get null values. So, how
can i submit the form and access its properties.

Thanks,
Latha



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


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

form submision using javascript using html:link tag

2004-11-08 Thread Srilatha Salla
Hi,
 
In my application there is a jsp page 
 
for example menu.jsp which has 
html:form action=/nfoSave
there is a link  html:link page=/HoursMenu.do Menu Hours/html:link in the 
menu.jsp which goes to the hours.jsp
 
I want to submit the form when i click the link, so that I can access the 
values entered in the menu.jsp. in HoursMenuAction.
 
I tried  html:link page=/HoursMenu.do onclick=document.menuForm.submit()
but i couldnot access the form properties. I get null values. So, how can i 
submit the form and access its properties.
 
Thanks,
Latha
 
 

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

Hi

2004-11-05 Thread Srilatha Salla
Hi,
 
I have a logic:iterate tag in my jsp.
 
 
 logic:iterate name=autoForm property=menuEntries id=menuEntries
 tr
 td valign=middle
 bean:write name=menuEntries property=key/
 html:hidden name=menuEntries property=key/
/td
 td valign=middle
 html:text name=menuEntries property=description size=15 
maxlength=15/
 /td
 td valign=top
   html:select name=menuEntries property=menuAction
html:option value=Select A Action/html:option
 html:options name=actionNames labelName=actionNames/
  /html:select
 /td
 
I have 11 rows to iterate.
for each html:select i have to invoke onchange method such that depending on the 
selection(for example if have options a,b,c,d in dropdownlist, i have to display a 
textfield called phonenumber only for options a,c.). My problem is i have to send some 
parameter in the onchange method, but since it is iteration every iteration has same 
propertyname,
I have menuAction as property name for htmlselect. 
 
I should be able to get the phonenumber  only for the options i sent when i load the 
page.(Iike edit page)
 
I would appreciate if anyone can help me.
 
Thanks,
Latha

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

Re: Hi

2004-11-05 Thread Srilatha Salla
Thanks for the help.
 
I tried to understand what was on the site, it might take some time.
 
If possible can you let me know how to implement it in my case.
 
I have MenuEntry[] menuentries. in my form. MenuEntries has properties key, 
description and menuaction.
 
So, what should i change this to.
 
Thanks.

Niall Pemberton [EMAIL PROTECTED] wrote:
No you don't need 11 different methods, if you read through this it
(hopefully) should be clearer

http://struts.apache.org/faqs/indexedprops.html

Niall

- Original Message - 
From: Srilatha Salla 
To: Struts Users Mailing List 
Sent: Friday, November 05, 2004 5:49 PM
Subject: Re: Hi


 Hi,

 i tried using indexed=true for

 id=menuEntries
 
 
 
 indexed=true/
 
 
 size=15 maxlength=15 indexed=true/
 
 
 indexed=true
 Select A Action
 labelName=actionNames/
 
 
 
 maxlength=15/
 

 I have a menuentry[] menuEntries property in formbean.
 so i need to index for description and key also.
 There is indexed attribute for html:text but not for bean:write
 So i used html:hidden indexed=true

 I have get and set methods in menuEntry class for key, description and
menuaction.
 MenuEntry[] menuEntries = form.getMenuEntries(); in action class.

 tried retrieving the menuEntries[] in the action class.
 I get java.lang.NullPointerException
 at
org.apache.commons.beanutils.PropertyUtils.getIndexedProperty(PropertyUtils.
java:515)



 so if I use indexed, should there be 11 different get and set methods
because name of the property changes name=menuEntries[5].menuAction.

 Is there anyother way without using indexed, but send index of the
property to the onchange method.

 Thanks,
 Latha.




 Niall Pemberton wrote:
 Using indexed=true will generate names such as menuAction[0],
 menuAction[1] etc...

 indexed=true

 Niall

 - Original Message - 
 From: Srilatha Salla
 To:
 Sent: Friday, November 05, 2004 4:41 PM
 Subject: Hi


  Hi,
 
  I have a logic:iterate tag in my jsp.
 
 
 
 
 
 
 
 
 
  size=15 maxlength=15/
 
 
 
  Select A Action
  labelName=actionNames/
 
 
 
  I have 11 rows to iterate.
  for each html:select i have to invoke onchange method such that
depending
 on the selection(for example if have options a,b,c,d in dropdownlist, i
have
 to display a textfield called phonenumber only for options a,c.). My
problem
 is i have to send some parameter in the onchange method, but since it is
 iteration every iteration has same propertyname,
  I have menuAction as property name for htmlselect.
 
  I should be able to get the phonenumber only for the options i sent when
 i load the page.(Iike edit page)
 
  I would appreciate if anyone can help me.
 
  Thanks,
  Latha
 
  __
  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]



 -
 Do you Yahoo!?
 Check out the new Yahoo! Front Page. www.yahoo.com/a



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


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

Re: Hi

2004-11-05 Thread Srilatha Salla
Hi,
 
I am able to display the text field for phoneNumber now. The code i wrote is 
 
logic:iterate name=autoForm property=menuEntries id=menuEntries indexId=idx
 tr
 td valign=middle
 bean:write name=menuEntries property=key/
 html:hidden name=menuEntries property=key/
/td
 td valign=middle
 html:text name=menuEntries property=description size=15 
maxlength=15/
 /td
 td valign=top
   html:select name=menuEntries property=menuAction 
onchange='%=showOrHidePhoneNumber(this.value, +idx+);%'
html:option value=Select A Action/html:option
 html:options name=actionNames labelName=actionNames/
  /html:select
 /td
 td
 div id=%=idx% style={display:inline}
  html:text property=phoneNumber size=15 maxlength=15/
  /div
 /td
!-- /tr --
 /logic:iterate
 
 
function showOrHidePhoneNumber(actionselected,index) {
  alert(index);
  alert(actionselected);
  if(actionselected==Transfer with prompt) {
document.getElementById(index).style.display = inline;
   } else {
document.getElementById(index).style.display = none;
 }
  }
 
 
I have to call showOrHidePhoneNumber(actionselected,index) when the page loads.
And it should not display the textfield for phoneNumber  for all 11rows as the default 
option is not Transfer with prompt. Help me figure out this function.
 
Thanks,
Latha
 
 


Srilatha Salla [EMAIL PROTECTED] wrote:
Thanks for the help.

I tried to understand what was on the site, it might take some time.

If possible can you let me know how to implement it in my case.

I have MenuEntry[] menuentries. in my form. MenuEntries has properties key, 
description and menuaction.

So, what should i change this to.

Thanks.

Niall Pemberton wrote:
No you don't need 11 different methods, if you read through this it
(hopefully) should be clearer

http://struts.apache.org/faqs/indexedprops.html

Niall

- Original Message - 
From: Srilatha Salla 
To: Struts Users Mailing List 
Sent: Friday, November 05, 2004 5:49 PM
Subject: Re: Hi


 Hi,

 i tried using indexed=true for

 id=menuEntries
 
 
 
 indexed=true/
 
 
 size=15 maxlength=15 indexed=true/
 
 
 indexed=true
 Select A Action
 labelName=actionNames/
 
 
 
 maxlength=15/
 

 I have a menuentry[] menuEntries property in formbean.
 so i need to index for description and key also.
 There is indexed attribute for html:text but not for bean:write
 So i used html:hidden indexed=true

 I have get and set methods in menuEntry class for key, description and
menuaction.
 MenuEntry[] menuEntries = form.getMenuEntries(); in action class.

 tried retrieving the menuEntries[] in the action class.
 I get java.lang.NullPointerException
 at
org.apache.commons.beanutils.PropertyUtils.getIndexedProperty(PropertyUtils.
java:515)



 so if I use indexed, should there be 11 different get and set methods
because name of the property changes name=menuEntries[5].menuAction.

 Is there anyother way without using indexed, but send index of the
property to the onchange method.

 Thanks,
 Latha.




 Niall Pemberton wrote:
 Using indexed=true will generate names such as menuAction[0],
 menuAction[1] etc...

 indexed=true

 Niall

 - Original Message - 
 From: Srilatha Salla
 To:
 Sent: Friday, November 05, 2004 4:41 PM
 Subject: Hi


  Hi,
 
  I have a logic:iterate tag in my jsp.
 
 
 
 
 
 
 
 
 
  size=15 maxlength=15/
 
 
 
  Select A Action
  labelName=actionNames/
 
 
 
  I have 11 rows to iterate.
  for each html:select i have to invoke onchange method such that
depending
 on the selection(for example if have options a,b,c,d in dropdownlist, i
have
 to display a textfield called phonenumber only for options a,c.). My
problem
 is i have to send some parameter in the onchange method, but since it is
 iteration every iteration has same propertyname,
  I have menuAction as property name for htmlselect.
 
  I should be able to get the phonenumber only for the options i sent when
 i load the page.(Iike edit page)
 
  I would appreciate if anyone can help me.
 
  Thanks,
  Latha
 
  __
  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]



 -
 Do you Yahoo!?
 Check out the new Yahoo! Front Page. www.yahoo.com/a



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


__
Do You Yahoo!?
Tired