element identifier url parameter problem

View: New views
2 Messages — Rating Filter:   Alert me  

element identifier url parameter problem

by dk-17 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

hello everyone,

I have a question about crud. I created  a bean and set its identidier as like this in its metadata

addConstraint(new ConstrainedProperty("studentId")
.editable(false)
.identifier(true));

After that what I want to do is to get the bean from the url call so I create an element like that

<submission name="updateStudent">
<bean name="Student" classname=" model.Student"/>
</submission>

Ok and here is my qusetion

the url contains the ...studentId=3&... but the element says the
value for studentId in the  bean from
Student sss = (Student)getNamedSubmissionBean("Student");
is null.

Any idea ..should i have to add a new parameter like dummyId and set the new id in the element. This sems like a workaround?

Thanks
--
doğan kaya berktaş
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "rife-users" group.
To post to this group, send email to rife-users@...
To unsubscribe from this group, send email to rife-users-unsubscribe@...
For more options, visit this group at http://groups.google.com/group/rife-users?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: element identifier url parameter problem

by Geert Bevin :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Hi doğan,

since you declared the studentId property as not editable, the  
submission that is linked to it will not accept the studentId  
parameter. This will result in it not being there when the bean  
instance is populated from the URL. One way to solve this is to use an  
existing bean, which might be fully filled in or just have the  
studentId and use the fillSubmissionBean method to inject the  
parameters of the URL into the already existing bean. Another way to  
solve this is by making the studentId editable, but I would advice  
against that.

Hope this helps,

Geert

On 12 Dec 2007, at 04:09, dogan kaya berktaş wrote:

> hello everyone,
>
> I have a question about crud. I created  a bean and set its  
> identidier as like this in its metadata
>
> addConstraint(new ConstrainedProperty("studentId")
> .editable(false)
> .identifier(true));
>
> After that what I want to do is to get the bean from the url call so  
> I create an element like that
>
> <submission name="updateStudent">
> <bean name="Student" classname=" model.Student"/>
> </submission>
>
> Ok and here is my qusetion
>
> the url contains the ...studentId=3&... but the element says the
> value for studentId in the  bean from
> Student sss = (Student)getNamedSubmissionBean("Student");
> is null.
>
> Any idea ..should i have to add a new parameter like dummyId and set  
> the new id in the element. This sems like a workaround?
>
> Thanks

--
Geert Bevin
Terracotta - http://www.terracotta.org
Uwyn "Use what you need" - http://uwyn.com
RIFE Java application framework - http://rifers.org
Music and words - http://gbevin.com


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "rife-users" group.
To post to this group, send email to rife-users@...
To unsubscribe from this group, send email to rife-users-unsubscribe@...
For more options, visit this group at http://groups.google.com/group/rife-users?hl=en
-~----------~----~----~----~------~----~------~--~---

 
 
 
Google
rifers.org web