| View previous topic :: View next topic | 
	
	
		| Author | Message | 
	
		| cgarvey 
 
 
 Joined: 21 Nov 2005
 Posts: 7
 
 
 | 
			
				|  Posted: Wed Aug 09, 2006 2:36 pm    Post subject: Dynamically modifying themes |   |  
				| 
 |  
				| Great product, but a little difficult to configure. 
 I'm writing a JAVA taglib to use in conjunction with your popCal control so that junior developers don't have to become familiar with your product in order to use it. The problem I have run in to is that it doesn't seem to be possible to determine the type of calendar required on any given page dynamically.
 
 I would like to include the calendar in a basic page template and then dynamically choose whether a date only, date and time, or just time popup appears.
 
 Is this possible to do? It seems to me at first glance that I will need to include 3 calendars to do this - is there another way?
 |  | 
	
		| Back to top |  | 
	
		|  | 
	
		| calendarxp Site Admin
 
 
 Joined: 30 Jan 2005
 Posts: 409
 
 
 | 
			
				|  Posted: Wed Aug 09, 2006 5:39 pm    Post subject: |   |  
				| 
 |  
				| I think you just need 1 calendar iframe tag on page but using taglib to choose between the plugins, which is configurable via the name & id of the iframe. 
 Also note that you may override the theme options in the plugins.js. e.g. you may add the following in plugins_time.js to create a plugins_timeonly.js:
 
 
  	  | Code: |  	  | gbHideTop=true; gbHideCalMiddle=true;
 | 
 _________________
 Copyright 2003-2011 Idemfactor Solutions, Inc. All rights reserved.
 |  | 
	
		| Back to top |  | 
	
		|  | 
	
		| cgarvey 
 
 
 Joined: 21 Nov 2005
 Posts: 7
 
 
 | 
			
				|  Posted: Wed Aug 09, 2006 8:02 pm    Post subject: |   |  
				| 
 |  
				| Sorry, I just realised I didn't state the problem clearly. As you rightly point out, I could of course dynamically write out the theme to use but that supposes that I only need one of each calendar type per page.
 
 What I would like is to be able to dynamically assign a theme based on the kind of control I want so that I can have a date only, date and time and time only input fields on the page but only one iframe.
 
 I've looked at the code in more detail now and I think this may be possible, I just need to come up with a theme that has functions for setting up all 3 scenarios and then wrap another function around the fPopCalendar function to add another parameter.
 
 Whew!
 
 Is there a simpler way?
 |  | 
	
		| Back to top |  | 
	
		|  | 
	
		| calendarxp Site Admin
 
 
 Joined: 30 Jan 2005
 Posts: 409
 
 
 | 
			
				|  Posted: Wed Aug 09, 2006 10:24 pm    Post subject: |   |  
				| 
 |  
				| There is another way to do it - dynamically generate the iframe tag on demand. 
 Please check the following FAQ for details:
 http://www.calendarxp.net/forum/viewtopic.php?t=75
 _________________
 Copyright 2003-2011 Idemfactor Solutions, Inc. All rights reserved.
 |  | 
	
		| Back to top |  | 
	
		|  | 
	
		| cgarvey 
 
 
 Joined: 21 Nov 2005
 Posts: 7
 
 
 | 
			
				|  Posted: Thu Aug 10, 2006 8:34 am    Post subject: |   |  
				| 
 |  
				| Wouldn't generating the iframe on the fly generate a noticeable delay though? I assume the client system would need to interpret the javascript and reload the page everytime... though it might be possible to generate and cache these.. 
 I will run some tests and let you know how it works out. Thanks for the advice.
 |  | 
	
		| Back to top |  | 
	
		|  | 
	
		|  |