Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

java - Dynamic Jfreechart -


i have problem getting primefaces dynamic image working. think doing in example on primefaces showcase image isn't loaded on page. managed bean looks follows.

@managedbean(name = "statisticsbean") @nonescoped public class statisticsbean {      private wmcuser user;     private basicgroup group;     private list<gameprogressstatistics> linechartstats;     private list<userstatistics> userstatistics;     private static final logger logger = logger.getlogger(statisticsbean.class.getname());  public statisticsbean() {         ...         createuserstatistics(); }  private void createuserstatistics() {     list<wmcuser> users = grouphelper.getnondeletedmembers(group);     (wmcuser wmcuser : users) {         userstatistics.add(new userstatistics(                 wmcuser.getstatuser().getmakecount(),                 wmcuser.getstatuser().getgamesplayed(),                 wmcuser.getfirstname(),                 wmcuser.getlastname()));     } }        public class userstatistics {          private int makecount;         private int gamecount;         private string firstname;         private string lastname;         private streamedcontent thermochart;          public userstatistics(int makecount, int gamecount, string firstname, string lastname) {             this.makecount = makecount;             this.gamecount = gamecount;             this.firstname = firstname;             this.lastname = lastname;             try {                 thermometerplot plot = new thermometerplot(createthermometerdataset());                 file chartfile = new file("dynamichart");                 jfreechart chart = new jfreechart(plot);                 chartutilities.savechartaspng(chartfile, chart, 50, 50);                 thermochart = new defaultstreamedcontent(new fileinputstream(chartfile), "image/png");             } catch (exception e) {                 logger.severe(e.getmessage());             }             .....         }         .....     } 

the jsf page looks this

<h:form id="stats">                     <p:datatable  id="statstable" var="user" value="#{statisticsbean.userstatistics}">                         <p:column styleclass="textcolumn">                             <f:facet name="header">                                 <h:outputtext value="name" />                             </f:facet>                             <h:outputtext value="#{user.firstname} #{user.lastname}"/>                         </p:column>                         ...                         <p:column styleclass="imagecolumn">                             <f:facet name="header">                                 <h:outputtext value="luck barometer"/>                             </f:facet>                             <p:graphicimage value="#{user.thermochart}"/>                         </p:column>                     </p:datatable>    </h:form> 

can see doing wrong?

best not save image server, link in way. preferred solution have image generated on demand , streamed client servlet, link servlet (with parameters generate image of course) being injected in jsf instead of link pregenerated image file.


Comments

Popular posts from this blog

c# - Usage of Server Side Controls in MVC Frame work -

cocoa - Nesting arrays into NSDictionary object (Objective-C) -

ios - Very simple iPhone App crashes on UILabel settext -