sagarlotiya wrote:
Hi Problem in Struts2.
I have problem when using OGNL to set the Object directly on Model.

For e.g.

<s:select name="courseImplementation.department"
list="listPropertySelectionModel.departmentListOfSchool" listValue="name" />

e.g. Final html which is rendered by struts2
<select name="courseImplementation.department"
id="_courseImplementation_department">
    <option value="Department#3/-970525270"
selected="selected">Dermetology</option>
    <option value="Department#4/-970525207">Orthopedic_dept</option>
    <option value="Department#5/-970525141">Art of Fashion</option>
    <option value="Department#6/-970524313">MBA</option>
</select>
here i am trying to set the Object of "Department" directly on Model
"CourseImplementation's " setDepartment(Department department) method using
ognl : courseImplementation.department.
My listKey contains the Object of type Department.
When i am trying to save it gives me following error.

Error : Invalid field value for field "courseImplementation.department".

i know that this is error is due to incompatible type.
But what could be the solution?

Struts has no way to map a value like 'Department#6/-970524313' to an
instance of some object. You will need to provide your own conversion
handler to do that. See here for more info:

http://struts.apache.org/2.x/docs/type-conversion.html

L.


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

Reply via email to