Abstract: I want to display events in the calendar that have 3 primary keys of type String. However, the samples for the calendar always show to set "eventId" as the one and only primary key. Is there a workaround?
Details of my solution:
- I have a client only data source for the calendar (I load events from my gears database).
- I override all the dialogs for the calendar with my own versions of event editors (as shown in a couple of threads in this forum)
- I've set DataSourceSequenceField for eventId NOT to be a primary key. Therefore I have no primary key at all.
My assumptions:
- I thought that since I'm using my own versions of event editing/adding window, my code can get around the 'one integer primary key' problem because I get the whole CalendarEvent on the input of calendar event editing method
- I thought that setting eventId = 1 for all calendar events would work
The difficulties:
- The calendar displays all events in the upper left corner of the calendar window completely ignoring the date setting for events
The analysis:
- I've read the Javadoc for DataSourceField.setPrimaryKey() where it is written to map the keys in DataSource.transformResponse(). The problem is that it's impossible to do stateless one-to-one mapping (String,String,String)<=>integer in general (by stateless I mean not holding a stateful mapping table for the lifetime of my application)
The questions:
- Is it true that the only way to get around this problem is to implement statefull mapping table mentioned above?
- Can I just sequentially number the events on every call to DataSource.getClientOnlyResponse()? The javadoc for DataSourceField.setPrimaryKey() says that eventId should be unique for the lifetime of the page. I don't know how to exatly interpret this. I don't know if the GUI does not cache the ids somewhere between getClientOnlyResponse() call.
- Maybe it is simpler for Isomorphic to make a simple change in the calendar so that it does not glue all the events in the left upper corner?
Details of my solution:
- I have a client only data source for the calendar (I load events from my gears database).
- I override all the dialogs for the calendar with my own versions of event editors (as shown in a couple of threads in this forum)
- I've set DataSourceSequenceField for eventId NOT to be a primary key. Therefore I have no primary key at all.
My assumptions:
- I thought that since I'm using my own versions of event editing/adding window, my code can get around the 'one integer primary key' problem because I get the whole CalendarEvent on the input of calendar event editing method
- I thought that setting eventId = 1 for all calendar events would work
The difficulties:
- The calendar displays all events in the upper left corner of the calendar window completely ignoring the date setting for events
The analysis:
- I've read the Javadoc for DataSourceField.setPrimaryKey() where it is written to map the keys in DataSource.transformResponse(). The problem is that it's impossible to do stateless one-to-one mapping (String,String,String)<=>integer in general (by stateless I mean not holding a stateful mapping table for the lifetime of my application)
The questions:
- Is it true that the only way to get around this problem is to implement statefull mapping table mentioned above?
- Can I just sequentially number the events on every call to DataSource.getClientOnlyResponse()? The javadoc for DataSourceField.setPrimaryKey() says that eventId should be unique for the lifetime of the page. I don't know how to exatly interpret this. I don't know if the GUI does not cache the ids somewhere between getClientOnlyResponse() call.
- Maybe it is simpler for Isomorphic to make a simple change in the calendar so that it does not glue all the events in the left upper corner?
Comment