Robert Taylor wrote:

Also, make sure that the action in which you attempt to get the "rrole" value
from is declared to use the correct form.


If you can, please post your action mapping as well.

robert


Now it is time to apologize. I have a classes and a src cirectory for compiling with ant,
in both is a struts-config.xml, guess what. I altered the config file in the src directory,
I will immediately kill the evil struts-config in the wrong directory.
Please do not tell anybody of my stupid fault.


And most of all: Thank you ver much, now everthing works fine.

regards
   Wolfgang



-----Original Message-----
From: Robert Taylor [mailto:[EMAIL PROTECTED]
Sent: Friday, April 02, 2004 3:18 PM
To: Struts Users Mailing List
Subject: RE: DynaValidatorFom with checkbox properties


The exception indicates that you have not defined a property named "rrole" in your form.


What does your form-bean declaration look like in your struts-config file?

robert



-----Original Message-----
From: Johannes Wolfgang Woger [mailto:[EMAIL PROTECTED]
Sent: Friday, April 02, 2004 2:42 PM
To: Struts Users Mailing List
Subject: Re: DynaValidatorFom with checkbox properties




Robert Taylor wrote:




employee. How shall I configure
the DynaValidatorForm in my strus_config to take a unknown number of checkbox values?




<form-property name="rrole"
                type="java.lang.String[]" initial="{}"/>






second question: how can I make the properties of a DynaVForm available to a Action?




DynaActionForm form = (DynaActionForm)form;
String[] rrole = (String[])form.get("rrole);



Doing so, gives me the exception:


javax.servlet.ServletException: Invalid property name 'rrole'
        
org.apache.struts.action.RequestProcessor.processException(RequestProcessor.java:545)
        
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:486)
        org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
        org.apache.struts.action.ActionServlet.process(ActionServlet.java:1480)
        org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:524)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:856)

root cause

java.lang.IllegalArgumentException: Invalid property name 'rrole'
        
org.apache.struts.action.DynaActionForm.getDynaProperty(DynaActionForm.java:598)
        org.apache.struts.action.DynaActionForm.get(DynaActionForm.java:241)
        org.zack.action.EmployeeDispatchAction.update(Unknown Source)
        sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        java.lang.reflect.Method.invoke(Method.java:324)
        
org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:280)
        org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:216)
        
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
        org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
        org.apache.struts.action.ActionServlet.process(ActionServlet.java:1480)
        org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:524)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:856)



You might try using <html:multibox .../>

<c:forEach var="tk" items="${task}">
<html:multibox property="rrole"><c:out value="${tk.taskId}"/></html:multibox>
</c:forEach>



everything else you supose seems to work well, but I cannot look what the DVForm realy loaded,
how I will put these values into the database is an other story.


Thank you very much. Wolfgang



robert





-----Original Message-----
From: Johannes Wolfgang Woger [mailto:[EMAIL PROTECTED]
Sent: Friday, April 02, 2004 12:48 PM
To: [EMAIL PROTECTED]
Subject: DynaValidatorFom with checkbox properties


Hi,
I have a checkbox, where do not know in adwance how many properties to be checked I will have
this is why I use forEach.
I am using a DynaValidatorForm which takes some attibutes for an employee. How shall I configure
the DynaValidatorForm in my strus_config to take a unknown number of checkbox values?


<c:forEach var="tk" items="${tasks}">
<c:out value="${tk.taskBez}"/>
<input type="checkbox" name='rrole' value='<c:out value="${tk.taskId}"/>'/> </c:forEach>


this is how my .jsp looks like.

second question: how can I make the properties of a DynaVForm available to a Action?

Thanks
  Wolfgang


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




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




Reply via email to