cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <Sylvain.The...@swisscom.com>
Subject [JXForm/XMLForm] Could you help me?
Date Thu, 20 Nov 2003 09:33:31 GMT
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


Mime
View raw message