AW: Newbie Question: dynamically setting value in a struts link tag / also dynamically placing value from a JavaBean Collection into a Struts Form attribute.

2001-12-12 Thread Hudayioglu, Fehmi

hi, if you are using struts 1.0, there is no way to create links (or
checkboxes... )dynamically, unless you use nightly builds or wait for the
struts 1.1 (as far as I know).
I had the same problem with struts 1.0 and my solution was like this. though
I have still some doubts on this solution.

in JSP.
logic:iterate id=Roll name=UserAdminFormBean property=listrowheader
indexId=index offset=0 
INPUT type='text' name='Header[bean:write name=index/].name'
value='bean:write name=Roll property=name /' /
/logic:iterate

in Action Bean I have used
while(true) //Build header list
{
String headername = request.getParameter(Header[ + i + ].name);
if(headername==null) //if there is no more row, exit the while loop.
break;
Roll newHeader=new Roll(headername);
tempHeaders.add(newHeader);
i++;
}

So, this mechanism simply skips struts. Sure there may be better
solutions.(though i don't want to rewrite my existing code:)
hope it answers some of your questions. bye.


-Ursprüngliche Nachricht-
Von: Campbell, Sheri [mailto:[EMAIL PROTECTED]]
Gesendet am: Tuesday, December 11, 2001 5:03 PM
An: '[EMAIL PROTECTED]'
Betreff: Newbie Question: dynamically setting value in a struts link tag
/ also dynamically placing value from a JavaBean Collection into a
Struts Form attribute.


I've got a Struts Action class that calls a method on a JavaBean which
performs a SQL and puts resultSet into a Collection.  

In my .jsp page I am going through the Collection on my JavaBean and using
strutsbean:write name=pvb property=empid/ to display the values into a
html table.

I am trying to also add a strutshtml:link  which contains a value=
(employeeid=empid) where I want its value to be built dynamically from the
Collections value:

strutshtml:link href=assessment.do?employeeid=empid 

How do I do this?Better yet, I have the employeeid in my javaBean's
Collection.  How do I get that value from the Collection into the .jsp's
associated StrutsActionForm's employeeid value? 


This is what I've got right now in my .jsp, the value is empid on my
action class not the actual value:

strutshtml:form action=assessment.do name=employeeForm
type=com.proverb.EmployeeForm
strutslogic:iterate name=EmployeeCollection id=pvb 
tr
td
  font face=Verdana, Arial, Helvetica, sans-serif size=2
strutshtml:link href=assessment.do?employeeid=empid 
strutsbean:write name=pvb property=empid/
/strutshtml:link
  /font
   nbsp;
/td
td
  font face=Verdana, Arial, Helvetica, sans-serif size=2
strutsbean:write name=pvb property=lname/
   /font
   nbsp;
/td
td
  font face=Verdana, Arial, Helvetica, sans-serif size=2
strutsbean:write name=pvb property=fname /
  /font
   nbsp;
/td
 
/strutslogic:iterate
/strutshtml:form
 

Thanks!







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




Newbie Question: dynamically setting value in a struts link tag / also dynamically placing value from a JavaBean Collection into a Struts Form attribute.

2001-12-11 Thread Campbell, Sheri


I've got a Struts Action class that calls a method on a JavaBean which
performs a SQL and puts resultSet into a Collection.  

In my .jsp page I am going through the Collection on my JavaBean and using
strutsbean:write name=pvb property=empid/ to display the values into a
html table.

I am trying to also add a strutshtml:link  which contains a value=
(employeeid=empid) where I want its value to be built dynamically from the
Collections value:

strutshtml:link href=assessment.do?employeeid=empid 

How do I do this?Better yet, I have the employeeid in my javaBean's
Collection.  How do I get that value from the Collection into the .jsp's
associated StrutsActionForm's employeeid value? 


This is what I've got right now in my .jsp, the value is empid on my
action class not the actual value:

strutshtml:form action=assessment.do name=employeeForm
type=com.proverb.EmployeeForm
strutslogic:iterate name=EmployeeCollection id=pvb 
tr
td
  font face=Verdana, Arial, Helvetica, sans-serif size=2
strutshtml:link href=assessment.do?employeeid=empid 
strutsbean:write name=pvb property=empid/
/strutshtml:link
  /font
   nbsp;
/td
td
  font face=Verdana, Arial, Helvetica, sans-serif size=2
strutsbean:write name=pvb property=lname/
   /font
   nbsp;
/td
td
  font face=Verdana, Arial, Helvetica, sans-serif size=2
strutsbean:write name=pvb property=fname /
  /font
   nbsp;
/td
 
/strutslogic:iterate
/strutshtml:form
 

Thanks!







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