You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Sy...@swisscom.com on 2003/11/20 10:33:31 UTC
[JXForm/XMLForm] Could you help me?
Hello,
I'm still using XMLForm (because I don't want to migrate all my applications at the moment) and I have a problem and maybe someone who know XMLForm could help me.
In my application I override the getFormModel() method to get a model from a database.
I'm looking to extend the idea a little bit: I would like to check whether the model coming from database is null or not and if it's null I would like to display (redirect to) a certain view.
My code is something like:
**code**
protected Object getFormModel() {
if (objectId > 0) {
//some code
} else {
return super.getFormModel();
}
}
**code**
Where objectId is the ID of the object coming from database.
Now I would like to do:
**code**
protected Object getFormModel() {
if (objectId > 0) {
object = getObjectFromDatabase()
if (object != null) {
//some code
} else {
return(VIEW_ERROR)
}
} else {
return super.getFormModel();
}
}**code**
Have you an idea?
Could you help me?
Thanks
Regards
Sylvain
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org