Tree Table support, it does not seem to handle the rendered attribute correctly
I have a tree table that I only want to display if direct is true. The direct flag is a property of the backing bean and is used as follows: I put a breakpoint in the isDirect method and it seems to never get called If I remove, rendered="#{emergencyContractHandler.direct}" Then the tree display, otherwise it will never display. Has anyone run into this before? (The above is using facelets) <>
Re: required attribute of h:inputText consider space as valid value
No. You can only do that w/ Converters and Renderers. Good idea though. Dennis Byrne >-Original Message- >From: Anthony Hong [mailto:[EMAIL PROTECTED] >Sent: Tuesday, July 4, 2006 12:59 AM >To: 'MyFaces Discussion' >Subject: Re: required attribute of h:inputText consider space as valid value > >Is it possible to modify current required validation that I do not >have to change anything. > >On 7/4/06, Dennis Byrne <[EMAIL PROTECTED]> wrote: >> Anthony, >> >> Try writing a custom validator ... something like IsEmptyValidator. >> >> Dennis Byrne >> >> >-Original Message- >> >From: Anthony Hong [mailto:[EMAIL PROTECTED] >> >Sent: Tuesday, July 4, 2006 12:09 AM >> >To: 'MyFaces Discussion' >> >Subject: required attribute of h:inputText consider space as valid value >> > >> >h:inputText can set required attribute to true, that means this field >> >is a mandatory fields. >> > >> >But it does not trim string before validation. So an empty space also >> >a valid value for input text with required attribute. >> > >> >How to solve this problem, that I do not have to add trim string >> >function in javascript one by one. Any idea? >> > >> >Thanks >> >-- >> > >> >Anthony Hong >> > >> >> >> > > >-- > >Anthony Hong >
Re: required attribute of h:inputText consider space as valid value
Is it possible to modify current required validation that I do not have to change anything. On 7/4/06, Dennis Byrne <[EMAIL PROTECTED]> wrote: Anthony, Try writing a custom validator ... something like IsEmptyValidator. Dennis Byrne >-Original Message- >From: Anthony Hong [mailto:[EMAIL PROTECTED] >Sent: Tuesday, July 4, 2006 12:09 AM >To: 'MyFaces Discussion' >Subject: required attribute of h:inputText consider space as valid value > >h:inputText can set required attribute to true, that means this field >is a mandatory fields. > >But it does not trim string before validation. So an empty space also >a valid value for input text with required attribute. > >How to solve this problem, that I do not have to add trim string >function in javascript one by one. Any idea? > >Thanks >-- > >Anthony Hong > -- Anthony Hong
Re: required attribute of h:inputText consider space as valid value
Anthony, Try writing a custom validator ... something like IsEmptyValidator. Dennis Byrne >-Original Message- >From: Anthony Hong [mailto:[EMAIL PROTECTED] >Sent: Tuesday, July 4, 2006 12:09 AM >To: 'MyFaces Discussion' >Subject: required attribute of h:inputText consider space as valid value > >h:inputText can set required attribute to true, that means this field >is a mandatory fields. > >But it does not trim string before validation. So an empty space also >a valid value for input text with required attribute. > >How to solve this problem, that I do not have to add trim string >function in javascript one by one. Any idea? > >Thanks >-- > >Anthony Hong >
required attribute of h:inputText consider space as valid value
h:inputText can set required attribute to true, that means this field is a mandatory fields. But it does not trim string before validation. So an empty space also a valid value for input text with required attribute. How to solve this problem, that I do not have to add trim string function in javascript one by one. Any idea? Thanks -- Anthony Hong
Setter not called for value binding
I'm adding an HtmlSelectOneMenu component programmatically like this HtmlSelectOneMenu menu = new HtmlSelectOneMenu(); menu.setId("123"); menu.setValueBinding("value", app.createValueBinding("#{MyBacking.x}")); menu.setConverter(new IntegerConverter()); Backing bean MyBacking has a member called "x" of type String and a corresponding getter/setter. String x; public String getX() { logger.info("called getX"); return x; } public void setX(String x) { logger.info("called setX"); this.x = x; } The getter gets called 1 time initially and JSF properly uses its value to select the corresponding element of the dropdown (say "second"). So far so good. However the getter and setter never subsequently get called - even when the page is submitted. If I select another value in the dropdown (say "third") and click on some other widgets which causes the page to redisplay, the new dropdown value stays selected (still "third"). So JSF must be setting the dropdown component's value. But since the backing bean's getter/setter is never subsequently called, when I ask the bean for the value of "x", it returns the value initially set (which is "second"). What's going on? There must be something basic going on here that I don't understand. Of course it makes sense for the getter to be called initailly but why doesn't the getter or setter get called after that? Any help would be greatly appreciated. -- View this message in context: http://www.nabble.com/Setter-not-called-for-value-binding-tf1887301.html#a5159953 Sent from the MyFaces - Users forum at Nabble.com.
Re: Possible Patch for java.lang.NullPointerException in HtmlTree.addToModelListeners
Rick- thanks for the patch. might be true. anyway, can you bring it up to JIRA? Would be great! -Matthias On 7/3/06, Rick <[EMAIL PROTECTED]> wrote: HtmlTree.java (the original not HtmlTree 2) was throwing and exception on the following line (line 806 for version 1.1.3) public void addToModelListeners() { Collection listeners = getModel(FacesContext.getCurrentInstance()).getTreeModelListeners(); I fixed the problem by adding the following code to restoreState: public void restoreState(FacesContext context, Object state) { Object values[] = (Object[]) state; super.restoreState(context, values[0]); … if (this.isRendered()){ addToModelListeners(); } } Essentially, I changed restoreState not to call addToModelListeners if we are not in render mode. This worked like a charm. I did a search and noticed several other folks were having this problem: java.lang.NullPointerException org.apache.myfaces.custom.tree.HtmlTree.addToModelListeners(HtmlTree.java:806) org.apache.myfaces.custom.tree.HtmlTree.restoreState(HtmlTree.java:645) javax.faces.component.UIComponentBase.processRestoreState(UIComponentBase.java:728) javax.faces.component.UIComponentBase.processRestoreState(UIComponentBase.java:719) javax.faces.component.UIComponentBase.processRestoreState(UIComponentBase.java:719) javax.faces.component.UIComponentBase.processRestoreState(UIComponentBase.java:719) org.apache.myfaces.application.jsp.JspStateManagerImpl.restoreComponentState(JspStateManagerImpl.java:221) org.apache.myfaces.application.jsp.JspStateManagerImpl.restoreView(JspStateManagerImpl.java:287) org.apache.myfaces.application.jsp.JspViewHandlerImpl.restoreView(JspViewHandlerImpl.java:255) com.sun.facelets.FaceletViewHandler.restoreView(FaceletViewHandler.java:321) org.apache.myfaces.lifecycle.LifecycleImpl.restoreView(LifecycleImpl.java:141) org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:66) javax.faces.webapp.FacesServlet.service(FacesServlet.java:137) org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:144) I am not sure if this patch is general purpose enough but just to let the next guy know how to fix it I thought I would post it here. -- Matthias Wessendorf Aechterhoek 18 48282 Emsdetten blog: http://jroller.com/page/mwessendorf mail: mwessendorf-at-gmail-dot-com
Possible Patch for java.lang.NullPointerException in HtmlTree.addToModelListeners
HtmlTree.java (the original not HtmlTree 2) was throwing and exception on the following line (line 806 for version 1.1.3) public void addToModelListeners() { Collection listeners = getModel(FacesContext.getCurrentInstance()).getTreeModelListeners();I fixed the problem by adding the following code to restoreState: public void restoreState(FacesContext context, Object state) { Object values[] = (Object[]) state; super.restoreState(context, values[0]); … if (this.isRendered()){ addToModelListeners(); } } Essentially, I changed restoreState not to call addToModelListeners if we are not in render mode. This worked like a charm. I did a search and noticed several other folks were having this problem: java.lang.NullPointerException org.apache.myfaces.custom.tree.HtmlTree.addToModelListeners(HtmlTree.java:806) org.apache.myfaces.custom.tree.HtmlTree.restoreState(HtmlTree.java:645) javax.faces.component.UIComponentBase.processRestoreState(UIComponentBase.java:728) javax.faces.component.UIComponentBase.processRestoreState(UIComponentBase.java:719) javax.faces.component.UIComponentBase.processRestoreState(UIComponentBase.java:719) javax.faces.component.UIComponentBase.processRestoreState(UIComponentBase.java:719) org.apache.myfaces.application.jsp.JspStateManagerImpl.restoreComponentState(JspStateManagerImpl.java:221) org.apache.myfaces.application.jsp.JspStateManagerImpl.restoreView(JspStateManagerImpl.java:287) org.apache.myfaces.application.jsp.JspViewHandlerImpl.restoreView(JspViewHandlerImpl.java:255) com.sun.facelets.FaceletViewHandler.restoreView(FaceletViewHandler.java:321) org.apache.myfaces.lifecycle.LifecycleImpl.restoreView(LifecycleImpl.java:141) org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:66) javax.faces.webapp.FacesServlet.service(FacesServlet.java:137) org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:144) I am not sure if this patch is general purpose enough but just to let the next guy know how to fix it I thought I would post it here.
Re: Tree Table support, it does not seem to handle the rendered attribute correctly
Yes, the booleans get everyone. I seem to remember ${b.nonExist} silently evaluating to false, so it's probably a carry over from JSP EL. Dennis Byrne >-Original Message- >From: Rick [mailto:[EMAIL PROTECTED] >Sent: Monday, July 3, 2006 04:17 PM >To: ''MyFaces Discussion'' >Subject: RE: Tree Table support, it does not seem to handle the rendered >attribute correctly > >Thanks! > >Ouch. This is where pair programming could have saved an embarrassing >moment. > >I am working on two projects. One has contacts and one has contracts... >After awhile they start looking the same > > > >-Original Message- >From: Dennis Byrne [mailto:[EMAIL PROTECTED] >Sent: Monday, July 03, 2006 12:36 PM >To: MyFaces Discussion >Subject: Re: Tree Table support, it does not seem to handle the rendered >attribute correctly > >You have it spelled emergencyContractHandler, but it is spelled >emergencyContactHandler elsewhere in the bean :) > >Usually this throws an exception, but because boolean exprs default to >false, it doesn't :( > >Dennis Byrne > >>-Original Message- >>From: Rick [mailto:[EMAIL PROTECTED] >>Sent: Monday, July 3, 2006 03:31 PM >>To: ''MyFaces Discussion'' >>Subject: Tree Table support, it does not seem to handle the rendered >attribute correctly >> >> >> >>I have a tree table that I only want to display if direct is true. >> >> >> >>The direct flag is a property of the backing bean and is used as follows: >> >> >> >> >> >>> >> >model="#{emergencyContactHandler.treeModel}" >> >> >>value="#{emergencyContactHandler.treeModel}" >> >>rowClasses="oddRow, evenRow" >> >>nodeClass="nodeClass" >> >>columnClasses="col1, col2, col3, col4" >> >>iconNodeOpen="/images/nodrill2.gif" >> >>iconNodeClose="/images/drill2.gif" >> >> >>rendered="#{emergencyContractHandler.direct}" >> >>> >> >> >> >> >> >>I put a breakpoint in the isDirect method and it seems to never get called >> >> >> >>If I remove, >> >> >> >>rendered="#{emergencyContractHandler.direct}" >> >> >> >> >> >> >> >> >> >>Then the tree display, otherwise it will never display. >> >> >> >> >> >>Has anyone run into this before? >> >> >> >> >> >>(The above is using facelets) >> >> > > > > >
RE: Tree Table support, it does not seem to handle the rendered attribute correctly
Thanks! Ouch. This is where pair programming could have saved an embarrassing moment. I am working on two projects. One has contacts and one has contracts... After awhile they start looking the same -Original Message- From: Dennis Byrne [mailto:[EMAIL PROTECTED] Sent: Monday, July 03, 2006 12:36 PM To: MyFaces Discussion Subject: Re: Tree Table support, it does not seem to handle the rendered attribute correctly You have it spelled emergencyContractHandler, but it is spelled emergencyContactHandler elsewhere in the bean :) Usually this throws an exception, but because boolean exprs default to false, it doesn't :( Dennis Byrne >-Original Message- >From: Rick [mailto:[EMAIL PROTECTED] >Sent: Monday, July 3, 2006 03:31 PM >To: ''MyFaces Discussion'' >Subject: Tree Table support, it does not seem to handle the rendered attribute correctly > > > >I have a tree table that I only want to display if direct is true. > > > >The direct flag is a property of the backing bean and is used as follows: > > > > > > > model="#{emergencyContactHandler.treeModel}" > > >value="#{emergencyContactHandler.treeModel}" > >rowClasses="oddRow, evenRow" > >nodeClass="nodeClass" > >columnClasses="col1, col2, col3, col4" > >iconNodeOpen="/images/nodrill2.gif" > >iconNodeClose="/images/drill2.gif" > > >rendered="#{emergencyContractHandler.direct}" > >> > > > > > >I put a breakpoint in the isDirect method and it seems to never get called > > > >If I remove, > > > >rendered="#{emergencyContractHandler.direct}" > > > > > > > > > >Then the tree display, otherwise it will never display. > > > > > >Has anyone run into this before? > > > > > >(The above is using facelets) > >
Re: Tree Table support, it does not seem to handle the rendered attribute correctly
You have it spelled emergencyContractHandler, but it is spelled emergencyContactHandler elsewhere in the bean :) Usually this throws an exception, but because boolean exprs default to false, it doesn't :( Dennis Byrne >-Original Message- >From: Rick [mailto:[EMAIL PROTECTED] >Sent: Monday, July 3, 2006 03:31 PM >To: ''MyFaces Discussion'' >Subject: Tree Table support, it does not seem to handle the rendered attribute >correctly > > > >I have a tree table that I only want to display if direct is true. > > > >The direct flag is a property of the backing bean and is used as follows: > > > > > > >model="#{emergencyContactHandler.treeModel}" > > >value="#{emergencyContactHandler.treeModel}" > >rowClasses="oddRow, evenRow" > >nodeClass="nodeClass" > >columnClasses="col1, col2, col3, col4" > >iconNodeOpen="/images/nodrill2.gif" > >iconNodeClose="/images/drill2.gif" > > >rendered="#{emergencyContractHandler.direct}" > >> > > > > > >I put a breakpoint in the isDirect method and it seems to never get called > > > >If I remove, > > > >rendered="#{emergencyContractHandler.direct}" > > > > > > > > > >Then the tree display, otherwise it will never display. > > > > > >Has anyone run into this before? > > > > > >(The above is using facelets) > >
Tree Table support, it does not seem to handle the rendered attribute correctly
I have a tree table that I only want to display if direct is true. The direct flag is a property of the backing bean and is used as follows: I put a breakpoint in the isDirect method and it seems to never get called If I remove, rendered="#{emergencyContractHandler.direct}" Then the tree display, otherwise it will never display. Has anyone run into this before? (The above is using facelets) <>
RE: Value is not a valid option on a selectOneMenu
It has evolved into an Integer. My original code was : which eventually maps back to my HIbernate stuff. I thought I'd simplify it and just see if I could get the integer value back into the Bean, so I added the projectManager to the ProjectBean as an Integer to reduce the layers for errors. Thanks, Steve On Mon, 2006-07-03 at 15:06 -0400, Neuman, Ben J., A&M IRM wrote: Steven, is ProjectBean.projectManager an instance of OrganizationPeople or Integer? [Neuman, Ben J., A&M IRM] -Original Message- From: Steven Peacock [mailto:[EMAIL PROTECTED] Sent: Monday, July 03, 2006 2:22 PM To: MyFaces Discussion Subject: Value is not a valid option on a selectOneMenu I am having a problem that is vexing me, and I can't seem to find a reference to exactly what I am experiencing. I have a jsp with the following code: The code for the select item method is: public List getProjectManagerSelectList () { List potentialManagers = projectControl.getProjectManagerList(); Iterator managerList = potentialManagers.iterator(); List selectItemTypes = new ArrayList(); while (managerList.hasNext()) { OrganizationPeople managerType = (OrganizationPeople) managerList.next(); selectItemTypes.add(new SelectItem(managerType.getPeopleId(),managerType.getPersonFirstName() + " " + managerType.getPersonLastName())); } return(selectItemTypes); } The managerType.getPeopleId() returns an Integer. The html page displays properly, and I get a nice drop down to select the project manager. If I look at the source code, I see what looks like a good select list. A sample of one of the lines is here: John Doe But when I submit my form, I get: "projMgr": Value is not a valid option. I am using myfaces-all.jar that indicates it is a 1.1.1 and deployed on Tomcat via MyEclipse. Thanks, Steven Peacock
RE: Value is not a valid option on a selectOneMenu
Steven, is ProjectBean.projectManager an instance of OrganizationPeople or Integer? [Neuman, Ben J., A&M IRM] -Original Message-From: Steven Peacock [mailto:[EMAIL PROTECTED]Sent: Monday, July 03, 2006 2:22 PMTo: MyFaces DiscussionSubject: Value is not a valid option on a selectOneMenu I am having a problem that is vexing me, and I can't seem to find a reference to exactly what I am experiencing.I have a jsp with the following code: The code for the select item method is: public List getProjectManagerSelectList () { List potentialManagers = projectControl.getProjectManagerList(); Iterator managerList = potentialManagers.iterator(); List selectItemTypes = new ArrayList(); while (managerList.hasNext()) { OrganizationPeople managerType = (OrganizationPeople) managerList.next(); selectItemTypes.add(new SelectItem(managerType.getPeopleId(),managerType.getPersonFirstName() + " " + managerType.getPersonLastName())); } return(selectItemTypes);}The managerType.getPeopleId() returns an Integer.The html page displays properly, and I get a nice drop down to select the project manager. If I look at the source code, I see what looks like a good select list. A sample of one of the lines is here:John DoeBut when I submit my form, I get:"projMgr": Value is not a valid option.I am using myfaces-all.jar that indicates it is a 1.1.1 and deployed on Tomcat via MyEclipse.Thanks, Steven Peacock
Value is not a valid option on a selectOneMenu
I am having a problem that is vexing me, and I can't seem to find a reference to exactly what I am experiencing. I have a jsp with the following code: The code for the select item method is: public List getProjectManagerSelectList () { List potentialManagers = projectControl.getProjectManagerList(); Iterator managerList = potentialManagers.iterator(); List selectItemTypes = new ArrayList(); while (managerList.hasNext()) { OrganizationPeople managerType = (OrganizationPeople) managerList.next(); selectItemTypes.add(new SelectItem(managerType.getPeopleId(),managerType.getPersonFirstName() + " " + managerType.getPersonLastName())); } return(selectItemTypes); } The managerType.getPeopleId() returns an Integer. The html page displays properly, and I get a nice drop down to select the project manager. If I look at the source code, I see what looks like a good select list. A sample of one of the lines is here: John Doe But when I submit my form, I get: "projMgr": Value is not a valid option. I am using myfaces-all.jar that indicates it is a 1.1.1 and deployed on Tomcat via MyEclipse. Thanks, Steven Peacock
Re: Shale and Trinidad
On 7/3/06, Cosma Colanicchia <[EMAIL PROTECTED]> wrote: I can see that the shale filtered and viewhandler are triggered.. allseems configured correctly, but the view controller isn't working.Can you explain a little how it is supposed to work? Where are therequests intercepted and those callback methods called? I see those some code in your PhaseListener that create a ViewControllerCallbacksinstance, but I can't find where its metodhs are invoked. If I knewit, maybe I could find where the problem is..The actual event calls (via ViewControllerCallbacks) happen in ViewPhaseListener .. the call to preprocess is triggered at the end of Restore View phase, and the call to prerender is triggered at the beginning of of Render Response phase. Does the managed bean name of your backing bean match the required naming pattern to be recognized as a ViewController? The precise rules are listed in the javadocs of "org.apache.shale.view.impl.DefaultViewControllerMapper ".Thank youCosmaCraig 2006/6/22, Cosma Colanicchia <[EMAIL PROTECTED]>:> Thank you Craig,>> at first I followed the configuration steps listed in the struts-shale> web site and it didn't work, so I tried to manually configure the > Shale view handler.>> Can you also add Facelets on your playlist? :-)> I'm using also Facelets, that need its own FaceletViewHandler, but not> register it in its META-INF/faces-config.xml . I modified a little the> Facelets jar to make it behave like all the others, registering its> ViewHandler. This way I can now play with the viewhandlers delegation> stack changing the jars order in my project. JSF specification doesn't > mandate any order in loading the META-INF/faces-config, but this seems> to work at least with OC4J container and I hope that other containers> will follow the jars order too (probably it's up to MyFaces > implementation).>> Then, I've tried these stacks without success:>> (request) -> Trinidad -> Shale -> Facelets (works, but no> ViewController callbacks)> (request) -> Shale -> Trinidad -> Facelets (works, but no > ViewController callbacks)> (request) -> Trinidad -> Facelets -> Shale (works, but no> ViewController callbacks)>> I've keep out permutations with Facelets wrapping Trinidad, because > docs explicitly say that it is no good.>> My conclusion: the problem isn't related to view hander delegation> stack. I'll try something else, stay tuned ;-)>>> Cosma> >> 2006/6/21, Craig McClanahan <[EMAIL PROTECTED]>:> > On 6/21/06, Cosma Colanicchia <[EMAIL PROTECTED]> wrote: > >> > > Hi,> > >> > > do you know if Shale can be easily plugged in a MyFaces/Trinidad> > > project? I'm interested in the ViewController pattern, but I can't > > > make it work.> >> >> > In principle, this kind of mixing should work, although I haven't tried it> > myself.> >> > > I setup the project as described in the Shale website, and also tried > > > to manually set ViewViewHandler as the viewhandler in> > > faces-config.xml.> >> >> > You should not have to do this yourself ... Shale (like Trinidad) includes > > an embedded faces-config.xml that should register its own facilities.> >> > > Stepping through the code I can see that it> > > correctly find my managed-bean (using the ViewControllerMapper), but > > > my init method is never called. I don't know which class is supposed> > > to invoke those callback...> >> >> > How recent is the copy of Shale you are using? This is important because > > the mechanism that fires these events was recently (last couple of weeks)> > updated.> >> > > Can this be related to Trinidad? Someone is using these two frameworks> > along? > >> >> > I will put trying this combination on my list of things to play with.> >> > > Thank you> > > Cosma> > >> >> > > > Craig> >> >>
Dependency Injection ,POJO Entity, Design Question
I have a design question regarding a POJO entity bean, dependency injection, and storing the POJO in the user's session. For example, there is a web application where you update some entity through several "wizard" like screens. Then, this information is persisted to a database. The information is stored in a POJO entity bean that uses a data access object to persist the data. The access object is set through dependency injection using JSF's managed bean facility when the POJO is first needed. The POJO is then stored in the user's session. Since the POJO entity bean is stored in the session, it must be serializable. However, I feel that the data access object should not be serializable b/c an implementation may be holding out to a java.sql.connection or javax.sql.DataSource. So the dependency is marked as transient. Now, the problem is that the dependency must be re-injected if the session is deserialized. This can be done my implementing a HttpSessionActivationListener. Another option that I can think of would be to use a simple value bean/transfer object to maintain state and store that in the user's session. Then, create the entity bean at the end and pass the value bean to the entity bean. However, several articles and books have warned against using transfer objects. On the other hand, if the POJO entity bean uses a ServiceLocator by calling a static factory method in its "save" method, then this problem does not occur. However, using the service locator pattern makes testing with mock objects more difficult. Which is the best option or is there another option that I have not thought of? Thank you. __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
Re: Custom Component: changing attributes of other components
I ran out of time and used javascript (ewww!) -- View this message in context: http://www.nabble.com/Custom-Component%3A-changing-attributes-of-other-components-tf1884783.html#a5155013 Sent from the MyFaces - Users forum at Nabble.com.
RE: schedule component month view
Add this to your t:schedule tag: headerDateFormat="E dd-MM-" And be sure to set your mode to ScheduleModel.MONTH (kidding!). Want more? Read: http://myfaces.apache.org/tomahawk/schedule.html Regards, David -Original Message- From: ldr [mailto:[EMAIL PROTECTED] Sent: Monday, July 03, 2006 11:00 AM To: users@myfaces.apache.org Subject: schedule component month view Is it possible to add row in the top wich shows days in month view and how would one go about doing that? thanks, ldr
schedule component month view
Is it possible to add row in the top wich shows days in month view and how would one go about doing that? thanks, ldr -- View this message in context: http://www.nabble.com/schedule-component-month-view-tf1885063.html#a5153242 Sent from the MyFaces - Users forum at Nabble.com.
Re: Shale and Trinidad
I can see that the shale filtered and viewhandler are triggered.. all seems configured correctly, but the view controller isn't working. Can you explain a little how it is supposed to work? Where are the requests intercepted and those callback methods called? I see those some code in your PhaseListener that create a ViewControllerCallbacks instance, but I can't find where its metodhs are invoked. If I knew it, maybe I could find where the problem is.. Thank you Cosma 2006/6/22, Cosma Colanicchia <[EMAIL PROTECTED]>: Thank you Craig, at first I followed the configuration steps listed in the struts-shale web site and it didn't work, so I tried to manually configure the Shale view handler. Can you also add Facelets on your playlist? :-) I'm using also Facelets, that need its own FaceletViewHandler, but not register it in its META-INF/faces-config.xml. I modified a little the Facelets jar to make it behave like all the others, registering its ViewHandler. This way I can now play with the viewhandlers delegation stack changing the jars order in my project. JSF specification doesn't mandate any order in loading the META-INF/faces-config, but this seems to work at least with OC4J container and I hope that other containers will follow the jars order too (probably it's up to MyFaces implementation). Then, I've tried these stacks without success: (request) -> Trinidad -> Shale -> Facelets (works, but no ViewController callbacks) (request) -> Shale -> Trinidad -> Facelets (works, but no ViewController callbacks) (request) -> Trinidad -> Facelets -> Shale (works, but no ViewController callbacks) I've keep out permutations with Facelets wrapping Trinidad, because docs explicitly say that it is no good. My conclusion: the problem isn't related to view hander delegation stack. I'll try something else, stay tuned ;-) Cosma 2006/6/21, Craig McClanahan <[EMAIL PROTECTED]>: > On 6/21/06, Cosma Colanicchia <[EMAIL PROTECTED]> wrote: > > > Hi, > > > > do you know if Shale can be easily plugged in a MyFaces/Trinidad > > project? I'm interested in the ViewController pattern, but I can't > > make it work. > > > In principle, this kind of mixing should work, although I haven't tried it > myself. > > > I setup the project as described in the Shale website, and also tried > > to manually set ViewViewHandler as the viewhandler in > > faces-config.xml. > > > You should not have to do this yourself ... Shale (like Trinidad) includes > an embedded faces-config.xml that should register its own facilities. > > > Stepping through the code I can see that it > > correctly find my managed-bean (using the ViewControllerMapper), but > > my init method is never called. I don't know which class is supposed > > to invoke those callback... > > > How recent is the copy of Shale you are using? This is important because > the mechanism that fires these events was recently (last couple of weeks) > updated. > > > Can this be related to Trinidad? Someone is using these two frameworks > along? > > > I will put trying this combination on my list of things to play with. > > > Thank you > > Cosma > > > > > Craig > >
Custom Component: adding an onLoad event
How would I add an onload event to the page containing my custom component? -- View this message in context: http://www.nabble.com/Custom-Component%3A-adding-an-onLoad-event-tf1884783.html#a5152381 Sent from the MyFaces - Users forum at Nabble.com.
calendar setup
Is it possible only to show back, month, forward and omit days? moreover is it possible to use images as back and forward? thanks in advance, Chris -- View this message in context: http://www.nabble.com/calendar-setup-tf1884742.html#a5152266 Sent from the MyFaces - Users forum at Nabble.com.
Re: datatable presentation providing accessibility
Hi! > First of all, thank you a lot for the immediate reply. Accessibility is something we have to take more care of, I think. > In my previous post I forgot to mention that I'm using My Faces > through the project seam of JBoss. Seam adds some new tags but the > element I use comes from My Faces. First of all, if we manage to fix this, you will have to use the tomahawk datatable (t:datatable) and not the JSF default one (h:datatable). > I know that the "id=/headers=" issue is not so much of importance, but > the project I'm working on, demands full support of accessibility > rules. Thus I need to provide these attributes. > Any ideas ?? You would help me a lot. No, I'll discuss this on the myfaces-dev ml. > Now, concerning the caption, I have searched and found a relevant JIRA > issue, where this bug is reported (almost a month ago) and which > appears to be closed. > While searching in the svn repository to find the version with this > bug fixed I found that the change (concerning the caption) was removed > a little time afterwards. It looks like JSF 1.2 fix this missing caption and this is where this patch was meant to go. Though, maybe we can backport it to the tomahawk datatable. > (Except from this, I found it difficult to get all the source needed > by maven to build a version of myfaces--because of the directory > structure followed in each version) you can use the svn external http://svn.apache.org/repos/asf/myfaces/current to get all whats needed to build the stuff with mvn. > Should I open a new JIRA issue?? > Yes please, that way its easier for us to keep track of the status. Ciao, Mario
Portlet Can not call encodeNamespace() error
I have a simple page (using facelets but I think its a faces problem). xmlns:f="http://java.sun.com/jsf/core"; xmlns:h="http://java.sun.com/jsf/html";> foo backed by a simple bean: public class BooleanTest { private List list = new ArrayList(); private List emptyList = new ArrayList(); private String choice = "Foo"; private List selectList = null; public List getList() { if (choice.equals("Foo")) { return emptyList; } else { if (list.isEmpty()) { list = new ArrayList(); list.add("Hello"); list.add("World"); list.add("!"); } return list; } } public String doIt() { return "success"; } public List getSelectList() { if (selectList == null) { selectList = new ArrayList(); selectList.add(new SelectItem("Foo", "Foo")); selectList.add(new SelectItem("bar", "bar")); } return selectList; } public String getChoice() { return choice; } public void setChoice(String choice) { this.choice = choice; } } When I first add this portlet to a page, I get the drop down list, the submit button and the "empty" message. If I select the 'bar' entry in the list and click submit I get the error, " Can not call encodeNamespace() during a portlet ActionRequest" It seems to be because MyFacesGenericPortlet.processAction calls lifecycle.execute, which in turn starts createing components for the table (which wasn't in the first call to the page). This calls encodeNamespace for the new componenet IDs and thats when it falls over. Can someone tell me what I'm doing wrong - or have i discovered a bug? I've include the relevant part of the stack trace below. Thanks John Nested Exception is java.lang.IllegalStateException: Can not call encodeNamespace() during a portlet ActionRequest at org.apache.myfaces.context.portlet.PortletExternalContextImpl.encodeNamespace(PortletExternalContextImpl.java:189) at javax.faces.component.UIViewRoot.createUniqueId(UIViewRoot.java:187) at javax.faces.component.UIComponentBase.getClientId(UIComponentBase.java:204) at javax.faces.component.UIData.getDataModel(UIData.java:760) at javax.faces.component.UIData.getRowCount(UIData.java:191) at javax.faces.component.UIData.processColumnChildren(UIData.java:685) at javax.faces.component.UIData.processUpdates(UIData.java:622) at javax.faces.component.UIComponentBase.processUpdates(UIComponentBase.java:645) at javax.faces.component.UIViewRoot.processUpdates(UIViewRoot.java:157) at org.apache.myfaces.lifecycle.LifecycleImpl.updateModelValues(LifecycleImpl.java:302) at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:81) at org.apache.myfaces.portlet.MyFacesGenericPortlet.processAction(MyFacesGenericPortlet.java:220) at com.liferay.portal.shared.servlet.PortletServlet.service(PortletServlet.java:77) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672) at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:574) at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:499) at com.liferay.portlet.CachePortlet._invoke(CachePortlet.java:289) at com.liferay.portlet.CachePortlet.processAction(CachePortlet.java:142) at com.liferay.portal.action.LayoutAction._processPortletRequest(LayoutAction.java:232) at com.liferay.portal.action.LayoutAction._processActionRequest(LayoutAction.java:250) at com.liferay.portal.action.LayoutAction.execute(LayoutAction.java:86) at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236) at com.liferay.portal.struts.PortalRequestProcessor.process(PortalRequestProcessor.java:185) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196) at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432) at javax.servlet.http.HttpServlet.service(HttpServlet.java:709) at com.liferay.portal.servlet.MainServlet.callParentService(MainServlet.java:415) at com.liferay.portal.servlet.MainServlet.service(MainServlet.java:810) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
Re: datatable presentation providing accessibility
Mario Ivankovits wrote: Hi Elenh! I want to use a datatable element and render it as an HTML table element, following some rules which provide accessibility. As you may know accessibility rules demand a caption rendered for each HTML table, and some attributes rendered for each cell of the table. According to http://www.ferg.org/section508/accessible_tables.html#contents_item_6.1 I found that the id=/headers= is required for accessible tables, however, they also state that screen readers may become smarter to read simple tables. From the point of html - JSF tables are very simple - header/footer/rows - no colspan, rowspan, etc ... So, do you really think its worth the effort? Do you have a real need for this? Regarding the caption, if this is not supported, I'll help you out, please open a JIRA at issues.apache.org/jira Ciao, Mario Hi!! First of all, thank you a lot for the immediate reply. In my previous post I forgot to mention that I'm using My Faces through the project seam of JBoss. Seam adds some new tags but the element I use comes from My Faces. (so I don't think that this changes the facts, but I just wanted to make this known so as to give the whole picture) I know that the "id=/headers=" issue is not so much of importance, but the project I'm working on, demands full support of accessibility rules. Thus I need to provide these attributes. Any ideas ?? You would help me a lot. Now, concerning the caption, I have searched and found a relevant JIRA issue, where this bug is reported (almost a month ago) and which appears to be closed. While searching in the svn repository to find the version with this bug fixed I found that the change (concerning the caption) was removed a little time afterwards. (Except from this, I found it difficult to get all the source needed by maven to build a version of myfaces--because of the directory structure followed in each version) The JIRA issue is found at : http://issues.apache.org/jira/browse/MYFACES-1184?page=com.atlassian.jira.plugin.ext.subversion:subversion-commits-tabpanel The version with the changes is found at : http://svn.apache.org/viewvc?view=rev&revision=411443 Should I open a new JIRA issue?? Thank you in advance. Elenh
Tomahawk Sandbox: does not display error msg when field focus changes
Does anyone have an idea why the tag might not display the error message when the input field focus changes? I have copied the source code directly from http://www.irian.at/myfaces-sandbox/inputAjax.jsp.source This component demonstrates ajax updating ability when you change the text. An error message is displayed if the given String is greater than 5 characters. P.S. The validate method is reaching my backing bean but the GUI does not display the error message. Only when I press the return key does the entire page refresh, and then I can see the "ajax" error message!
Re: datatable presentation providing accessibility
Hi Elenh! > I want to use a datatable element and render it as an HTML table > element, following some rules which provide accessibility. As you may > know accessibility rules demand a caption rendered for each HTML > table, and some attributes rendered for each cell of the table. According to http://www.ferg.org/section508/accessible_tables.html#contents_item_6.1 I found that the id=/headers= is required for accessible tables, however, they also state that screen readers may become smarter to read simple tables. >From the point of html - JSF tables are very simple - header/footer/rows - no colspan, rowspan, etc ... So, do you really think its worth the effort? Do you have a real need for this? Regarding the caption, if this is not supported, I'll help you out, please open a JIRA at issues.apache.org/jira Ciao, Mario
datatable presentation providing accessibility
Hi all, I want to use a datatable element and render it as an HTML table element, following some rules which provide accessibility. As you may know accessibility rules demand a caption rendered for each HTML table, and some attributes rendered for each cell of the table. Concerning the caption issue it's not supported by myfaces. As far as the attributes in the table's cells are concerned, I need to have an html output which will look like that: Results sorted by Rating Category City Country Hotel Berlin Germany Shop Madrit Spain ... Can anyone help me with the attributes issue? Is there a way to insert a custom tag in the td element with myfaces? Regards Elenh
Re: [SOLVED] and JSF
hi group, for some reasons you souldn't change the file-extension for include-Files in conjunction with dynamic includes even though you configured the new extension in you web.xml i.e. jspf for file fragments Faces Servlet *.jspf just leave it as it is (jsp) - you will save much time and trouble :-) regards Ronald Richard Capraro wrote: > Hello Ronald, > maybe you should surround your include with > > > > > i refers to > http://java.sun.com/j2ee/1.4/docs/tutorial/doc/JSFPage3.html > > Regards, > Richard Capraro > > > 2006/6/30, "R. Müller" <[EMAIL PROTECTED]>: >> hi group, >> >> i run into troubles while trying to include some fragments into my pages >> with -tag. >> >> >> >> >> >> >> >> >> >> >> [...] >> >> >> >> >> >> where 'menu.jspf' is as follows : >> >> <%@ taglib uri="http://java.sun.com/jsf/core"; prefix="f"%> >> <%@ taglib uri="http://myfaces.apache.org/tomahawk"; prefix="t"%> >> >> >> >> >> >> [...] >> >> >> >> i'm quite sure, that it was working some time ago. It seems there runs a >> neverending loop which leads to StackOverflow like you can see in the >> error log. >> The static include : >> >> <%@ include file="/fragments/menu/menu.jspf" %> >> >> works fine. >> There is an article from Kito Mann : >> >> http://www.javaworld.com/javaworld/jw-12-2004/jw-1213-jsf_p.html >> >> which pointed out, that the dynamic include should work as well. >> >> I'm migrated from 1.1.1 to myfaces 1.1.3. >> >> >> at >> org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:966) >> >> at >> org.apache.jsp.project.main_jsp._jspx_meth_f_view_0(main_jsp.java:149) >> at org.apache.jsp.project.main_jsp._jspService(main_jsp.java:95) >> at >> org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94) >> at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) >> at >> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324) >> >> at >> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292) >> Caused by: javax.faces.FacesException: java.lang.StackOverflowError >> ... 1024 more >> >> [ ... again and again ] >> >> Caused by: javax.faces.FacesException: java.lang.StackOverflowError >> ... 1024 more >> Caused by: javax.faces.FacesException: java.lang.StackOverflowError >> >> >> >> regards >> >> ronald >> >> > -- * *M-Unicomp GmbH * *Dipl.-Ing. Ronald Müller *Softwareentwicklung * *Plauener Straße 163-165, Haus 11 *13053 Berlin * *fon : +49 ( 0 ) 30 / 98 69 61 54 *mobil : +49 ( 0 ) 172 / 93 95 00 4 *fax : +49 ( 0 ) 30 / 98 69 61 55 *email : [EMAIL PROTECTED] *web : www.unicomp-berlin.de
Re: and JSF
Thank you for your reply Richard, basically i followed you suggestion, i just putted the tag into the file to include. Nevertheless i took them away there, to put it into the main-page - the same result! here is my minimal test-case : main-page : <%@ page pageEncoding="UTF-8" contentType="text/html; charset=UTF-8"%> <%@ taglib uri="http://java.sun.com/jsf/html"; prefix="h"%> <%@ taglib uri="http://java.sun.com/jsf/core"; prefix="f"%> <%@ taglib uri="http://myfaces.apache.org/tomahawk"; prefix="t"%> http://www.w3.org/TR/html4/transitional.dtd";> TEST-Page <%-- static include works fine, which is no different here. <%@ include file="menu.jspf" %> --%> menu-page (menu.jspf) : <%@ taglib uri="http://myfaces.apache.org/tomahawk"; prefix="t"%> This test-case produces the same result (StackOverflow) for me with MyFaces 1.1.3 . Another idea is, that there is some missconfiguration in the servlet-mappings for included files. Is the following web.xml-fragment right ? Or do i have to send the jspf-files to the original JSP-servlet without Faces? I just want to understand why there are some cycling calls , which leads to this StackOverflow. Faces Servlet javax.faces.webapp.FacesServlet 1 Faces Servlet *.jspf Thank you so far. Regards Ronald Richard Capraro wrote: > Hello Ronald, > maybe you should surround your include with > > > > > i refers to > http://java.sun.com/j2ee/1.4/docs/tutorial/doc/JSFPage3.html > > Regards, > Richard Capraro > > > 2006/6/30, "R. Müller" <[EMAIL PROTECTED]>: >> hi group, >> >> i run into troubles while trying to include some fragments into my pages >> with -tag. >> >> >> >> >> >> >> >> >> >> >> [...] >> >> >> >> >> >> where 'menu.jspf' is as follows : >> >> <%@ taglib uri="http://java.sun.com/jsf/core"; prefix="f"%> >> <%@ taglib uri="http://myfaces.apache.org/tomahawk"; prefix="t"%> >> >> >> >> >> >> [...] >> >> >> >> i'm quite sure, that it was working some time ago. It seems there runs a >> neverending loop which leads to StackOverflow like you can see in the >> error log. >> The static include : >> >> <%@ include file="/fragments/menu/menu.jspf" %> >> >> works fine. >> There is an article from Kito Mann : >> >> http://www.javaworld.com/javaworld/jw-12-2004/jw-1213-jsf_p.html >> >> which pointed out, that the dynamic include should work as well. >> >> I'm migrated from 1.1.1 to myfaces 1.1.3. >> >> >> at >> org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:966) >> >> at >> org.apache.jsp.project.main_jsp._jspx_meth_f_view_0(main_jsp.java:149) >> at org.apache.jsp.project.main_jsp._jspService(main_jsp.java:95) >> at >> org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94) >> at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) >> at >> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324) >> >> at >> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292) >> Caused by: javax.faces.FacesException: java.lang.StackOverflowError >> ... 1024 more >> >> [ ... again and again ] >> >> Caused by: javax.faces.FacesException: java.lang.StackOverflowError >> ... 1024 more >> Caused by: javax.faces.FacesException: java.lang.StackOverflowError >> >> >> >> regards >> >> ronald >> >> > -- * *M-Unicomp GmbH * *Dipl.-Ing. Ronald Müller *Softwareentwicklung * *Plauener Straße 163-165, Haus 11 *13053 Berlin * *fon : +49 ( 0 ) 30 / 98 69 61 54 *mobil : +49 ( 0 ) 172 / 93 95 00 4 *fax : +49 ( 0 ) 30 / 98 69 61 55 *email : [EMAIL PROTECTED] *web : www.unicomp-berlin.de
Re: Understanding phases and UIInput inside of UIData
Hi! I don't know whether this would help u, but this is what i do: - Set immediate=true for both inputs in table and action - When action executes, call first table.processUpdates, where table is the UIData bound to table. This would copy submitted values into model. Hope this helps. - Original Message - From: "Andrew Robinson" <[EMAIL PROTECTED]> To: "MyFaces Discussion" Sent: Friday, June 30, 2006 6:40 PM Subject: Understanding phases and UIInput inside of UIData I had thought I had my problem of phases with UIData figured out, but I am still having issues. I have a data table with input controls in it (inputText for example). Sometimes I lose data in these controls. Here are the use cases and the associated issue: 1. If action immediate set to true, I lose all my data in the data tables 2. If immediate is false my action never fires if a validation error occurs (this is not what I want in this use case, I want my action to ALWAYS fire) 3. If I change the phase ID of the action to the validations phase, and there are validation errors, everything works 4. If I chagne the phase ID of the action to the validations phase and there are no validation errors, I lose my data in the table What I am trying to figure out is the difference between #3 and #4. So, I have changed my action to execute during the processing of validations. This allows me to run my code regardless of validation errors. The side effect is if there are no validation errors, I still lose my data. Why would all my submitted values re-render in the data table when there are validation errors, but not when there are not (I am skipping update model, so in either case it never fires)? I can't see any difference in the code except that with validation errors there is at least one UI component marked as not being valid, but that doesn't seem like it should cause a behavior change with all components on the whole page. If it does how does that work (I couldn't see any such behavior in the code)? I really need to get this sorted out, so if someone could shed some light on how UIData manages to have its child components render submitted values or not I'd really appreciate it. Thanks, Andrew