AW: Problem with PanelTabbedpane
I think an instance of your TabSupport class is created every time you change the tab (that's what I remember, I had a similiar implementation at the beginning). That would explain why your selectedTabIndex property value does not reflect your current index, but always the default value. You may try to create a separate Backing-Bean class to store the selectedTabIndex. And you can update this property from theprocessTabChange method in another class (no Backing-Bean) by looking up a reference to the Backing-Bean every time your processTabChange methodis called. -Matthias -Ursprüngliche Nachricht-Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]Im Auftrag von Hasnain BadamiGesendet: Mittwoch, 5. April 2006 18:34An: MyFaces DiscussionBetreff: Problem with PanelTabbedpane Hi I m trying to use the panel tabbed pane with the serversidetabswitch = true. Therefore I have declared a tab change listener with the following source code public class TabSupport implements Serializable, TabChangeListener {private static final long serialVersionUID = 1L;int selectedTabIndex;public TabSupport(){}public int getSelectedTabIndex() { //System.out.println(" Property getSelectedTabIndex() accessed " + selectedTabIndex);return selectedTabIndex;}public void setSelectedTabIndex(int selectedTabIndex) {//System.out.println(" Property setSelectedTabIndex() accessed"); this.selectedTabIndex = selectedTabIndex;} public void processTabChange(TabChangeEvent event){System.out.println("TabSupport:processTabChange() called " + event.getNewTabIndex() + " " + event.getPhaseId());this.selectedTabIndex = event.getNewTabIndex();}} When I change the tabthe listener is invoked which sets selectedTabIndex value accordingly and I can see this through the system message. But in the generated html the selectedtab content doesnt show meaning selectedTabIndex is still 0. It hasnt been assigned to the new valueor has been overwritten.TabSupport is in the session scope. Following is my jsp code !DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" %@ page contentType="text/html;charset=UTF-8" language="java" % %@ taglib prefix="c" uri ="http://java.sun.com/jstl/core" % %@ taglib prefix="f" uri ="http://java.sun.com/jsf/core" % %@ taglib prefix="h" uri ="http://java.sun.com/jsf/html" % %@ taglib uri="http://myfaces.apache.org/tomahawk " prefix="t"% f:view f:loadBundle basename="com.prytania.resource.Messages " var="messages"/ html head titleh:outputText value="#{messages['title']}"// title t:stylesheet path="/report.css" / /head body h:form id="portfolioFatherForm" f:subview id="header" jsp:include page="inc/page_header.jsp" / /f:subview f:verbatim br/ /f:verbatim t:panelTabbedPane selectedIndex="#{tabSupport.selectedTabIndex}" styleClass="tabbedPane" width="100%" bgcolor="#CC" activeTabStyleClass="activeTab" inactiveTabStyleClass="inactiveTab" activeSubStyleClass="activeSub" inactiveSubStyleClass="inactiveSub" tabContentStyleClass="tabContent" serverSideTabSwitch="true" t:panelTab label=" #{messages['portfolio_summary']}" f:subview id="tabportfoliosummary" rendered="#{(tabSupport.selectedTabIndex==0)}" jsp:include page="portfoliosummary.jsp " / /f:subview /t:panelTab t:panelTab label=" #{messages['portfolio_detail']}" f:subview id="tabportfoliodetail" rendered="#{(tabSupport.selectedTabIndex==1)}" jsp:include page="portfoliodetail.jsp " / /f:subview /t:panelTab t:panelTab label=" #{messages['portfolio_statistics']}" f:subview id="tabportfoliostatistics" rendered="#{(tabSupport.selectedTabIndex==2)}" jsp:include page="portfoliostatistics.jsp " / /f:subview /t:panelTab t:tabChangeListener type="com.prytania.listeners.TabSupport " / /t:panelTabbedPane f:subview id="footer" jsp:include page="inc/page_footer.jsp" / /f:subview /h:form /body html /f:view I shall be highly obliged with any responses. Hassnain
AW: invoking a method of a bean
You may also want to take a look at http://wiki.apache.org/myfaces/AccessingOneManagedBeanFromAnother -Matthias -Ursprüngliche Nachricht-Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]Im Auftrag von Murat HazerGesendet: Mittwoch, 5. April 2006 10:55An: MyFaces DiscussionBetreff: Re: invoking a method of a beanHi,Take a look to the examples in the myfaces source code (sortTable.jsp).(you can checkout the examples for SVN with any SVN client, http://myfaces.apache.org/source-repository.html )regards... On 4/5/06, Benjamin Bratkus [EMAIL PROTECTED] wrote: hello users,i want to invoke a method for sorting a list in a managed bean of my appwithin another managed bean. can anyone give me a hint ?best regards, thanks in advance,ben-- Murat HAZERElektrik-Elektronik Mühendisi - Electrical-Electronics EngineerTel - Phone: +90 222 335 05 80 - 1395Cep Tel - Mobile Phone: +90 532 472 00 63Blog URL: http://www.projedunyasi.orgYahoo Group: http://groups.yahoo.com/group/malatyafenlisesi/
AW: JDBC and Hibernate
It depends on which Hibernate functions and SQL features you'll use. When you use SQL subselects, for instance, I think this won't be supported by all dbs ... -Matthias -Ursprungliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Auftrag von 101questionjsf Gesendet: Mittwoch, 5. April 2006 11:45 An: users@myfaces.apache.org Betreff: JDBC and Hibernate hi all, Currently, i'm using JDBC statements, and using Oracle db. But got a feeling these JDBC statements are going to be Oracle specific... Please help me confirm this is true? If using Hibernate, will it tie to Oracle db or it will be regardless of the backend db, it can just run in any db without any modification -- View this message in context: http://www.nabble.com/JDBC-and-Hibernate-t1398402.html#a3761141 Sent from the MyFaces - Users forum at Nabble.com.
AW: Re: problem with panelTabbedPane on winXP and IE6
As I know from my app, the panelTabbedPane had only a button for the active tab by default. And why should someone press the button for the active tab..? -Matthias -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Auftrag von Gerald Müllan Gesendet: Mittwoch, 5. April 2006 12:53 An: MyFaces Discussion Betreff: Re: Re: problem with panelTabbedPane on winXP and IE6 Hi, would be better if we fix that issue in the component directly. I will have a look on that. The server side switch does a round trip to server in every case when you are switching to the next tab, this requires a post and so there is the need of a button. Client side does the switch only via js, thus no model update will take place. If you have a look at the myfaces simple examples, there are two tabbed panes on the page. The first comes with the setting serverSideTabSwitch=false. Second is set to true, there you get the problems with the button. I am just wondering, if you don`t specify this attribute - default should be client side - the button should not be displayed. cheers, Gerald On 4/4/06, Garner Shawn [EMAIL PROTECTED] wrote: I will try what you said for the css, thanks. You should add that to the Wiki because others are apparently having buttons renderred also and may not be a filter issue as my case wasn't. and only if you you set the panel to serverSide tab switch. I'm not sure what the serverSideTabSwitch attribute does but it's not present in my panelTabbedPane thus I'm not setting it to anything. The attribute wasn't in the myfaces examples so I didn't use the serverSideTabSwitch attribute . Are you sure this has something to do with the problem? Should I be using the serverSideTabSwitch attribute? How would it help? Shawn --Original Messages From: Gerald Müllan [EMAIL PROTECTED] To: MyFaces Discussion users@myfaces.apache.org Date: Tue, 4 Apr 2006 17:56:07 +0200 Subject: Re: problem with panelTabbedPane on winXP and IE6 Hi, Yes, you are right. This is only a missinterpreting issue with IE, and only if you you set the panel to serverSide tab switch. Because you have to do a post, the button is rendered. You can easily access it with: .activeTabClass input { ... } This will also only affect the tab, and not the whole tab-page! cheers, Gerald On 4/4/06, Garner Shawn [EMAIL PROTECTED] wrote: My active tab has been renderring as a button. I went to the example site at http://www.irian.at/myfaces/tabbedPane.jsf and the active tab there has the active tab renderred as a button also. I read a website and this seems to be an winXP and IE6 specific issue and figured out I can fix it by doing this: input { color: #465f8c; padding: 2px 5px; border: 2px solid; border-color: #7bf #07c #07c #7bf; background-color: #f0d4ff; font-family: Georgia, serif; font-size: 18px; display: block; } Which I think the website said you needed either background-color or border-color. Now my tab renders as a tab instead of a button. Howerver... This applies the css to all inputs on the page and I only want the tabs to have this and not any buttons that might submit a form (I do have one too). I created a stylesheet class using the same properties as before. .activeTabClass { color: #465f8c; padding: 2px 5px; border: 2px solid; border-color: #7bf #07c #07c #7bf; background-color: #f0d4ff; font-family: Georgia, serif; font-size: 18px; display: block; } and assigned it to all the different style class attributes (activeTabStyleClass...) for the panelTabbedPane and panelTab tags. I'm a newbie at css but I thought this should have worked but it didn't. Any one have any idea how I can assign this style sheet just the the tab's input button and not the ones on the rest of the page? Shawn -- Gerald Müllan Schelleingasse 2/11 1040 Vienna, Austria 0043 699 11772506 [EMAIL PROTECTED]
AW: Re: problem with panelTabbedPane on winXP and IE6
Ok, but I don't understand why they use CSS to render the active tab's input as button (maybe it's only an IE specific behaviour...) -Matthias -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Auftrag von Gerald Müllan Gesendet: Mittwoch, 5. April 2006 13:22 An: MyFaces Discussion Betreff: Re: Re: problem with panelTabbedPane on winXP and IE6 Hm..have a look at the html-source. There are three input elements, one for each tab. The difference is only in another applied style to the input element over ...activeHeaderCell. regards, Gerald On 4/5/06, Matthias Kahlau [EMAIL PROTECTED] wrote: As I know from my app, the panelTabbedPane had only a button for the active tab by default. And why should someone press the button for the active tab..? -Matthias -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Auftrag von Gerald Müllan Gesendet: Mittwoch, 5. April 2006 12:53 An: MyFaces Discussion Betreff: Re: Re: problem with panelTabbedPane on winXP and IE6 Hi, would be better if we fix that issue in the component directly. I will have a look on that. The server side switch does a round trip to server in every case when you are switching to the next tab, this requires a post and so there is the need of a button. Client side does the switch only via js, thus no model update will take place. If you have a look at the myfaces simple examples, there are two tabbed panes on the page. The first comes with the setting serverSideTabSwitch=false. Second is set to true, there you get the problems with the button. I am just wondering, if you don`t specify this attribute - default should be client side - the button should not be displayed. cheers, Gerald On 4/4/06, Garner Shawn [EMAIL PROTECTED] wrote: I will try what you said for the css, thanks. You should add that to the Wiki because others are apparently having buttons renderred also and may not be a filter issue as my case wasn't. and only if you you set the panel to serverSide tab switch. I'm not sure what the serverSideTabSwitch attribute does but it's not present in my panelTabbedPane thus I'm not setting it to anything. The attribute wasn't in the myfaces examples so I didn't use the serverSideTabSwitch attribute . Are you sure this has something to do with the problem? Should I be using the serverSideTabSwitch attribute? How would it help? Shawn --Original Messages From: Gerald Müllan [EMAIL PROTECTED] To: MyFaces Discussion users@myfaces.apache.org Date: Tue, 4 Apr 2006 17:56:07 +0200 Subject: Re: problem with panelTabbedPane on winXP and IE6 Hi, Yes, you are right. This is only a missinterpreting issue with IE, and only if you you set the panel to serverSide tab switch. Because you have to do a post, the button is rendered. You can easily access it with: .activeTabClass input { ... } This will also only affect the tab, and not the whole tab-page! cheers, Gerald On 4/4/06, Garner Shawn [EMAIL PROTECTED] wrote: My active tab has been renderring as a button. I went to the example site at http://www.irian.at/myfaces/tabbedPane.jsf and the active tab there has the active tab renderred as a button also. I read a website and this seems to be an winXP and IE6 specific issue and figured out I can fix it by doing this: input { color: #465f8c; padding: 2px 5px; border: 2px solid; border-color: #7bf #07c #07c #7bf; background-color: #f0d4ff; font-family: Georgia, serif; font-size: 18px; display: block; } Which I think the website said you needed either background-color or border-color. Now my tab renders as a tab instead of a button. Howerver... This applies the css to all inputs on the page and I only want the tabs to have this and not any buttons that might submit a form (I do have one too). I created a stylesheet class using the same properties as before. .activeTabClass { color: #465f8c; padding: 2px 5px; border: 2px solid; border-color: #7bf #07c #07c #7bf; background-color: #f0d4ff; font-family: Georgia, serif; font-size: 18px; display: block; } and assigned it to all the different style class attributes (activeTabStyleClass...) for the panelTabbedPane and panelTab tags. I'm a newbie at css but I thought this should have worked but it didn't. Any one have any idea how I can assign this style sheet just the the tab's input
AW: tabchangelistener
On 3/25/06, Matthias Kahlau [EMAIL PROTECTED] wrote: Can you please tell me what the problem was with the serverSideTabSwitch? You quoted it already below, but to restate, it didn't interpret non-EL expressings as Boolean values, and wasn't saving the state of the switch in saveState/restoreState. Thanks. I don't use client-side state saving, so the second problem shouldn't apply to me. But I use serverSideTabSwitch=true, and it seems to work (if it wouldn't work, my TabChangeListener wouldn't work, too...) -Matthias On 3/25/06, Matthias Kahlau [EMAIL PROTECTED] wrote: On 10/31/05, Turgay Zengin [EMAIL PROTECTED] wrote: The flag is: serverSideTabSwitch=true This attribute is for the t:panelTabbedPane. The interpretation and state-saving of the serverSideTabSwitch was broken until this week. I'd recommend that you use the latest nightly build or an svn snapshot if you need serverSideTabSwitching. The workaround for using it without upgrading is to use serverSideTabSwitch=#{true} However, you may still have problems because the state of the switch is not saved, and the behavior may unexpectedly revert back to client-side tab switching (or may break in some other unexpected way). Can you please tell me what the problem was with the serverSideTabSwitch? I use the Nightly Build 20051130 with serverSideTabSwitch, and it seems to work without a problem... -Matthias
AW: tabchangelistener
On 10/31/05, Turgay Zengin [EMAIL PROTECTED] wrote: The flag is: serverSideTabSwitch=true This attribute is for the t:panelTabbedPane. The interpretation and state-saving of the serverSideTabSwitch was broken until this week. I'd recommend that you use the latest nightly build or an svn snapshot if you need serverSideTabSwitching. The workaround for using it without upgrading is to use serverSideTabSwitch=#{true} However, you may still have problems because the state of the switch is not saved, and the behavior may unexpectedly revert back to client-side tab switching (or may break in some other unexpected way). Can you please tell me what the problem was with the serverSideTabSwitch? I use the Nightly Build 20051130 with serverSideTabSwitch, and it seems to work without a problem... -Matthias
AW: How does JSF associate a session?
To make sense of this behaviour, try to disable cookies first and see what happens. you'll see the jsessionid always, and you'll have your desired behaviour (if you open a new window, you'll get another jsessionid as well) Thanks. The problem was my approach of initializing Backing-Beans in an access controller Servlet and providing them to JSF by using the ServletContext. Bosch described this approach in his JSF book, but didn't mention that the Backing-Beans will then be shared by different sessions... No I changed this and use the standard constructors of the Backing-Beans, which will be called by JSF. Does someone of you know another approach for providing Backing-Beans to JSF from outside of a JSF request (non-faces request generates faces response)? -Matthias As soon as you enable cookies, the session will be round - it will stick, until the cookie is cleared again. regards, Martin On 3/23/06, Matthias Kahlau [EMAIL PROTECTED] wrote: How did you open a new browser? IE's new window and firefox by default do not start new instance of browsers on most platforms, so memory cookies are kept. If you are on firefox and use the Web Developer Toolbar extension, you can use it to clear all session cookies. I believe (I am pretty sure but didn't confirm it), that the servlet specification states that the Servlet Session is stored as a session cookie under the name JSESSIONID. If the browser does not support cookied, the servlet container is supposed to re-write URLs with ;JSESSIONID=blah appended to the end of the servlet path. (JSF does not matter, it is based on the servlet sessions - 99% sure) I opened a new browser window by executing the ieexplorer.exe, but was in the same session. Is this normal or a local problem only? If I use Opera and copy a URL of my app (without session ID) to IE, the same tab of the panelTabbedPane as in Opare is shown in IE, and not the default tab. But this time, no data is shown in IE at first. But when I invoke an action in IE, I can load some data, too. It seems like there's some inter-browser session or state sharing... If I close all browsers and start a new IE instance with deleted cookies, and enter an absolute URL to a page of my web app (wihout session ID), the page is shown with data, although it should not be possible, because the data had not been loaded before. It seems that the data comes from a previous session (I only use session-scoped Backing-Beans). -Andrew On 3/23/06, Matthias Kahlau [EMAIL PROTECTED] wrote: Hi! Do you know how JSF associates a session to a specific client? I thought this will either work with a session ID or a cookie. But when I open a new browser window and copy the session-ID-less URL from the other browser, which is already in a session, the new browser will be associated to the same session - the same personalized data is shown. This is not what I expected or want... -Matthias -- http://www.irian.at Your JSF powerhouse - JSF Consulting, Development and Courses in English and German Professional Support for Apache MyFaces
AW: MyFaces example wanted for t:panelTabbedPane's selectedIndex, and/or TabChangeListener
Hi! I have a working TabChangeListener, but no time to provide an example this month. I think this would be possible next month... -Matthias -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Auftrag von Mike Kienenberger Gesendet: Dienstag, 21. März 2006 18:22 An: MyFaces User mailing list Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED] Betreff: MyFaces example wanted for t:panelTabbedPane's selectedIndex, and/or TabChangeListener I've noticed that a lot of posters have asked for help with t:panelTabbedPane's selectedIndex and TabChangeListener over the last few months. Would someone be willing to expand the sandbox example (or provide a new example) showing how to use these features of panelTabbedPane? It will enable new users to understand how to do this easier as well as allow us to more quickly debug issues reported against selectedIndex and TabChangeListener. Thanks!
How does JSF associate a session?
Hi! Do you know how JSF associates a session to a specific client? I thought this will either work with a session ID or a cookie. But when I open a new browser window and copy the session-ID-less URL from the other browser, which is already in a session, the new browser will be associated to the same session - the same personalized data is shown. This is not what I expected or want... -Matthias
AW: How does JSF associate a session?
How did you open a new browser? IE's new window and firefox by default do not start new instance of browsers on most platforms, so memory cookies are kept. If you are on firefox and use the Web Developer Toolbar extension, you can use it to clear all session cookies. I believe (I am pretty sure but didn't confirm it), that the servlet specification states that the Servlet Session is stored as a session cookie under the name JSESSIONID. If the browser does not support cookied, the servlet container is supposed to re-write URLs with ;JSESSIONID=blah appended to the end of the servlet path. (JSF does not matter, it is based on the servlet sessions - 99% sure) I opened a new browser window by executing the ieexplorer.exe, but was in the same session. Is this normal or a local problem only? If I use Opera and copy a URL of my app (without session ID) to IE, the same tab of the panelTabbedPane as in Opare is shown in IE, and not the default tab. But this time, no data is shown in IE at first. But when I invoke an action in IE, I can load some data, too. It seems like there's some inter-browser session or state sharing... If I close all browsers and start a new IE instance with deleted cookies, and enter an absolute URL to a page of my web app (wihout session ID), the page is shown with data, although it should not be possible, because the data had not been loaded before. It seems that the data comes from a previous session (I only use session-scoped Backing-Beans). -Andrew On 3/23/06, Matthias Kahlau [EMAIL PROTECTED] wrote: Hi! Do you know how JSF associates a session to a specific client? I thought this will either work with a session ID or a cookie. But when I open a new browser window and copy the session-ID-less URL from the other browser, which is already in a session, the new browser will be associated to the same session - the same personalized data is shown. This is not what I expected or want... -Matthias
AW: inputCalendar problem
Hi Matthias, I believe this is the dreaded converter timezone problem which can be fixed by using your own special converter. What I generally do is put a component-binding on the calendar component and then create the component in the backend, and there I set stuff which is repeatable across the whole app (like a converter=#{converterBean.converter}) and styles. Thanks. This sounds a little bit complicated for the apparently small problem. How does this converter have to look like? Can't I use the convertDateTime standard action? -Matthias regards, Martin On 3/20/06, Matthias Kahlau [EMAIL PROTECTED] wrote: Hi! I have a date 18.3.2006 shown in an outputText with a nested convertDateTime with timeZone=Europe/Berlin. If I open an edit form with this date 18.3.2006, the date is shown in an inputCalendar, also with a nested convertDateTime with timeZone=Europe/Berlin. The problem is that the date is then shown as 19.3.2006. Does the inputCalendar convert the date itself to another TimeZone? Thanks. -Matthias -- http://www.irian.at Your JSF powerhouse - JSF Consulting, Development and Courses in English and German Professional Support for Apache MyFaces
AW: inputCalendar problem
Hi Matthias, I use the methods below to convert back and forth. Because our app uses java.util.Calendar, the method toNormalizedDate is used to convert the calendar to a date suitable for JSF, and fromNormalizedDate to convert it back. Many thanks. So you don't use the convertDateTime action at all? And how do I switch to using the Europe/Berlin TimeZone? -Matthias Frank Felix /** * Required to work around a bug in ADF/JSF, where * dates are always normalized to GMT, and then time * is set to 0, resulting in a change of date for all * time zones before GMT. * * @param calendar * @return normalized date */ @SuppressWarnings(deprecation) public static Date toNormalizedDate(Calendar calendar) { return calendar==null ? null : new Date( Date.UTC( calendar.get(Calendar.YEAR)-1900, calendar.get(Calendar.MONTH), calendar.get(Calendar.DATE), 0, 0, 0 ) ); } /** * Required to work around a bug in ADF/JSF, where * dates are always normalized to GMT, and then time * is set to 0, resulting in a change of date for all * time zones before GMT. * * @param date the date to copy from */ @SuppressWarnings(deprecation) public static Calendar fromNormalizedDate(Date date) { if (date==null) { return null; } return new GregorianCalendar( date.getDate(), date.getYear()+1900), date.getMonth() ); }
inputCalendar problem
Hi! I have a date 18.3.2006 shown in an outputText with a nested convertDateTime with timeZone=Europe/Berlin. If I open an edit form with this date 18.3.2006, the date is shown in an inputCalendar, also with a nested convertDateTime with timeZone=Europe/Berlin. The problem is that the date is then shown as 19.3.2006. Does the inputCalendar convert the date itself to another TimeZone? Thanks. -Matthias
inputCalendar problem
Hi! I have a date 18.3.2006 shown in an outputText with a nested convertDateTime with timeZone=Europe/Berlin. If I open an edit form with this date 18.3.2006, the date is shown in an inputCalendar, also with a nested convertDateTime with timeZone=Europe/Berlin. The problem is that the date is then shown as 19.3.2006. Does the inputCalendar convert the date itself to another TimeZone? Thanks. -Matthias
mailto outputLink with session id problem
Hi! I use the standard outputLink action for a mailto link. The problem is that JSF adds the session id to the mailto URL. Do you know if it's possible to prevent this? Thanks. -Matthias
AW: multi-selection in selectOneListBox
Hi, you may use the selectManyListboxof the Standard HTML RenderKit Taglib. It displays all options at the same time and allows the user to mouse select many optionswhile holding the CTRL-Key. -Matthias -Ursprüngliche Nachricht-Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]Im Auftrag von [EMAIL PROTECTED]Gesendet: Samstag, 18. März 2006 11:41An: 'MyFaces Discussion'Betreff: multi-selection in selectOneListBox Hi! Is there a JSF tool to have a selectOneListBox that allows us to select several elements in this list at the same time? Thanks De: Dave [mailto:[EMAIL PROTECTED] Envoyé: samedi 18 mars 2006 09:24À: users@myfaces.apache.orgObjet: myfaces source including sandbox http://svn.apache.org/repos/asf/myfaces/ http://cvs.apache.org/builds/myfaces/nightly/ I try to use subForm. I could not find sandbox in repos. In the nightly build area, there is no sandbox either. I like to download all myfaces source including sandbox. thanks for info. Yahoo! MailBring photos to life! New PhotoMail makes sharing a breeze.
AW: multi-selection in selectOneListBox
I've never used the selectManyListbox action myself. But I remember a problem when using a List for the selected valuesof a selectManyCheckbox, which also didn't work. I used an Array with the type of the SelectItem values instead, and this did the trick. Maybe you want to try this. -Matthias -Ursprüngliche Nachricht-Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]Im Auftrag von [EMAIL PROTECTED]Gesendet: Samstag, 18. März 2006 16:19An: [EMAIL PROTECTED]; 'MyFaces Discussion'Betreff: RE: multi-selection in selectOneListBox Thanks for the answer. I was trying to use this selectManyListBox but I got into troubles to get the selected items. Please would you mind telling me what I am doing wrong: - I initialized my list of trades: protected ListSelectItem allTrades = null; allTrades = xmlParse.getAllActiveDimensions("Trade"); //all trades are correctly displayed in my jsp page - I initialized my list of selected trades: protected ListString selectedTrades = null; this.selectedTrades = new ArrayListString(); - I have getters setters on them public ListSelectItem getAllTrades(){ return this.allTrades; } public void setAllTrades(ListSelectItem allTrades){ this.allTrades = allTrades; }public ListString getSelectedTrades(){ return this.selectedTrades; } public void setSelectedTrades(ListString selectedTrades) { this.selectedTrades = selectedTrades; } - I add the code to display the trades in my jsp page: td style="width:150px" h:outputText value="#{Fmsg.authorizedTrades}" /:BR h:selectManyListbox id="trades1" value="#{MyClass.selectedTrades}" style="width:150px" f:selectItems value="#{MyClass.allTrades}" / /h:selectManyListbox /td - I write all the selected trades in a file but none are written: try { BufferedWriter out = new BufferedWriter(new FileWriter("selectedTrades.txt")); for ( String sel : this.selectedTrades) out.write( sel ); out.close(); } catch (IOException ioe) { System.out.println(ioe.toString()); } But here the file is created but nothing is written inside! What do I do wrong? Thanks again for help. Sophie De: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Envoyé: samedi 18 mars 2006 15:19À: MyFaces Discussion; [EMAIL PROTECTED]Objet: AW: multi-selection in selectOneListBox Hi, you may use the selectManyListboxof the Standard HTML RenderKit Taglib. It displays all options at the same time and allows the user to mouse select many optionswhile holding the CTRL-Key. -Matthias -Ursprüngliche Nachricht-Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]Im Auftrag von [EMAIL PROTECTED]Gesendet: Samstag, 18. März 2006 11:41An: 'MyFaces Discussion'Betreff: multi-selection in selectOneListBox Hi! Is there a JSF tool to have a selectOneListBox that allows us to select several elements in this list at the same time? Thanks De: Dave [mailto:[EMAIL PROTECTED] Envoyé: samedi 18 mars 2006 09:24À: users@myfaces.apache.orgObjet: myfaces source including sandbox http://svn.apache.org/repos/asf/myfaces/ http://cvs.apache.org/builds/myfaces/nightly/ I try to use subForm. I could not find sandbox in repos. In the nightly build area, there is no sandbox either. I like to download all myfaces source including sandbox. thanks for info. Yahoo! MailBring photos to life! New PhotoMail makes sharing a breeze. __ NOD32 1.1449 (20060317) Information __This message was checked by NOD32 antivirus system.http://www.eset.com
AW: multi-selection in selectOneListBox
Which datatype do you use for the SelectItem's values? -Matthias -Ursprüngliche Nachricht-Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]Im Auftrag von [EMAIL PROTECTED]Gesendet: Samstag, 18. März 2006 18:48An: 'MyFaces Discussion'Betreff: RE: multi-selection in selectOneListBox I tried to use an array for the selectedTrades (String[nbTrades]) and an array for all my trades (SelectItem[nbTrades]) But that does not work, I have nbTrades selectedTrades that are all null. Sophie De: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Envoyé: samedi 18 mars 2006 16:44À: MyFaces Discussion; [EMAIL PROTECTED]Objet: AW: multi-selection in selectOneListBox I've never used the selectManyListbox action myself. But I remember a problem when using a List for the selected valuesof a selectManyCheckbox, which also didn't work. I used an Array with the type of the SelectItem values instead, and this did the trick. Maybe you want to try this. -Matthias -Ursprüngliche Nachricht-Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]Im Auftrag von [EMAIL PROTECTED]Gesendet: Samstag, 18. März 2006 16:19An: [EMAIL PROTECTED]; 'MyFaces Discussion'Betreff: RE: multi-selection in selectOneListBox Thanks for the answer. I was trying to use this selectManyListBox but I got into troubles to get the selected items. Please would you mind telling me what I am doing wrong: - I initialized my list of trades: protected ListSelectItem allTrades = null; allTrades = xmlParse.getAllActiveDimensions("Trade"); //all trades are correctly displayed in my jsp page - I initialized my list of selected trades: protected ListString selectedTrades = null; this.selectedTrades = new ArrayListString(); - I have getters setters on them public ListSelectItem getAllTrades(){ return this.allTrades; } public void setAllTrades(ListSelectItem allTrades){ this.allTrades = allTrades; }public ListString getSelectedTrades(){ return this.selectedTrades; } public void setSelectedTrades(ListString selectedTrades) { this.selectedTrades = selectedTrades; } - I add the code to display the trades in my jsp page: td style="width:150px" h:outputText value="#{Fmsg.authorizedTrades}" /:BR h:selectManyListbox id="trades1" value="#{MyClass.selectedTrades}" style="width:150px" f:selectItems value="#{MyClass.allTrades}" / /h:selectManyListbox /td - I write all the selected trades in a file but none are written: try { BufferedWriter out = new BufferedWriter(new FileWriter("selectedTrades.txt")); for ( String sel : this.selectedTrades) out.write( sel ); out.close(); } catch (IOException ioe) { System.out.println(ioe.toString()); } But here the file is created but nothing is written inside! What do I do wrong? Thanks again for help. Sophie De: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Envoyé: samedi 18 mars 2006 15:19À: MyFaces Discussion; [EMAIL PROTECTED]Objet: AW: multi-selection in selectOneListBox Hi, you may use the selectManyListboxof the Standard HTML RenderKit Taglib. It displays all options at the same time and allows the user to mouse select many optionswhile holding the CTRL-Key. -Matthias -Ursprüngliche Nachricht-Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]Im Auftrag von [EMAIL PROTECTED]Gesendet: Samstag, 18. März 2006 11:41An: 'MyFaces Discussion'Betreff: multi-selection in selectOneListBox Hi! Is there a JSF tool to have a selectOneListBox that allows us to select several elements in this list at the same time? Thanks De: Dave [mailto:[EMAIL PROTECTED] Envoyé: samedi 18 mars 2006 09:24À: users@myfaces.apache.orgObjet: myfaces source including sandbox http://svn.apache.org/repos/asf/myfaces/ http://cvs.apache.org/builds/myfaces/nightly/ I try to use subForm. I could not find sandbox in repos. In the nightly build area, there is no sandbox either. I like to download all myfaces source including sandbox. thanks for info. Yahoo! MailBring photos to life! New PhotoMail makes sharing a breeze.
AW: remove FacesMessage(s) safely
Hi! Did you find a solution? I also need to remove FacesMessage(s) from the FacesContext, because of removing global duplicates. -Matthias -Ursprüngliche Nachricht-Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]Im Auftrag von DaveGesendet: Donnerstag, 16. März 2006 01:18An: users@myfaces.apache.orgBetreff: remove FacesMessage(s) safely I know I am doing hacks because MyFaces does not display beautiful messages in my case. In a phase listener (after Model Update), I tried to remove FacesMessage(s) with generated ID like "_idJsp123" FacesContext context = event.getFacesContext(); IteratorFacesMessage itr = context.getMessages(); while (itr.hasNext()) { FacesMessage message = itr.next(); if (message.getDetail().indexOf("_id") =0 ) itr.remove(); } Removing was successful without error. But during Render Phase, an error showed up. It seems that thereferenced FacesMessage isnot found. I do not understand how it happens. If a FacesMessage is deleted from a collection, and it is still ref erenced by others, it will not be gabage collected. Is there a way to remove FacesMessages safely? Thanks! java.util.NoSuchElementException at java.util.AbstractList$Itr.next(AbstractList.java:427) at org.apache.myfaces.renderkit.html.HtmlMessagesRendererBase$MessagesIterator.next(HtmlMessagesRendererBase.java:329) at org.apache.myfaces.renderkit.html.HtmlMessagesRendererBase.renderTable(HtmlMessagesRendererBase.java:119) at org.apache.myfaces.renderkit.html.HtmlMessagesRendererBase.renderMessages(HtmlMessagesRendererBase.java:67) at org.apache.myfaces.renderkit.html.HtmlMessagesRenderer.encodeEnd(HtmlMessagesRenderer.java:39) at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:539) at org.apache.myfaces.renderkit.RendererUtils.renderChild(RendererUtils.java:433) at org.apache.myfaces.renderkit.html.HtmlGridRendererBase.renderChildren(HtmlGridRendererBase.java:215) at org.apache.myfaces.renderkit.html.HtmlGridRendererBase.encodeEnd(HtmlGridRendererBase.java:97) at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:539) at org.apache.myfaces.renderkit.RendererUtils.renderChild(RendererUtils.java:433) at org.apache.myfaces.renderkit.RendererUtils.renderChildren(RendererUtils.java:410) Yahoo! TravelFind great deals to the top 10 hottest destinations!
AW: JSF value Change Listener Problem
Hi again! Hi! Does that mean all listener happens BEFORE the update model phase? Include action listener No, the action listener fires after the invoke-application phase, which is after the update model. All this after and before ;-) In fact the action listener fires during the invoke-application phase. If the UICommand component is configured with immediate=true, the ActionEvent will be processed at the end of the Apply Request Values Phase. -Matthias Havent had some tee today thanks Dennis for keeping an eye on me :-) ! Ciao, Mario
AW: selectOneMenu and valueChangeListeners
Hi! Do you change the model properties of the other two selectOneMenus when you processtheValueChangeEvent of one selectOneMenu? This may cause firing new ValueChangeEvents, I can remember such a problem.You may try to comment out these changes and see, if the other methods are still called. An alternative might be the valueChangeNotifier component, which processes ValueChangeEvents after the Update Model Values Phase. Matthias -Ursprüngliche Nachricht-Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]Im Auftrag von Rogerio PereiraGesendet: Mittwoch, 15. März 2006 21:21An: MyFaces DiscussionBetreff: selectOneMenu and valueChangeListenersHi,I have three selectOneMenu in my page, each selectOneMenu has your own valuechangelistener, my problem is, when i change the value of one selectOneMenu all valuechangemethod in my backing bean are being fired.Any ideas? This is a bug?-- Yours truly (Atenciosamente),Rogério
AW: AUTO_SCROLL question
No, not that I know of. how would we configure that? Maybe by setting a marker in JSF pages to include or exclude some? Maybe it would be possible without global setting, only per page settings; per command settings would be even better... regards, Martin Matthias On 3/11/06, Matthias Kahlau [EMAIL PROTECTED] wrote: Hi! Yeah, the AUTO_SCROLL feature works. But it's not appropriate for every page of my application. On some pages, the top of the page would be better, e. g. when trying to save a form that triggers a validation error, because a list a validation errors is shown on top. Is it possible to exclude some pages from the AUTO_SCROLL feature, or include only some? Matthias -- http://www.irian.at Your JSF powerhouse - JSF Consulting, Development and Courses in English and German Professional Support for Apache MyFaces
AUTO_SCROLL question
Hi! Yeah, the AUTO_SCROLL feature works. But it's not appropriate for every page of my application. On some pages, the top of the page would be better, e. g. when trying to save a form that triggers a validation error, because a list a validation errors is shown on top. Is it possible to exclude some pages from the AUTO_SCROLL feature, or include only some? Matthias
MyFaces dependencies
Hi! you've published a list of JARs that are required for applications to work with MyFaces (http://myfaces.apache.org/gettingstarted.html). The list doesn't contain the commons-logging.jar, which is contained in the MyFaces examples application (simple). Is this JAR also required? Matthias
AW: MyFaces dependencies
Many thanks Dennis, but I need to know what's really required for my Nightly 20051130 application, not for the current version. Matthias -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Auftrag von Dennis Byrne Gesendet: Donnerstag, 9. März 2006 23:14 An: MyFaces Discussion Betreff: Re: MyFaces dependencies Matthias, Right now the best place to look for all MyFaces deps is to just use what MyFaces is currently distributed with. See the nightly builds for this. Thanks. Dennis Byrne -Original Message- From: Matthias Kahlau [mailto:[EMAIL PROTECTED] Sent: Thursday, March 9, 2006 08:50 AM To: 'Users MyFaces' Subject: MyFaces dependencies Hi! you've published a list of JARs that are required for applications to work with MyFaces (http://myfaces.apache.org/gettingstarted.html). The list doesn't contain the commons-logging.jar, which is contained in the MyFaces examples application (simple). Is this JAR also required? Matthias
Problem with dataScroller images
Hi! I have a problem with the dataScroller contained in a tab of a tabbed pane. The images are shown correctly when the page is initially loaded, when I navigate between the tabs and when I perform an action the causes to display the same tab again. But when I leave the tab to a form not contained in the tabbed pane, and then return to it, only placeholders, and not the images are rendered, until I force the page to redisplay. Can you image what might cause this, and how to solve it? (I use the filter mapping described on the MyFaces Web page.) Matthias
AW: How Does JDeveloper Compare with Java Studio Creator
Thing = embedded OC4j in JDeveloper. You may deploy to another application server from JDeveloper and run it there, if you think OC4j does perform bad. I don't know, I use JDeveloper 10.1.2 and deploy directly to the JBoss deploy directory, but with less files. Maybe your long startup time is caused by the translation or compilation of the files, and has nothing to do with the app server itself. But I think JDeveloper (I use 10.1.2) does only pick the changed files. Regards, Matthias -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Auftrag von Martin Marinschek Gesendet: Samstag, 4. März 2006 11:36 An: MyFaces Discussion Betreff: Re: How Does JDeveloper Compare with Java Studio Creator Thing = embedded OC4j in JDeveloper. I didn't try JSC so far - would the performance be better there? Any experiences? regards, Martin On 3/4/06, Martin Marinschek [EMAIL PROTECTED] wrote: Can you guys tell how well your IDEs would perform with large apps? I was trying to get an app with 200 jspx files (admittedly, rather large) up and running in JDeveloper, and the thing didn't start up until after 10min. Is work being done on making this situation better? Maybe I'm doing something wrong here, too. regards, Martin On 3/4/06, Adam Winer [EMAIL PROTECTED] wrote: On 3/3/06, Yee CN [EMAIL PROTECTED] wrote: Is there any supports for Facelets in JDeveloper or JSC? I am using MyEclipse – and I am seriously looking for an alternative. Unfortunately not. Facelets has come on strong basically at exactly the wrong point in the development cycle for JDeveloper (and JSC too, I'd imagine). I'm certainly pushing Facelets to anyone in earshot. :) -- Adam -- http://www.irian.at Your JSF powerhouse - JSF Consulting, Development and Courses in English and German Professional Support for Apache MyFaces -- http://www.irian.at Your JSF powerhouse - JSF Consulting, Development and Courses in English and German Professional Support for Apache MyFaces
AW: How Does JDeveloper Compare with Java Studio Creator
It was something like the method behind jsp:include taking a string parameter and a boolean in some library, but internally in OC4J not or so. I only use the include directive, and I have no problem. Regards, Matthias -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Auftrag von Martin Marinschek Gesendet: Samstag, 4. März 2006 13:20 An: Matthias Kahlau Cc: MyFaces Discussion Betreff: Re: How Does JDeveloper Compare with Java Studio Creator Ok, I see. so that would have only been the first startup? Well, there had been another thing which prevented the app from startup at all. It was something like the method behind jsp:include taking a string parameter and a boolean in some library, but internally in OC4J not or so. regards, Martin On 3/4/06, Matthias Kahlau [EMAIL PROTECTED] wrote: Thing = embedded OC4j in JDeveloper. You may deploy to another application server from JDeveloper and run it there, if you think OC4j does perform bad. I don't know, I use JDeveloper 10.1.2 and deploy directly to the JBoss deploy directory, but with less files. Maybe your long startup time is caused by the translation or compilation of the files, and has nothing to do with the app server itself. But I think JDeveloper (I use 10.1.2) does only pick the changed files. Regards, Matthias -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Auftrag von Martin Marinschek Gesendet: Samstag, 4. März 2006 11:36 An: MyFaces Discussion Betreff: Re: How Does JDeveloper Compare with Java Studio Creator Thing = embedded OC4j in JDeveloper. I didn't try JSC so far - would the performance be better there? Any experiences? regards, Martin On 3/4/06, Martin Marinschek [EMAIL PROTECTED] wrote: Can you guys tell how well your IDEs would perform with large apps? I was trying to get an app with 200 jspx files (admittedly, rather large) up and running in JDeveloper, and the thing didn't start up until after 10min. Is work being done on making this situation better? Maybe I'm doing something wrong here, too. regards, Martin On 3/4/06, Adam Winer [EMAIL PROTECTED] wrote: On 3/3/06, Yee CN [EMAIL PROTECTED] wrote: Is there any supports for Facelets in JDeveloper or JSC? I am using MyEclipse – and I am seriously looking for an alternative. Unfortunately not. Facelets has come on strong basically at exactly the wrong point in the development cycle for JDeveloper (and JSC too, I'd imagine). I'm certainly pushing Facelets to anyone in earshot. :) -- Adam -- http://www.irian.at Your JSF powerhouse - JSF Consulting, Development and Courses in English and German Professional Support for Apache MyFaces -- http://www.irian.at Your JSF powerhouse - JSF Consulting, Development and Courses in English and German Professional Support for Apache MyFaces -- http://www.irian.at Your JSF powerhouse - JSF Consulting, Development and Courses in English and German Professional Support for Apache MyFaces
AW: How Does JDeveloper Compare with Java Studio Creator
Hi! The following Web pages may provide a good start when searching for JSF IDEs or plugins: http://www.jsfcentral.com/products/ides/ http://www.jsfcentral.com/products/plugins/ Regards, Matthias -Ursprungliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Auftrag von Igor Marakov Gesendet: Samstag, 4. Marz 2006 20:13 An: 'MyFaces Discussion'; [EMAIL PROTECTED] Betreff: RE: How Does JDeveloper Compare with Java Studio Creator For me the following cycle works better than working with OC4J: build .war in Jdev, ftp to server with tomcat deploy repeat Igor -Original Message- From: Martin Marinschek [mailto:[EMAIL PROTECTED] Sent: Saturday, March 04, 2006 5:35 AM To: MyFaces Discussion Subject: Re: How Does JDeveloper Compare with Java Studio Creator Can you guys tell how well your IDEs would perform with large apps? I was trying to get an app with 200 jspx files (admittedly, rather large) up and running in JDeveloper, and the thing didn't start up until after 10min. Is work being done on making this situation better? Maybe I'm doing something wrong here, too. regards, Martin On 3/4/06, Adam Winer [EMAIL PROTECTED] wrote: On 3/3/06, Yee CN [EMAIL PROTECTED] wrote: Is there any supports for Facelets in JDeveloper or JSC? I am using MyEclipse - and I am seriously looking for an alternative. Unfortunately not. Facelets has come on strong basically at exactly the wrong point in the development cycle for JDeveloper (and JSC too, I'd imagine). I'm certainly pushing Facelets to anyone in earshot. :) -- Adam -- http://www.irian.at Your JSF powerhouse - JSF Consulting, Development and Courses in English and German Professional Support for Apache MyFaces
AW: stateful/stateless JSF components
The classical example is a tabbed pane. With a server side rendered, you trigger a request at every tab change going through all the hoops, with a client side one, you have to do more loading upfront because you load all the components and values, but in the best case that is it, even if you switch the tabs 100 times you wont trigger any other request onto the server until save is hit. I think there's no difference between client-side and server-side tab-switching of the MyFaces panelTabbedPane regarding the rendering behaviour. I did expect that, when using server-side tab-switching, only the active tab's content would be rendered, but looking at the HTML source returned with the response showed me, that the content of all tabs is contained. The contents of the inactive tabs are only made invisible by using CSS. I use MyFaces Nightly 20051130 - maybe it's a problem with this version only. Regards, Matthias -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Auftrag von Werner Punz Gesendet: Freitag, 3. März 2006 00:05 An: users@myfaces.apache.org Betreff: Re: stateful/stateless JSF components Thomas DELHOMENIE schrieb: Thank you Werner for your answer. If I understand what you say, a stateless component doesn't exist on the server between 2 requests, that's right ? And a component like h:outputText doesn't need to be stateful contrary to a more complex component like a tree, am I right ? well in certain situations it makes sense to have outputtext being state aware but in many not, and that is the real problem. In a classical rich client ui every component you use is state aware per default without any costs, but adding that layer to a server side rendered ui on top of a stateless protocol is a huge burden. The main problem is where do you draw the boundaries of having to have a stateful component and a non stateful. h:outputText value=show this text/ for sure can be non stateful with h:outputText value=#{something dynamic}/ you already might have a problem on your hands in some conditions. (output text probably is a bad example nevertheless lets leave it) So where do you draw the line and where can you draw it automatically. I am not sure if it is a good idea to go entirely stateless, you would lose the biggest advantage of jsf the programming model of a rich client ui that way, you would end up with a simplified Struts. I only see two solutions, give the users the opportunity to turn off the stateful behavior on component level, and the one Adam Winer was showing, improve the state saving on algorithmic level. (After reading Adams blog, I see a huge potential here) But at one point there always will be a tradeoff, but that tradeoff has to be done manually on non stateful frameworks as well, with myriads of hidden fields or session states kept around programmatically to keep the ui states. Becoming more dynamic on the client side also might be a reduction on the burden, not because you reduce states that way (after all the ajaxed and javascripted ui states have to survive a request cycle) but because you can reduce server side load tremendously that way. The classical example is a tabbed pane. With a server side rendered, you trigger a request at every tab change going through all the hoops, with a client side one, you have to do more loading upfront because you load all the components and values, but in the best case that is it, even if you switch the tabs 100 times you wont trigger any other request onto the server until save is hit.
AW: AW: stateful/stateless JSF components
And if it is true what you say then the load savings due to the client side tab switching on the myfaces tabbed pane is even more, because you stream the entire data only once instead of at hitting the tab every time. You're right, but I think developers should make design decisions in favor of the user, if that's possible. And users with a slow network connection won't be happy if they have bad response times because of streaming the entire data of all tabs at once. Maybe users do not need the data of inactive tabs at all. Regards, Matthias -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Auftrag von Werner Punz Gesendet: Freitag, 3. März 2006 12:30 An: users@myfaces.apache.org Betreff: Re: AW: stateful/stateless JSF components I dont know, I do not know the code of this component too much, anyway my point was that if you do client side tab switching you reduce server side load tremendously, either way in any case because with client side tab switching you trigger only one request at all. And I think adding some stateful behavior on the client generally can help to resolve a lot of problems, where the server nowadays still has to keep the load and state saving. And if it is true what you say then the load savings due to the client side tab switching on the myfaces tabbed pane is even more, because you stream the entire data only once instead of at hitting the tab every time. Matthias Kahlau schrieb: The classical example is a tabbed pane. With a server side rendered, you trigger a request at every tab change going through all the hoops, with a client side one, you have to do more loading upfront because you load all the components and values, but in the best case that is it, even if you switch the tabs 100 times you wont trigger any other request onto the server until save is hit. I think there's no difference between client-side and server-side tab-switching of the MyFaces panelTabbedPane regarding the rendering behaviour. I did expect that, when using server-side tab-switching, only the active tab's content would be rendered, but looking at the HTML source returned with the response showed me, that the content of all tabs is contained. The contents of the inactive tabs are only made invisible by using CSS.
AW: MyFaces dataTable column sorting
I'm trying to get the MyFaces dataTable to sort my columns. Getting to show up my data was no problem so I think I'm on the right way. I think you have to provide your own sort method, which sorts the data list according to the sortAscending and sortColumn attribute values before the data list is returned by its getter method. Regards, Matthias -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Auftrag von Dave Brondsema Gesendet: Dienstag, 28. Februar 2006 14:48 An: MyFaces Discussion Betreff: Re: MyFaces dataTable column sorting See the tomahawk examples, there's a good example of t:dataTable sortColumn, and sortAscending should bind to getters/setters for a String and boolean. Malone, Daniel wrote: Hi, I'm trying to get the MyFaces dataTable to sort my columns. Getting to show up my data was no problem so I think I'm on the right way. I'm not sure what the two attributes sortColumn and sortAscending mean. I know that a String and a boolean is expected but that's about it. Maybe someone can help me out. I had a look at the examples on Irian.com but they don't help very much. Is more for looking at. I'm thankful for any hint. JSP Page Code t:dataTable id=tbUsers var=user value=#{Results.list} sortColumn=#{Results.sort} sortAscending=#{Results.ascending} t:column f:facet name=header t:commandSortHeader columnName=nr outputText value=nr / /t:commandSortHeader /f:facet h:outputText value=#{user.nr}/ /t:column t:column f:facet name=header t:commandSortHeader columnName=status h:outputText value=Status / /t:commandSortHeader /f:facet h:outputText value=#{user.status} / /t:column ... /t:dataTable Best regards, Daniel Malone -- Dave Brondsema Software Developer Cornerstone University
CSS styles of Tomahawk calendar component
Hi! Does anybody know what's the difference between the DB and WH CSS styles of the Tomahawk calendar component? Regards, Matthias
AW: Problem with panelTabbedPane's selectedIndex memory
Hi! Do you have no idea? What can be wrong that a property value accessed by a reference of a Backing-Bean after a lookup is not the same value than it is in the accessor method of the Backing-Bean itself? Please have a look at the example below. I can't find a coding error, so your general ideas of what might be wrong could really help me... (The lookup is normally not performed in the accessor method, it's only an example that shows the value discrepancy. The property value retrieved by a lookup of the Backing-Bean is 'null' in any case.) Regards, Matthias -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Auftrag von Matthias Kahlau Gesendet: Montag, 20. Februar 2006 09:06 An: MyFaces Discussion Betreff: AW: Problem with panelTabbedPane's selectedIndex memory Hi! Can anybody please share some ideas or guess why the selectedIndex property value of my session-scoped Backing-Bean TabChangeListenerBacking is different when the value is retrieved by a lookup of the Backing-Bean? Any help would by highly appreciated... public void setSelectedIndex(Integer index) { this.selectedIndex = index; System.out.println(this.selectedIndex before lookup = + this.selectedIndex); // selectedIndex is 1 // getting a reference to this Backing-Bean FacesContext context = FacesContext.getCurrentInstance(); Application app = context.getApplication(); ValueBinding binding = app.createValueBinding(#{TabChangeListenerBacking}); TabChangeListenerBacking backing = (TabChangeListenerBacking)binding.getValue(context); System.out.println(backing.selectedIndex = + backing.selectedIndex); // selectedIndex is null ?! System.out.println(this.selectedIndex after lookup = + this.selectedIndex); // selectedIndex is 1 } Regards, Matthias -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Auftrag von Matthias Kahlau Gesendet: Samstag, 18. Februar 2006 00:31 An: MyFaces Discussion Betreff: AW: Problem with panelTabbedPane's selectedIndex memory Hi! I did some further investigations and could limit the possible causes. The Backing-Bean's selectedIndex property is 'null' only when a Backing-Bean lookup is performed to read the property value (the Backing-Bean is in session-scope!). Example with logging output in the property's setter method (please note the comments): public void setSelectedIndex(Integer index) { this.selectedIndex = index; System.out.println(this.selectedIndex before lookup = + this.selectedIndex); // e. g. 1 TabChangeListenerBacking backing = (TabChangeListenerBacking)BackingBeanManager.lookup( Constants.TABCHANGE_LISTENER_BACKING); // a reference to this Backing-Bean System.out.println(backing.selectedIndex = + backing.selectedIndex); // null System.out.println(this.selectedIndex after lookup = + this.selectedIndex); // still 1 } Do you know what might cause this discrepancy? It causes my panelTabbedPane's selectedIndex memory not to work... Regards, Matthias -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Auftrag von Matthias Kahlau Gesendet: Mittwoch, 15. Februar 2006 16:21 An: Users MyFaces Betreff: Problem with panelTabbedPane's selectedIndex memory Hi! I encounter a strange behaviour with using a Backing-Bean in session-scope (TabChangeListenerBacking). It stores the selected index of a panelTabbedPane, which is set by a TabChangeListener. When I change the tabs, I can see that the TabChangeListener works, because logging info showed that the TabChangeListenerImpl.processTabChange() and TabChangeListenerBacking.setSelectedIndex() methods are invoked with the correct index. The problem happens when I come back to the panelTabbedPane after leaving it to a page that isn't contained in the panelTabbedPane. When I come back, TabChangeListenerBacking.getSelectedIndex() is invoked to receive the currently selected index, but the value is null. I don't understand why the selected index is 'null', it had been set to the real selected index before, as I could see in the logging output. It's like the TabChangeListenerBacking would forget its state. I tried it with a primitive int variable instead of the Integer before, and the int had been '0' instead of 'null', instead of the value that had been set by the TabChangeListenerImpl.processTabChange() before leaving the panelTabbedPane. The TabChangeListenerBacking seems to forget its state after leaving the panelTabbedPane, although it's in session-scope. Does anybody of you have an idea what's going on? I'm clueless. Please have a look at the code snippets below. faces-config: managed-bean
AW: Problem with panelTabbedPane's selectedIndex memory
Hi! Can anybody please share some ideas or guess why the selectedIndex property value of my session-scoped Backing-Bean TabChangeListenerBacking is different when the value is retrieved by a lookup of the Backing-Bean? Any help would by highly appreciated... public void setSelectedIndex(Integer index) { this.selectedIndex = index; System.out.println(this.selectedIndex before lookup = + this.selectedIndex); // selectedIndex is 1 // getting a reference to this Backing-Bean FacesContext context = FacesContext.getCurrentInstance(); Application app = context.getApplication(); ValueBinding binding = app.createValueBinding(#{TabChangeListenerBacking}); TabChangeListenerBacking backing = (TabChangeListenerBacking)binding.getValue(context); System.out.println(backing.selectedIndex = + backing.selectedIndex); // selectedIndex is null ?! System.out.println(this.selectedIndex after lookup = + this.selectedIndex); // selectedIndex is 1 } Regards, Matthias -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Auftrag von Matthias Kahlau Gesendet: Samstag, 18. Februar 2006 00:31 An: MyFaces Discussion Betreff: AW: Problem with panelTabbedPane's selectedIndex memory Hi! I did some further investigations and could limit the possible causes. The Backing-Bean's selectedIndex property is 'null' only when a Backing-Bean lookup is performed to read the property value (the Backing-Bean is in session-scope!). Example with logging output in the property's setter method (please note the comments): public void setSelectedIndex(Integer index) { this.selectedIndex = index; System.out.println(this.selectedIndex before lookup = + this.selectedIndex); // e. g. 1 TabChangeListenerBacking backing = (TabChangeListenerBacking)BackingBeanManager.lookup( Constants.TABCHANGE_LISTENER_BACKING); // a reference to this Backing-Bean System.out.println(backing.selectedIndex = + backing.selectedIndex); // null System.out.println(this.selectedIndex after lookup = + this.selectedIndex); // still 1 } Do you know what might cause this discrepancy? It causes my panelTabbedPane's selectedIndex memory not to work... Regards, Matthias -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Auftrag von Matthias Kahlau Gesendet: Mittwoch, 15. Februar 2006 16:21 An: Users MyFaces Betreff: Problem with panelTabbedPane's selectedIndex memory Hi! I encounter a strange behaviour with using a Backing-Bean in session-scope (TabChangeListenerBacking). It stores the selected index of a panelTabbedPane, which is set by a TabChangeListener. When I change the tabs, I can see that the TabChangeListener works, because logging info showed that the TabChangeListenerImpl.processTabChange() and TabChangeListenerBacking.setSelectedIndex() methods are invoked with the correct index. The problem happens when I come back to the panelTabbedPane after leaving it to a page that isn't contained in the panelTabbedPane. When I come back, TabChangeListenerBacking.getSelectedIndex() is invoked to receive the currently selected index, but the value is null. I don't understand why the selected index is 'null', it had been set to the real selected index before, as I could see in the logging output. It's like the TabChangeListenerBacking would forget its state. I tried it with a primitive int variable instead of the Integer before, and the int had been '0' instead of 'null', instead of the value that had been set by the TabChangeListenerImpl.processTabChange() before leaving the panelTabbedPane. The TabChangeListenerBacking seems to forget its state after leaving the panelTabbedPane, although it's in session-scope. Does anybody of you have an idea what's going on? I'm clueless. Please have a look at the code snippets below. faces-config: managed-bean managed-bean-nameTabChangeListenerBacking/managed-bean-name managed-bean-classde.fhzw.portal.umfragesystem.view.utils.tabbed Pane.TabC hangeListenerBacking/managed-bean-class managed-bean-scopesession/managed-bean-scope /managed-bean panelTabbedPane: -- t:panelTabbedPane selectedIndex=#{TabChangeListenerBacking.selectedIndex} serverSideTabSwitch=true ... t:tabChangeListener type=de.fhzw.portal.umfragesystem.view.utils.tabbedPane.TabChangeLi stenerImpl / /t:panelTabbedPane The TabChangeListenerImpl: --- public TabChangeListenerImpl() { this.backing = (TabChangeListenerBacking)BackingBeanManager.lookup( Constants.TABCHANGE_LISTENER_BACKING); } public void processTabChange(TabChangeEvent tabChangeEvent) { int newIndex = tabChangeEvent.getNewTabIndex(); this.backing.setSelectedIndex(new Integer
AW: display label in error message instead of id
If you look at the JSF book by Kito Mann, p 26, it shows an h:outputText .../ wrapped in an h:outputLabel.../ which is unnecessary (overall, it's a good book). As Hans Bergsten writes in his JSF book, the value attribute of the h:outputLabel element is ignored by the JSF 1.0 reference implementation, but other implementations may respect it and use it as the label body. (p. 349) Regards, Matthias -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Auftrag von Mike Duffy Gesendet: Samstag, 18. Februar 2006 04:32 An: MyFaces Discussion Betreff: RE: display label in error message instead of id Thanks for figuring this out. I had the exact same problem. If you look at the JSF book by Kito Mann, p 26, it shows an h:outputText .../ wrapped in an h:outputLabel.../ which is unnecessary (overall, it's a good book). Thanks again. Mike --- Michael Heinen [EMAIL PROTECTED] wrote: Thanks a lot for your help. Now it works of course :-) -Original Message- From: Mario Ivankovits [mailto:[EMAIL PROTECTED] Sent: Freitag, 17. Februar 2006 11:58 To: MyFaces Discussion Subject: Re: display label in error message instead of id Hi! Ok, I found a problem if one uses outputText as child of outputLabel. Its fixed now. As a workaround now you can get rid of outputText and use the value= attribute in outputLabel directly. eg. h:outputLabel for=input value=label / h:inputText id=input required=true / Ciao, Mario __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
AW: Rendered markup of HtmlSelectManyCheckbox / HtmlSelectOneRadio incomplete?
Hi Volker, many thanks. I tried different selectors, but neither ID selector nor some attribute selectors did work (in my case). But I could achieve success with the following attribute (class) selector in conjunction with a descendant selector: BODY.classname TD { // my css } Regards, Matthias -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Auftrag von Volker Weber Gesendet: Donnerstag, 16. Februar 2006 20:50 An: MyFaces Discussion Betreff: Re: Rendered markup of HtmlSelectManyCheckbox / HtmlSelectOneRadio incomplete? Hi Matthias, Matthias Kahlau wrote: Hi! My HtmlSelectManyCheckbox with spread layout and a styleClass set is rendered as follows: table border=0 tbody trtdinput type=checkbox name=Form:Frage_4 id=Form:Frage_4 value=1 class=surveyInput /#160;die zweite (Text)nbsp;/td/tr trtdinput type=checkbox name=Form:Frage_4 id=Form:Frage_4 value=2 class=surveyInput /#160;die dritte (datum)nbsp;/td/tr /tbody /table This does not comply to the Standard Html RenderKit specification of JSF 1.1 for the HtmlSelectManyCheckbox renderer: You're right, layout=spread is out of spec ;-). Render a table element. If the styleClass is specified, render the value of the styleClass attribute as the value of the class attribute on the table element. If the style, border attributes are specified, pass them thru. If the layout attribute is specified, and its value is pageDirection, render the children elements vertically, otherwise horizontally, in the table. If any of the children are an instance of SelectItemGroup, render them as a nested table. Each of the children are ultimately rendererd as follows. Render a label element. Inside of the label, render an input element of type checkbox for each child component. ... The class surveyInput (set to the HtmlSelectManyCheckbox component) is rendered only as attribute in the input elements themselves, but not for the table. Furthermore, the Tomahawk HtmlSelectManyCheckbox renderer doesn't render a label element around each input element. Why did you choose a different markup? In contrast, the Tomahawk HtmlSelectOneRadio component's markup (spread layout) does contain label elements as required, but shows the same behaviour regarding the styleClass attribute of the component: table border=0tbody trtdlabelinput type=radio name=Form:Frage_2 checked=checked value=1 class=surveyInput /#160;die zweite (Texteingabe)/labelnbsp;/td/tr trtdlabelinput type=radio name=Form:Frage_2 value=2 class=surveyInput /#160;die dritte (nur Ganzzahlen)/labelnbsp;/td/tr /tbody/table As Hans Bergsten describes in his JSF book, the label elements should also specify their for attributes, which isn't the case for the code snippets shown (using MyFaces Nightly 20051130). The label element is my lifesaver in changing the format of the radio button labels, and I really need them for the checkboxes, too. I don't know how to change the format of the checkbox labels, because I can't change the table, tbody, tr or td elements per CSS globally, and applying a style to the HtmlPanelGrid containing the checkbox controls is not sufficient in my case because there's a global definition for the td element which a must not change ...! Do you have an idea of how I could change the checkbox label format? not sure, but maybe you can use the descendant modifier of css: http://www.w3.org/TR/REC-CSS2/selector.html#descendant-selectors try: --- [css] - #panelGridId td { // css for label tds here } --- [/css] - Or even better: Create a patch for this to accept a 'labelClass' attribute and rendering the label tag for checkboxes also. Regards, Volker Regards, Matthias -- Don't answer to From: address! Mail to this account are droped if not recieved via mailinglist. To contact me direct create the mail address by concatenating my forename to my senders domain.
AW: Problem with panelTabbedPane's selectedIndex memory
Hi! I did some further investigations and could limit the possible causes. The Backing-Bean's selectedIndex property is 'null' only when a Backing-Bean lookup is performed to read the property value (the Backing-Bean is in session-scope!). Example with logging output in the property's setter method (please note the comments): public void setSelectedIndex(Integer index) { this.selectedIndex = index; System.out.println(this.selectedIndex before lookup = + this.selectedIndex); // e. g. 1 TabChangeListenerBacking backing = (TabChangeListenerBacking)BackingBeanManager.lookup( Constants.TABCHANGE_LISTENER_BACKING); // a reference to this Backing-Bean System.out.println(backing.selectedIndex = + backing.selectedIndex); // null System.out.println(this.selectedIndex after lookup = + this.selectedIndex); // still 1 } Do you know what might cause this discrepancy? It causes my panelTabbedPane's selectedIndex memory not to work... Regards, Matthias -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Auftrag von Matthias Kahlau Gesendet: Mittwoch, 15. Februar 2006 16:21 An: Users MyFaces Betreff: Problem with panelTabbedPane's selectedIndex memory Hi! I encounter a strange behaviour with using a Backing-Bean in session-scope (TabChangeListenerBacking). It stores the selected index of a panelTabbedPane, which is set by a TabChangeListener. When I change the tabs, I can see that the TabChangeListener works, because logging info showed that the TabChangeListenerImpl.processTabChange() and TabChangeListenerBacking.setSelectedIndex() methods are invoked with the correct index. The problem happens when I come back to the panelTabbedPane after leaving it to a page that isn't contained in the panelTabbedPane. When I come back, TabChangeListenerBacking.getSelectedIndex() is invoked to receive the currently selected index, but the value is null. I don't understand why the selected index is 'null', it had been set to the real selected index before, as I could see in the logging output. It's like the TabChangeListenerBacking would forget its state. I tried it with a primitive int variable instead of the Integer before, and the int had been '0' instead of 'null', instead of the value that had been set by the TabChangeListenerImpl.processTabChange() before leaving the panelTabbedPane. The TabChangeListenerBacking seems to forget its state after leaving the panelTabbedPane, although it's in session-scope. Does anybody of you have an idea what's going on? I'm clueless. Please have a look at the code snippets below. faces-config: managed-bean managed-bean-nameTabChangeListenerBacking/managed-bean-name managed-bean-classde.fhzw.portal.umfragesystem.view.utils.tabbed Pane.TabC hangeListenerBacking/managed-bean-class managed-bean-scopesession/managed-bean-scope /managed-bean panelTabbedPane: -- t:panelTabbedPane selectedIndex=#{TabChangeListenerBacking.selectedIndex} serverSideTabSwitch=true ... t:tabChangeListener type=de.fhzw.portal.umfragesystem.view.utils.tabbedPane.TabChangeLi stenerImpl / /t:panelTabbedPane The TabChangeListenerImpl: --- public TabChangeListenerImpl() { this.backing = (TabChangeListenerBacking)BackingBeanManager.lookup( Constants.TABCHANGE_LISTENER_BACKING); } public void processTabChange(TabChangeEvent tabChangeEvent) { int newIndex = tabChangeEvent.getNewTabIndex(); this.backing.setSelectedIndex(new Integer(newIndex)); } TabChangeListenerBacking: -- private Integer selectedIndex; public void setSelectedIndex(Integer index) { this.selectedIndex = index; } public Integer getSelectedIndex() { return this.selectedIndex; } Regards, Matthias
Rendered markup of HtmlSelectManyCheckbox / HtmlSelectOneRadio incomplete?
Hi! My HtmlSelectManyCheckbox with spread layout and a styleClass set is rendered as follows: table border=0 tbody trtdinput type=checkbox name=Form:Frage_4 id=Form:Frage_4 value=1 class=surveyInput /#160;die zweite (Text)nbsp;/td/tr trtdinput type=checkbox name=Form:Frage_4 id=Form:Frage_4 value=2 class=surveyInput /#160;die dritte (datum)nbsp;/td/tr /tbody /table This does not comply to the Standard Html RenderKit specification of JSF 1.1 for the HtmlSelectManyCheckbox renderer: Render a table element. If the styleClass is specified, render the value of the styleClass attribute as the value of the class attribute on the table element. If the style, border attributes are specified, pass them thru. If the layout attribute is specified, and its value is pageDirection, render the children elements vertically, otherwise horizontally, in the table. If any of the children are an instance of SelectItemGroup, render them as a nested table. Each of the children are ultimately rendererd as follows. Render a label element. Inside of the label, render an input element of type checkbox for each child component. ... The class surveyInput (set to the HtmlSelectManyCheckbox component) is rendered only as attribute in the input elements themselves, but not for the table. Furthermore, the Tomahawk HtmlSelectManyCheckbox renderer doesn't render a label element around each input element. Why did you choose a different markup? In contrast, the Tomahawk HtmlSelectOneRadio component's markup (spread layout) does contain label elements as required, but shows the same behaviour regarding the styleClass attribute of the component: table border=0tbody trtdlabelinput type=radio name=Form:Frage_2 checked=checked value=1 class=surveyInput /#160;die zweite (Texteingabe)/labelnbsp;/td/tr trtdlabelinput type=radio name=Form:Frage_2 value=2 class=surveyInput /#160;die dritte (nur Ganzzahlen)/labelnbsp;/td/tr /tbody/table As Hans Bergsten describes in his JSF book, the label elements should also specify their for attributes, which isn't the case for the code snippets shown (using MyFaces Nightly 20051130). The label element is my lifesaver in changing the format of the radio button labels, and I really need them for the checkboxes, too. I don't know how to change the format of the checkbox labels, because I can't change the table, tbody, tr or td elements per CSS globally, and applying a style to the HtmlPanelGrid containing the checkbox controls is not sufficient in my case because there's a global definition for the td element which a must not change ...! Do you have an idea of how I could change the checkbox label format? Regards, Matthias
AW: Setting CSS Programatically
To get this to work for the entire row you will need to add the : styleClass=#{(yourVar.valueToCheck backingBean.threshold)? 'styleClass2' : 'styleClass2'} attribute to each column in the row. Yes, I already thought that way, but I think setting the column styles might expose a different behaviour than setting the row style. Anyway, your solution seems to be a good workaround... Regards, Matthias -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Auftrag von Conway. Fintan (IT Solutions) Gesendet: Mittwoch, 15. Februar 2006 11:35 An: MyFaces Discussion Betreff: RE: Setting CSS Programatically It will work because the style is set depending on the row variable yourVar. The example shown will work for one column. To get this to work for the entire row you will need to add the : styleClass=#{(yourVar.valueToCheck backingBean.threshold)? 'styleClass2' : 'styleClass2'} attribute to each column in the row. Regards, Fintan -Original Message- From: Bruno Aranda [mailto:[EMAIL PROTECTED] Sent: 15 February 2006 10:17 To: MyFaces Discussion Subject: Re: Setting CSS Programatically May it seem so, but believe me... I am going to write an example eventually :-) Bruno On 2/15/06, Matthias Kahlau [EMAIL PROTECTED] wrote: t:column styleClass=#{(yourVar.valueToCheck backingBean.threshold)? 'styleClass2' : 'styleClass2'}/ Won't this only affect the column style, but not the row style? Regards, Matthias -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Auftrag von Bruno Aranda Gesendet: Mittwoch, 15. Februar 2006 00:35 An: MyFaces Discussion Betreff: Re: Setting CSS Programatically Yes you can using the t:column. Something like this t:dataTable var=yourVar ... t:column styleClass=#{(yourVar.valueToCheck backingBean.threshold)? 'styleClass2' : 'styleClass2'}/ /t:dataTable Use a managed bean with the exposed threshold variable. Hope that helps, Bruno On 2/14/06, Elam Daly [EMAIL PROTECTED] wrote: Howdy all, Is it possible to set the css of row in a dataTable programmatically? I have a dataTable bound to a UIData component and I cycle through the rows of the table and calculate some values. If the value is greater than a certain threshold, I need to highlight the entire row, say by coloring it red. Is is possible to manipulate the style for that single row? Thanks, -Elam * ** *** ** * ** *** ** * ** *** ** * This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. Any views or opinions presented are solely those of the author, and do not necessarily represent those of ESB. If you have received this email in error please notify the sender. Although ESB scans e-mail and attachments for viruses, it does not guarantee that either are virus-free and accepts no liability for any damage sustained as a result of viruses. * ** *** ** * ** *** ** * ** *** ** *
Problem with panelTabbedPane's selectedIndex memory
Hi! I encounter a strange behaviour with using a Backing-Bean in session-scope (TabChangeListenerBacking). It stores the selected index of a panelTabbedPane, which is set by a TabChangeListener. When I change the tabs, I can see that the TabChangeListener works, because logging info showed that the TabChangeListenerImpl.processTabChange() and TabChangeListenerBacking.setSelectedIndex() methods are invoked with the correct index. The problem happens when I come back to the panelTabbedPane after leaving it to a page that isn't contained in the panelTabbedPane. When I come back, TabChangeListenerBacking.getSelectedIndex() is invoked to receive the currently selected index, but the value is null. I don't understand why the selected index is 'null', it had been set to the real selected index before, as I could see in the logging output. It's like the TabChangeListenerBacking would forget its state. I tried it with a primitive int variable instead of the Integer before, and the int had been '0' instead of 'null', instead of the value that had been set by the TabChangeListenerImpl.processTabChange() before leaving the panelTabbedPane. The TabChangeListenerBacking seems to forget its state after leaving the panelTabbedPane, although it's in session-scope. Does anybody of you have an idea what's going on? I'm clueless. Please have a look at the code snippets below. faces-config: managed-bean managed-bean-nameTabChangeListenerBacking/managed-bean-name managed-bean-classde.fhzw.portal.umfragesystem.view.utils.tabbedPane.TabC hangeListenerBacking/managed-bean-class managed-bean-scopesession/managed-bean-scope /managed-bean panelTabbedPane: -- t:panelTabbedPane selectedIndex=#{TabChangeListenerBacking.selectedIndex} serverSideTabSwitch=true ... t:tabChangeListener type=de.fhzw.portal.umfragesystem.view.utils.tabbedPane.TabChangeLi stenerImpl / /t:panelTabbedPane The TabChangeListenerImpl: --- public TabChangeListenerImpl() { this.backing = (TabChangeListenerBacking)BackingBeanManager.lookup( Constants.TABCHANGE_LISTENER_BACKING); } public void processTabChange(TabChangeEvent tabChangeEvent) { int newIndex = tabChangeEvent.getNewTabIndex(); this.backing.setSelectedIndex(new Integer(newIndex)); } TabChangeListenerBacking: -- private Integer selectedIndex; public void setSelectedIndex(Integer index) { this.selectedIndex = index; } public Integer getSelectedIndex() { return this.selectedIndex; } Regards, Matthias
MyFaces context parameters
Hi! Are the following context parameters also availaible in MyFaces 1.1.1 nightly builds, or only some of them? They sound interesting, I've never heard from some of them. Is there a description available, or can you describe them? context-param param-namejavax.faces.STATE_SAVING_METHOD/param-name param-valueserver/param-value /context-param context-param param-nameorg.apache.myfaces.NUMBER_OF_VIEWS_IN_SESSION/param-name param-value20/param-value /context-param context-param param-nameorg.apache.myfaces.SERIALIZE_STATE_IN_SESSION/param-name param-valuetrue/param-value /context-param context-param param-nameorg.apache.myfaces.COMPRESS_STATE_IN_SESSION/param-name param-valuetrue/param-value /context-param context-param param-nameorg.apache.myfaces.ALLOW_JAVASCRIPT/param-name param-valuefalse/param-value /context-param context-param param-nameorg.apache.myfaces.DETECT_JAVASCRIPT/param-name param-valuefalse/param-value /context-param context-param param-nameorg.apache.myfaces.PRETTY_HTML/param-name param-valuetrue/param-value /context-param context-param param-nameorg.apache.myfaces.AUTO_SCROLL/param-name param-valuetrue/param-value /context-param Regards, Matthias
AW: MyFaces context parameters
von Matthias Wessendorf Gesendet: Montag, 13. Februar 2006 17:25 An: MyFaces Discussion Betreff: Re: MyFaces context parameters Hi Matthias, not all of your mentioned parameters are MyFaces specific params. context-param param-namejavax.faces.STATE_SAVING_METHOD/param-name param-valueserver/param-value /context-param this guy is defined in jsf spec. it is the default value for storing the state of your faces app. Using client is also possible. Now MyFaces (also the RI) are storing the *state* inside of a hidden input field. I just added some JavaDoc to JspStateManagerImpl clazz to explain some parameters. Also, as Boris mentioned the web.xml for the *simple* web application demo explains all of the context parameters Many thanks, I will have a look at the web.xml. HTH, Matthias Regards, Matthias context-param param-nameorg.apache.myfaces.NUMBER_OF_VIEWS_IN_SESSION/param-name param-value20/param-value /context-param context-param param-nameorg.apache.myfaces.SERIALIZE_STATE_IN_SESSION/param-name param-valuetrue/param-value /context-param context-param param-nameorg.apache.myfaces.COMPRESS_STATE_IN_SESSION/param-name param-valuetrue/param-value /context-param context-param param-nameorg.apache.myfaces.ALLOW_JAVASCRIPT/param-name param-valuefalse/param-value /context-param context-param param-nameorg.apache.myfaces.DETECT_JAVASCRIPT/param-name param-valuefalse/param-value /context-param context-param param-nameorg.apache.myfaces.PRETTY_HTML/param-name param-valuetrue/param-value /context-param context-param param-nameorg.apache.myfaces.AUTO_SCROLL/param-name param-valuetrue/param-value /context-param Regards, Matthias -- Matthias Wessendorf Zülpicher Wall 12, 239 50674 Köln http://www.wessendorf.net mwessendorf-at-gmail-dot-com
AW: AW: Problem with evaluation of Tomahawk HtmlSelectOneRadio components inside UIData (programmatically created UI)
There's a use case where I encounter a problem with my solution. When a validation error occurs in the process validations phase, all the radio buttons shown in the HtmlDataTable aren't rendered when the page is redisplayed. Why I try to evaluate the HtmlSelectOneRadio components in this view state, I get a runtime error because the components aren't fully initialized. The component values / value classes are of the following type, for example: value = [EMAIL PROTECTED] value class = org.apache.myfaces.renderkit.RendererUtils$1 Is it possible to solve this problem, or is this a dead end? Regards, Matthias -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Auftrag von Matthias Kahlau Gesendet: Freitag, 10. Februar 2006 22:36 An: MyFaces Discussion; [EMAIL PROTECTED] Betreff: AW: AW: Problem with evaluation of Tomahawk HtmlSelectOneRadio components inside UIData (programmatically created UI) Hi! There's a use case where I encounter a problem with my solution. When a validation error occurs in the process validations phase, all the radio buttons shown in the HtmlDataTable aren't rendered when the page is redisplayed. Why I try to evaluate the HtmlSelectOneRadio components in this view state, I get a runtime error because the components aren't fully initialized. The component values / value classes are of the following type, for example: value = [EMAIL PROTECTED] value class = org.apache.myfaces.renderkit.RendererUtils$1 Do you know how this can be prevented? Regards, Matthias -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Auftrag von Martin Marinschek Gesendet: Freitag, 10. Februar 2006 11:27 An: MyFaces Discussion Betreff: Re: AW: Problem with evaluation of Tomahawk HtmlSelectOneRadio components inside UIData (programmatically created UI) It's never too late to start ;) hint-hint ;) regards, Martin On 2/10/06, Matthias Kahlau [EMAIL PROTECTED] wrote: Wo-ow. interesting solution. I still think writing that patch for MyFaces would have been the faster way of getting this to run ;) Maybe for you, but not for me, who has never written a patch or extended a component or renderer ... Regards, Matthias -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Auftrag von Martin Marinschek Gesendet: Freitag, 10. Februar 2006 10:12 An: MyFaces Discussion Betreff: Re: AW: Problem with evaluation of Tomahawk HtmlSelectOneRadio components inside UIData (programmatically created UI) Wo-ow. interesting solution. I still think writing that patch for MyFaces would have been the faster way of getting this to run ;) regards, Martin On 2/9/06, Matthias Kahlau [EMAIL PROTECTED] wrote: Hi Volker, many thanks, it works now. I already tested it with the HtmlSelectOneRadio components outside of UIData, but I got runtime errors because they hadn't been found for the related HtmlRadio components. That's why I added them as children to UIData, what solved the error, but the evaluation didn't work. Using the HtmlSelectOneRadio components outside of UIData and specifying absolute IDs in the for attribute did the trick... Now I can use a table with table headers for each column, what hadn't been possible with HtmlPanelGrid. Regards, Matthias -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Auftrag von Volker Weber Gesendet: Donnerstag, 9. Februar 2006 11:18 An: MyFaces Discussion Betreff: Re: AW: Problem with evaluation of Tomahawk HtmlSelectOneRadio components inside UIData (programmatically created UI) Hi Matthias, just an idea, may work or not, but worth a try imho: put the HtmlSelectOneRadio component(s) somewhere out of the uidata (e.g. as child of viewRoot) and set a id, also set a id to all parent namingcontainers. in the for attribute of the HtmlRadio components use a absolute id (e.g. :[id_of_viewRoot]:[id_of_HtmlSelectOneRadio], if HtmlSelectOneRadio is on top level). Not sure if this will work, but after a short look into HtmlRadioRenderer.java and implementation of findComponent() i think this could work. Regards, Volker Matthias Kahlau wrote: For UIData, not a thousand components represent thousand rows, but only one. But I didn't use only one HtmlSelectOneRadio component for all rows. Instead, I use many HtmlSelectOneRadio components, one component for one row. Using one HtmlSelectOneRadio component for all
outputLink modifies the specified value
Hi! I use the following outputLink: h:outputLink value=#{UmfrManUmfrTabBacking.accessControllerNonPortalURL}#{row.id} title=Kopieren und weitergeben fuer die Teilnahme h:outputText value=Teilnahme styleClass=standardLink / /h:outputLink The JSF EL expressions in the value attribute of the outputLink evaluate to the following URL parts: #{UmfrManUmfrTabBacking.accessControllerNonPortalURL} = http://localhost:/login_nonPortal?surveyId= #{row.id} = 38 login_nonPortal is a URL pattern used for a Servlet. servlet-mapping servlet-nameAccessControllerNonPortal/servlet-name url-pattern/login_nonPortal/url-pattern /servlet-mapping When the URL is displayed, the following URL is generated by JSF for the outputLink: http://localhost:/Umfragesystem/faces/Management/38 /Umfragesystem is the context path of the web application, /Management is the path to the current JSF page. Do you know why JSF modifies my outputLink value and how this can be prevented? Regards, Matthias
AW: AW: AW: Problem with evaluation of Tomahawk HtmlSelectOneRadio components inside UIData (programmatically created UI)
Hi Volker! Thanks for your support. I'm not sure, but maybe you should try throwing a javax.faces.validator.ValidatorException in your validation method when your validation fails. I don't use a validation method. I use required=true, and when nothing is entered, a standard validation error occurs displaying the same view again. My tree structure depends on the survey that is shown to the user. In my example where the error occurred, there have been two data tables with some rows of radio buttons and other components for other question types, e. g. 2 HtmlSelectOneMenu, 4 HtmlSelectManyCheckbox, some HtmlInputText and HtmlInputTextarea. The components are all children of the one form used in the view. All works fine, except when a validation error had occured, so please try with a standard validation error. Regards, Matthias -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Auftrag von Volker Weber Gesendet: Sonntag, 12. Februar 2006 23:46 An: MyFaces Discussion Betreff: Re: AW: AW: Problem with evaluation of Tomahawk HtmlSelectOneRadio components inside UIData (programmatically created UI) Hi Matthias, i created a small test page (see attached files), but i can't reproduce your problem. All works as expected, also when validation fails. Please provide more info about what you are doing and your tree structure. Regards, Volker Matthias Kahlau wrote: There's a use case where I encounter a problem with my solution. When a validation error occurs in the process validations phase, all the radio buttons shown in the HtmlDataTable aren't rendered when the page is redisplayed. Why I try to evaluate the HtmlSelectOneRadio components in this view state, I get a runtime error because the components aren't fully initialized. The component values / value classes are of the following type, for example: value = [EMAIL PROTECTED] value class = org.apache.myfaces.renderkit.RendererUtils$1 Is it possible to solve this problem, or is this a dead end? Regards, Matthias -- Don't answer to From: address! Mail to this account are droped if not recieved via mailinglist. To contact me direct create the mail address by concatenating my forename to my senders domain.
AW: AW: AW: AW: Problem with evaluation of Tomahawk HtmlSelectOneRadio components inside UIData (programmatically created UI)
Hi! You're using JSP. I don't know if this makes a difference. What else should I describe? Regards, Matthias -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Auftrag von Volker Weber Gesendet: Montag, 13. Februar 2006 00:44 An: MyFaces Discussion Betreff: Re: AW: AW: AW: Problem with evaluation of Tomahawk HtmlSelectOneRadio components inside UIData (programmatically created UI) Volker Weber wrote: Hi, Matthias Kahlau wrote: Hi Volker! Thanks for your support. I'm not sure, but maybe you should try throwing a javax.faces.validator.ValidatorException in your validation method when your validation fails. I don't use a validation method. I use required=true, and when nothing is entered, a standard validation error occurs displaying the same view again. same with required=true instead of validation method here. I would say all works as expected when required=true My tree structure depends on the survey that is shown to the user. In my example where the error occurred, there have been two data tables with some rows of radio buttons and other components for other question types, e. g. 2 HtmlSelectOneMenu, 4 HtmlSelectManyCheckbox, some HtmlInputText and HtmlInputTextarea. The components are all children of the one form used in the view. All works fine, except when a validation error had occured, so please try with a standard validation error. Regards, Matthias -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Auftrag von Volker Weber Gesendet: Sonntag, 12. Februar 2006 23:46 An: MyFaces Discussion Betreff: Re: AW: AW: Problem with evaluation of Tomahawk HtmlSelectOneRadio components inside UIData (programmatically created UI) Hi Matthias, i created a small test page (see attached files), but i can't reproduce your problem. All works as expected, also when validation fails. Please provide more info about what you are doing and your tree structure. Regards, Volker Matthias Kahlau wrote: There's a use case where I encounter a problem with my solution. When a validation error occurs in the process validations phase, all the radio buttons shown in the HtmlDataTable aren't rendered when the page is redisplayed. Why I try to evaluate the HtmlSelectOneRadio components in this view state, I get a runtime error because the components aren't fully initialized. The component values / value classes are of the following type, for example: value = [EMAIL PROTECTED] value class = org.apache.myfaces.renderkit.RendererUtils$1 Is it possible to solve this problem, or is this a dead end? Regards, Matthias -- Don't answer to From: address! Mail to this account are droped if not recieved via mailinglist. To contact me direct create the mail address by concatenating my forename to my senders domain. -- Don't answer to From: address! Mail to this account are droped if not recieved via mailinglist. To contact me direct create the mail address by concatenating my forename to my senders domain.
AW: AW: AW: AW: Problem with evaluation of Tomahawk HtmlSelectOneRadio components inside UIData (programmatically created UI)
Hallo Herr Prof. Dr. Schiefer, same with required=true instead of validation method here. I would say all works as expected when required=true BTW: I use required=true in an inpuText, not with the HtmlSelectOneRadios... Matthias -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Auftrag von Volker Weber Gesendet: Montag, 13. Februar 2006 00:44 An: MyFaces Discussion Betreff: Re: AW: AW: AW: Problem with evaluation of Tomahawk HtmlSelectOneRadio components inside UIData (programmatically created UI) Volker Weber wrote: Hi, Matthias Kahlau wrote: Hi Volker! Thanks for your support. I'm not sure, but maybe you should try throwing a javax.faces.validator.ValidatorException in your validation method when your validation fails. I don't use a validation method. I use required=true, and when nothing is entered, a standard validation error occurs displaying the same view again. same with required=true instead of validation method here. I would say all works as expected when required=true My tree structure depends on the survey that is shown to the user. In my example where the error occurred, there have been two data tables with some rows of radio buttons and other components for other question types, e. g. 2 HtmlSelectOneMenu, 4 HtmlSelectManyCheckbox, some HtmlInputText and HtmlInputTextarea. The components are all children of the one form used in the view. All works fine, except when a validation error had occured, so please try with a standard validation error. Regards, Matthias -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Auftrag von Volker Weber Gesendet: Sonntag, 12. Februar 2006 23:46 An: MyFaces Discussion Betreff: Re: AW: AW: Problem with evaluation of Tomahawk HtmlSelectOneRadio components inside UIData (programmatically created UI) Hi Matthias, i created a small test page (see attached files), but i can't reproduce your problem. All works as expected, also when validation fails. Please provide more info about what you are doing and your tree structure. Regards, Volker Matthias Kahlau wrote: There's a use case where I encounter a problem with my solution. When a validation error occurs in the process validations phase, all the radio buttons shown in the HtmlDataTable aren't rendered when the page is redisplayed. Why I try to evaluate the HtmlSelectOneRadio components in this view state, I get a runtime error because the components aren't fully initialized. The component values / value classes are of the following type, for example: value = [EMAIL PROTECTED] value class = org.apache.myfaces.renderkit.RendererUtils$1 Is it possible to solve this problem, or is this a dead end? Regards, Matthias -- Don't answer to From: address! Mail to this account are droped if not recieved via mailinglist. To contact me direct create the mail address by concatenating my forename to my senders domain. -- Don't answer to From: address! Mail to this account are droped if not recieved via mailinglist. To contact me direct create the mail address by concatenating my forename to my senders domain.
AW: AW: AW: AW: Problem with evaluation of Tomahawk HtmlSelectOneRadio components inside UIData (programmatically created UI)
von Martin Marinschek Gesendet: Mittwoch, 8. Februar 2006 23:05 the findComponent will deliver a component which is not properly initialized (it will return the stamp, but not the actual initialized component for this row...) So what you're really looking for is the functionality I implemented a few weeks ago for findComponent, to return a properly initialized component for this row. This sounds a bit like the problem I encounter, but I have no problem when I explicitely use the findComponent() method. The problem occurs when JSF processes the request when a validation error occurs. Regards, Matthias -Ursprüngliche Nachricht- Von: Matthias Kahlau [mailto:[EMAIL PROTECTED] Gesendet: Montag, 13. Februar 2006 01:08 An: MyFaces Discussion Betreff: AW: AW: AW: AW: Problem with evaluation of Tomahawk HtmlSelectOneRadio components inside UIData (programmatically created UI) Hallo Herr Prof. Dr. Schiefer, same with required=true instead of validation method here. I would say all works as expected when required=true BTW: I use required=true in an inpuText, not with the HtmlSelectOneRadios... Matthias -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Auftrag von Volker Weber Gesendet: Montag, 13. Februar 2006 00:44 An: MyFaces Discussion Betreff: Re: AW: AW: AW: Problem with evaluation of Tomahawk HtmlSelectOneRadio components inside UIData (programmatically created UI) Volker Weber wrote: Hi, Matthias Kahlau wrote: Hi Volker! Thanks for your support. I'm not sure, but maybe you should try throwing a javax.faces.validator.ValidatorException in your validation method when your validation fails. I don't use a validation method. I use required=true, and when nothing is entered, a standard validation error occurs displaying the same view again. same with required=true instead of validation method here. I would say all works as expected when required=true My tree structure depends on the survey that is shown to the user. In my example where the error occurred, there have been two data tables with some rows of radio buttons and other components for other question types, e. g. 2 HtmlSelectOneMenu, 4 HtmlSelectManyCheckbox, some HtmlInputText and HtmlInputTextarea. The components are all children of the one form used in the view. All works fine, except when a validation error had occured, so please try with a standard validation error. Regards, Matthias -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Auftrag von Volker Weber Gesendet: Sonntag, 12. Februar 2006 23:46 An: MyFaces Discussion Betreff: Re: AW: AW: Problem with evaluation of Tomahawk HtmlSelectOneRadio components inside UIData (programmatically created UI) Hi Matthias, i created a small test page (see attached files), but i can't reproduce your problem. All works as expected, also when validation fails. Please provide more info about what you are doing and your tree structure. Regards, Volker Matthias Kahlau wrote: There's a use case where I encounter a problem with my solution. When a validation error occurs in the process validations phase, all the radio buttons shown in the HtmlDataTable aren't rendered when the page is redisplayed. Why I try to evaluate the HtmlSelectOneRadio components in this view state, I get a runtime error because the components aren't fully initialized. The component values / value classes are of the following type, for example: value = [EMAIL PROTECTED] value class = org.apache.myfaces.renderkit.RendererUtils$1 Is it possible to solve this problem, or is this a dead end? Regards, Matthias -- Don't answer to From: address! Mail to this account are droped if not recieved via mailinglist. To contact me direct create the mail address by concatenating my forename to my senders domain. -- Don't answer to From: address! Mail to this account are droped if not recieved via mailinglist. To contact me direct create the mail address by concatenating my forename to my senders domain.
AW: AW: Problem with evaluation of Tomahawk HtmlSelectOneRadio components inside UIData (programmatically created UI)
Wo-ow. interesting solution. I still think writing that patch for MyFaces would have been the faster way of getting this to run ;) Maybe for you, but not for me, who has never written a patch or extended a component or renderer ... Regards, Matthias -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Auftrag von Martin Marinschek Gesendet: Freitag, 10. Februar 2006 10:12 An: MyFaces Discussion Betreff: Re: AW: Problem with evaluation of Tomahawk HtmlSelectOneRadio components inside UIData (programmatically created UI) Wo-ow. interesting solution. I still think writing that patch for MyFaces would have been the faster way of getting this to run ;) regards, Martin On 2/9/06, Matthias Kahlau [EMAIL PROTECTED] wrote: Hi Volker, many thanks, it works now. I already tested it with the HtmlSelectOneRadio components outside of UIData, but I got runtime errors because they hadn't been found for the related HtmlRadio components. That's why I added them as children to UIData, what solved the error, but the evaluation didn't work. Using the HtmlSelectOneRadio components outside of UIData and specifying absolute IDs in the for attribute did the trick... Now I can use a table with table headers for each column, what hadn't been possible with HtmlPanelGrid. Regards, Matthias -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Auftrag von Volker Weber Gesendet: Donnerstag, 9. Februar 2006 11:18 An: MyFaces Discussion Betreff: Re: AW: Problem with evaluation of Tomahawk HtmlSelectOneRadio components inside UIData (programmatically created UI) Hi Matthias, just an idea, may work or not, but worth a try imho: put the HtmlSelectOneRadio component(s) somewhere out of the uidata (e.g. as child of viewRoot) and set a id, also set a id to all parent namingcontainers. in the for attribute of the HtmlRadio components use a absolute id (e.g. :[id_of_viewRoot]:[id_of_HtmlSelectOneRadio], if HtmlSelectOneRadio is on top level). Not sure if this will work, but after a short look into HtmlRadioRenderer.java and implementation of findComponent() i think this could work. Regards, Volker Matthias Kahlau wrote: For UIData, not a thousand components represent thousand rows, but only one. But I didn't use only one HtmlSelectOneRadio component for all rows. Instead, I use many HtmlSelectOneRadio components, one component for one row. Using one HtmlSelectOneRadio component for all rows had only been a potential solution. Your explanation kills this idea for the moment, but I think it doesn't explain why my current solution doesn't work... Regards, Matthias -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Auftrag von Martin Marinschek Gesendet: Mittwoch, 8. Februar 2006 23:24 An: Matthias Kahlau Cc: MyFaces Discussion Betreff: Re: Problem with evaluation of Tomahawk HtmlSelectOneRadio components inside UIData (programmatically created UI) Yes, it has somehting to do with UIData. For UIData, not a thousand components represent thousand rows, but only one. Much like in Swing... So it's a little different there... regards, Martin On 2/8/06, Matthias Kahlau [EMAIL PROTECTED] wrote: Thanks Martin, but do you know, why I might get components that aren't properly initialized? I wonder about that, because processing the user input after locating the components by using findComponent works for all the other question types I use (without UIData), e. g. by using - only one HtmlSelectOneRadio component and some HtmlRadio components, - only one HtmlSelectManyCheckbox component and some HtmlCheckbox components, - only one HtmlInputText or HtmlInputTextarea Has this sth. to do with UIData? Regards, Matthias -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Auftrag von Martin Marinschek Gesendet: Mittwoch, 8. Februar 2006 23:05 An: MyFaces Discussion Betreff: Re: Problem with evaluation of Tomahawk HtmlSelectOneRadio components inside UIData (programmatically created UI) Ok, I do think I know now what your problem is: the findComponent will deliver a component which is not properly initialized (it will return the stamp, but not the actual initialized component for this row...) So what you're really looking for is the functionality I implemented a few weeks ago for findComponent, to return a properly initialized component for this row. But: I can't help you out with fixing this in the radio-renderer right now, sorry. And you're
AW: AW: Programmatically created UI does not contain important HTML elements
Hi! Is there any configuration option available which can be used to modify the rendered output when the UI is programmatically build (without using JSP)? Without any modification, the basic HTML elements html, head, title, body are not rendered, only the components. Is use JTTidy, which requires that the HTML documents are complete, as someone told me. In any case, I have the requirement to render complete HTML documents. Regards, Matthias -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Auftrag von Matthias Kahlau Gesendet: Montag, 6. Februar 2006 15:38 An: MyFaces Discussion Betreff: AW: AW: Programmatically created UI does not contain important HTML elements Currently i am also evaluating JTidyServlet, but currently i do not have that special case. Guess that if your html is prepared to be xml-conform, not having a html element is of no interest to JTidy. I am interested in your findings so please keep us updated. BTW What's your current JTidy config esp. the config parameters? - My current JTidy config is : I do not use JTidy myself. It's used as part of UPortal, which is the target framework my application should run under. I've no further information about the configuration of JTidy. In a few days/weeks, I will have to try my application running under UPortal in the institution I'm working for, and my application has to be prepared... Regards, Matthias -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Auftrag von lij Gesendet: Montag, 6. Februar 2006 13:09 An: MyFaces Discussion Betreff: Re: AW: Programmatically created UI does not contain important HTML elements Currently i am also evaluating JTidyServlet, but currently i do not have that special case. Guess that if your html is prepared to be xml-conform, not having a html element is of no interest to JTidy. I am interested in your findings so please keep us updated. BTW What's your current JTidy config esp. the config parameters? - My current JTidy config is : filter filter-nameJTidyFilter/filter-name filter-class org.w3c.tidy.servlet.filter.JTidyFilter /filter-class init-param param-nametee/param-name param-valuefalse/param-value /init-param init-param param-nameconfig/param-name param-value tab-size=4;wrap:5000;output-xhtml:true; /param-value /init-param init-param param-namedoubleValidation/param-name param-valuefalse/param-value /init-param init-param param-namevalidateOnly/param-name param-valuefalse/param-value /init-param init-param param-namedoubleValidation/param-name param-valuefalse/param-value /init-param /filter Matthias Kahlau wrote: AFAIK most browsers do wrap content with HTML tags in case content does not self set html...body. Guess you can inspect that by looking in the DOM inspector in Mozilla/Firefox after browsing to such special html-pages. In my special case, the rendered code has to go to the JTidy filter of UPortal, which transforms the HTML code to XHTML (AFAIK). I don't know if JTidy is capable to transform incomplete HTML pages... Regards, Matthias -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Auftrag von Jörg Liegler Gesendet: Montag, 6. Februar 2006 01:05 An: 'MyFaces Discussion' Betreff: AW: Programmatically created UI does not contain important HTML elements AFAIK most browsers do wrap content with HTML tags in case content does not self set html...body. Guess you can inspect that by looking in the DOM inspector in Mozilla/Firefox after browsing to such special html-pages. Jörg -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Gesendet: Sonntag, 5. Februar 2006 16:48 An: Users MyFaces Betreff: Programmatically created UI does not contain important HTML elements Hi! I examined the HTML source code of my programmatically build view and noticed, that no HTML elements like html or head are rendered, but I wonder because the page is rendered correctly in MS IE. Do I have to manually add the missing elements, e. g. with the ResponseWriter? (I need valid HTML...) Regards, Matthias
AW: AW: Problem with evaluation of Tomahawk HtmlSelectOneRadio components inside UIData (programmatically created UI)
Hi! There's a use case where I encounter a problem with my solution. When a validation error occurs in the process validations phase, all the radio buttons shown in the HtmlDataTable aren't rendered when the page is redisplayed. Why I try to evaluate the HtmlSelectOneRadio components in this view state, I get a runtime error because the components aren't fully initialized. The component values / value classes are of the following type, for example: value = [EMAIL PROTECTED] value class = org.apache.myfaces.renderkit.RendererUtils$1 Do you know how this can be prevented? Regards, Matthias -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Auftrag von Martin Marinschek Gesendet: Freitag, 10. Februar 2006 11:27 An: MyFaces Discussion Betreff: Re: AW: Problem with evaluation of Tomahawk HtmlSelectOneRadio components inside UIData (programmatically created UI) It's never too late to start ;) hint-hint ;) regards, Martin On 2/10/06, Matthias Kahlau [EMAIL PROTECTED] wrote: Wo-ow. interesting solution. I still think writing that patch for MyFaces would have been the faster way of getting this to run ;) Maybe for you, but not for me, who has never written a patch or extended a component or renderer ... Regards, Matthias -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Auftrag von Martin Marinschek Gesendet: Freitag, 10. Februar 2006 10:12 An: MyFaces Discussion Betreff: Re: AW: Problem with evaluation of Tomahawk HtmlSelectOneRadio components inside UIData (programmatically created UI) Wo-ow. interesting solution. I still think writing that patch for MyFaces would have been the faster way of getting this to run ;) regards, Martin On 2/9/06, Matthias Kahlau [EMAIL PROTECTED] wrote: Hi Volker, many thanks, it works now. I already tested it with the HtmlSelectOneRadio components outside of UIData, but I got runtime errors because they hadn't been found for the related HtmlRadio components. That's why I added them as children to UIData, what solved the error, but the evaluation didn't work. Using the HtmlSelectOneRadio components outside of UIData and specifying absolute IDs in the for attribute did the trick... Now I can use a table with table headers for each column, what hadn't been possible with HtmlPanelGrid. Regards, Matthias -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Auftrag von Volker Weber Gesendet: Donnerstag, 9. Februar 2006 11:18 An: MyFaces Discussion Betreff: Re: AW: Problem with evaluation of Tomahawk HtmlSelectOneRadio components inside UIData (programmatically created UI) Hi Matthias, just an idea, may work or not, but worth a try imho: put the HtmlSelectOneRadio component(s) somewhere out of the uidata (e.g. as child of viewRoot) and set a id, also set a id to all parent namingcontainers. in the for attribute of the HtmlRadio components use a absolute id (e.g. :[id_of_viewRoot]:[id_of_HtmlSelectOneRadio], if HtmlSelectOneRadio is on top level). Not sure if this will work, but after a short look into HtmlRadioRenderer.java and implementation of findComponent() i think this could work. Regards, Volker Matthias Kahlau wrote: For UIData, not a thousand components represent thousand rows, but only one. But I didn't use only one HtmlSelectOneRadio component for all rows. Instead, I use many HtmlSelectOneRadio components, one component for one row. Using one HtmlSelectOneRadio component for all rows had only been a potential solution. Your explanation kills this idea for the moment, but I think it doesn't explain why my current solution doesn't work... Regards, Matthias -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Auftrag von Martin Marinschek Gesendet: Mittwoch, 8. Februar 2006 23:24 An: Matthias Kahlau Cc: MyFaces Discussion Betreff: Re: Problem with evaluation of Tomahawk HtmlSelectOneRadio components inside UIData (programmatically created UI) Yes, it has somehting to do with UIData. For UIData, not a thousand components represent thousand rows, but only one. Much like in Swing... So it's a little different there... regards, Martin On 2/8/06, Matthias Kahlau [EMAIL PROTECTED] wrote: Thanks Martin, but do you know, why I might get components that aren't properly initialized? I wonder about that, because processing
convertDateTime problem - shows wrong format
Hi! My convertDateTime component shows the wrong format when I use the English language Locale. The German language Locale format looks correct. f:convertDateTime dateStyle=short type=date / - German Locale: 25.01.2006 - English Locale: Jan 25, 2006 (- looks like medium format) Do you have an idea how to solve this? Regards, Matthias
AW: convertDateTime problem - shows wrong format
It's no longer a problem... -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Auftrag von Matthias Kahlau Gesendet: Samstag, 11. Februar 2006 00:53 An: Users MyFaces Betreff: convertDateTime problem - shows wrong format Hi! My convertDateTime component shows the wrong format when I use the English language Locale. The German language Locale format looks correct. f:convertDateTime dateStyle=short type=date / - German Locale: 25.01.2006 - English Locale: Jan 25, 2006 (- looks like medium format) Do you have an idea how to solve this? Regards, Matthias
AW: AW: Problem with evaluation of Tomahawk HtmlSelectOneRadio components inside UIData (programmatically created UI)
Hi Volker, many thanks, it works now. I already tested it with the HtmlSelectOneRadio components outside of UIData, but I got runtime errors because they hadn't been found for the related HtmlRadio components. That's why I added them as children to UIData, what solved the error, but the evaluation didn't work. Using the HtmlSelectOneRadio components outside of UIData and specifying absolute IDs in the for attribute did the trick... Now I can use a table with table headers for each column, what hadn't been possible with HtmlPanelGrid. Regards, Matthias -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Auftrag von Volker Weber Gesendet: Donnerstag, 9. Februar 2006 11:18 An: MyFaces Discussion Betreff: Re: AW: Problem with evaluation of Tomahawk HtmlSelectOneRadio components inside UIData (programmatically created UI) Hi Matthias, just an idea, may work or not, but worth a try imho: put the HtmlSelectOneRadio component(s) somewhere out of the uidata (e.g. as child of viewRoot) and set a id, also set a id to all parent namingcontainers. in the for attribute of the HtmlRadio components use a absolute id (e.g. :[id_of_viewRoot]:[id_of_HtmlSelectOneRadio], if HtmlSelectOneRadio is on top level). Not sure if this will work, but after a short look into HtmlRadioRenderer.java and implementation of findComponent() i think this could work. Regards, Volker Matthias Kahlau wrote: For UIData, not a thousand components represent thousand rows, but only one. But I didn't use only one HtmlSelectOneRadio component for all rows. Instead, I use many HtmlSelectOneRadio components, one component for one row. Using one HtmlSelectOneRadio component for all rows had only been a potential solution. Your explanation kills this idea for the moment, but I think it doesn't explain why my current solution doesn't work... Regards, Matthias -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Auftrag von Martin Marinschek Gesendet: Mittwoch, 8. Februar 2006 23:24 An: Matthias Kahlau Cc: MyFaces Discussion Betreff: Re: Problem with evaluation of Tomahawk HtmlSelectOneRadio components inside UIData (programmatically created UI) Yes, it has somehting to do with UIData. For UIData, not a thousand components represent thousand rows, but only one. Much like in Swing... So it's a little different there... regards, Martin On 2/8/06, Matthias Kahlau [EMAIL PROTECTED] wrote: Thanks Martin, but do you know, why I might get components that aren't properly initialized? I wonder about that, because processing the user input after locating the components by using findComponent works for all the other question types I use (without UIData), e. g. by using - only one HtmlSelectOneRadio component and some HtmlRadio components, - only one HtmlSelectManyCheckbox component and some HtmlCheckbox components, - only one HtmlInputText or HtmlInputTextarea Has this sth. to do with UIData? Regards, Matthias -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Auftrag von Martin Marinschek Gesendet: Mittwoch, 8. Februar 2006 23:05 An: MyFaces Discussion Betreff: Re: Problem with evaluation of Tomahawk HtmlSelectOneRadio components inside UIData (programmatically created UI) Ok, I do think I know now what your problem is: the findComponent will deliver a component which is not properly initialized (it will return the stamp, but not the actual initialized component for this row...) So what you're really looking for is the functionality I implemented a few weeks ago for findComponent, to return a properly initialized component for this row. But: I can't help you out with fixing this in the radio-renderer right now, sorry. And you're in stress, too, to get your thesis finished, right? So I really don't know how to fix this. no clue. Anyone else able to help? regards, Martin On 2/8/06, Matthias Kahlau [EMAIL PROTECTED] wrote: Hi Martin! If you can't imagine the cause of the problem, maybe you can give me a hint to a workable solution using HtmlDataTable ... Regards, Matthias -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Auftrag von Matthias Kahlau Gesendet: Mittwoch, 8. Februar 2006 20:45 An: MyFaces Discussion; [EMAIL PROTECTED] Betreff: AW: Problem with evaluation of Tomahawk HtmlSelectOneRadio components inside UIData (programmatically created UI) I didn't use JSP, the UI is programmatically created. This is a part of the method which adds HtmlSelectOneRadio components to the HtmlDataTable: HtmlDataTable table = new HtmlDataTable(); this.form.getChildren().add(table); table.setId(this.viewRoot.createUniqueId()); table.setVar(row); table.setBorder(1
AW: HtmSelectOneRadio setting style per component
Sun implementations generates a span tag with style information surrounding all the input elements That's what I need, too (and also for HtmlSelectManyCheckbox), but I think that's only possible when not using spread layout. Maybe rendering a span element around each input element would be an alternative. Regards, Matthias -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Auftrag von Tonio Caputo Gesendet: Donnerstag, 9. Februar 2006 20:56 An: MyFaces-Users-List Betreff: HtmSelectOneRadio setting style per component Hi, I'm trying to make my application implemented and tested with sun reference implementation run with myfaces- 1.1.1 After some basic problems all seems to work ok. There is only a difference: HtmlSelectOneRadio Style renderer I'm setting the style of the component with the HtmlSelectOneRadio.setStyle() method, what happens: * Sun implementations generates a span tag with style information surrounding all the input elements * My faces is setting the style attribute of every component to the style information. I'm using XY Layout, so imagine that instead of positioning all elements in a box, all Radio Buttons with the size of all elements. My question: Is this a correct difference between implementations, or shoul one of them change the way it is rendered. The solution I suppose is putting this components inside a HtmlPanelGrid. Thanks in advance tonio.
Tomahawk TLD - Why always rtexprvaluefalse/rtexprvalue?
Hi! I've a question related to the TLD of Tomahawk. Why are all attributes declared with rtexprvaluefalse/rtexprvalue, although some can be dynamically calculated at runtime by an EL expression? Sometimes I need to know if a specific attribute accepts a JSF EL expression, but how can I know that? Is there another information source available? Regards, Matthias
Problem with evaluation of Tomahawk HtmlSelectOneRadio components inside UIData (programmatically created UI)
Hi! I tried to use a Tomahawk HtmlDataTable to programmatically display a matrix containing questions in the left column and some radiobuttons in the other columns. I added a HtmlRadio component to each HtmlSimpleColumn instance. For each row, I added a HtmlSelectOneRadio component to the table. The HtmlRadio components for attribute uses a value-binding to the current row object of the data set, to get the ID of the related HtmlSelectOneRadio component. I don't know if I've followed the right approach. The table is displayed correctly, but the evaluation of the selected radiobuttons doesn't work. It doesn't matter was has been selected, I always get value=1 for each HtmlSelectOneRadio component. Maybe this is the wrong approach. Do I have to use only one HtmlSelectOneRadio component with a component binding, and process the selections by iterating over the UIData's data set, like it is done when using JSP? Following a Html code snippet of the data table: table border=1 cellpadding=5 cellspacing=0 theadtrth width=150/ththerste Am/ththzweite Am/ththdritte Am/ththvierte Am/th/tr/thead tbody id=Form:_id15:tbody_element tr td width=150erste Teilfrage/td tdlabel input type=radio name=Form:_id15_0:Frage_6_Teil_1 checked=checked value=1 / /label/td tdlabel input type=radio name=Form:_id15_0:Frage_6_Teil_1 value=2 / /label/td tdlabel input type=radio name=Form:_id15_0:Frage_6_Teil_1 value=3 / /label/td tdlabel input type=radio name=Form:_id15_0:Frage_6_Teil_1 value=4 / /label/td /tr tr td width=150zweite Teilfrage/td tdlabel input type=radio name=Form:_id15_1:Frage_6_Teil_2 checked=checked value=1 / /label/td tdlabel input type=radio name=Form:_id15_1:Frage_6_Teil_2 value=2 / /label/td tdlabel input type=radio name=Form:_id15_1:Frage_6_Teil_2 value=3 / /label/td tdlabel input type=radio name=Form:_id15_1:Frage_6_Teil_2 value=4 //label/td /tr /tbody /table Regards, Matthias
AW: Tomahawk TLD - Why always rtexprvaluefalse/rtexprvalue?
rtexprvalue is meant for JSP-expressions, and not JSF expressions - and you cannot use JSP-expressions in tag-attributes. You can use JSF-EL in all attributes except ids, I believe. Correct me if I'm wrong. Thanks. That sounds good... If you're wrong, it would really be of help if there would be a way to recognize the rules... Regards, Matthias -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Auftrag von Martin Marinschek Gesendet: Mittwoch, 8. Februar 2006 17:34 An: MyFaces Discussion Betreff: Re: Tomahawk TLD - Why always rtexprvaluefalse/rtexprvalue? rtexprvalue is meant for JSP-expressions, and not JSF expressions - and you cannot use JSP-expressions in tag-attributes. You can use JSF-EL in all attributes except ids, I believe. Correct me if I'm wrong. regards, Martin On 2/8/06, Matthias Kahlau [EMAIL PROTECTED] wrote: Hi! I've a question related to the TLD of Tomahawk. Why are all attributes declared with rtexprvaluefalse/rtexprvalue, although some can be dynamically calculated at runtime by an EL expression? Sometimes I need to know if a specific attribute accepts a JSF EL expression, but how can I know that? Is there another information source available? Regards, Matthias -- http://www.irian.at Your JSF powerhouse - JSF Consulting, Development and Courses in English and German Professional Support for Apache MyFaces
AW: Problem with evaluation of Tomahawk HtmlSelectOneRadio components inside UIData (programmatically created UI)
I didn't use JSP, the UI is programmatically created. This is a part of the method which adds HtmlSelectOneRadio components to the HtmlDataTable: HtmlDataTable table = new HtmlDataTable(); this.form.getChildren().add(table); table.setId(this.viewRoot.createUniqueId()); table.setVar(row); table.setBorder(1); table.setCellspacing(0); table.setCellpadding(5); // the snippet which creates the HtmlSimpleUIColumn components for the table: for (int i = 0; i columns; i++) { column[i] = new HtmlSimpleColumn(); table.getChildren().add(column[i]); if (i == 0) { HtmlOutputText hot = new HtmlOutputText(); hot.setId(this.viewRoot.createUniqueId()); ValueBinding vb = app.createValueBinding(#{row.matrixfragetext}); hot.setValueBinding(value, vb); hot.setEscape(false); column[i].setWidth(150); column[i].getChildren().add(hot); } else { String text = ((Auswahlmoeglichkeit)sortedAm.get(i - 1)).getText(); HtmlOutputText header = this.createHtmlOutputText(text, null); column[i].setHeader(header); HtmlRadio radio = new HtmlRadio(); radio.setId(this.viewRoot.createUniqueId()); ValueBinding vb = app.createValueBinding(#{row.htmlSelectOneRadioId}); radio.setValueBinding(for, vb); radio.setIndex(i - 1); column[i].getChildren().add(radio); } } // the snippet which creates the HtmlSelectOneRadio components for each row of the table: List rowData = new ArrayList(); for (int i = 0; i matrixfragetexte.length; i++) { Matrixfragetext mft = (Matrixfragetext)matrixfragetexte[i]; HtmlSelectOneRadio radios = new HtmlSelectOneRadio(); // Tomahawk table.getChildren().add(radios); radios.setId(id); radios.setLayout(spread); radios.setRendererType(org.apache.myfaces.Radio); radios.setConverter(new IntegerConverter()); List selectItems = SelectItemsCreator.createSelectItemsListByAuswMglWithoutLabel(sorted Am); UISelectItems usi = new UISelectItems(); usi.setValue(selectItems); radios.getChildren().add(usi); radios.setValue(selected); // initially selected value MatrixfrageRow row = new MatrixfrageRow(); row.setMatrixfragetext(mft.getText()); row.setHtmlSelectOneRadioId(radios.getId()); rowData.add(row); } table.setValue(model); // contains the rowData ArrayList When processing the user input, the HtmlSelectOneRadio components are located by using the findComponent() method of the UIComponent class. This works well. Then the submitted or local value is evaluated (taking the one which is not null), and it's always the initially selected value, no matter what had been selected by the user. I hope you can imagine what's going wrong... Many thanks, Matthias -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Auftrag von Martin Marinschek Gesendet: Mittwoch, 8. Februar 2006 20:19 An: MyFaces Discussion Betreff: Re: Problem with evaluation of Tomahawk HtmlSelectOneRadio components inside UIData (programmatically created UI) Can you give us the JSP sources? regards, Martin On 2/8/06, Matthias Kahlau [EMAIL PROTECTED] wrote: Hi! I tried to use a Tomahawk HtmlDataTable to programmatically display a matrix containing questions in the left column and some radiobuttons in the other columns. I added a HtmlRadio component to each HtmlSimpleColumn instance. For each row, I added a HtmlSelectOneRadio component to the table. The HtmlRadio components for attribute uses a value-binding to the current row object of the data set, to get the ID of the related HtmlSelectOneRadio component. I don't know if I've followed the right approach. The table is displayed correctly, but the evaluation of the selected radiobuttons doesn't work. It doesn't matter was has been selected, I always get value=1 for each HtmlSelectOneRadio component. Maybe this is the wrong approach. Do I have to use only one HtmlSelectOneRadio component with a component binding, and process the selections by iterating over the UIData's data set, like it is done when using JSP? Following a Html code snippet of the data table: table border=1 cellpadding=5 cellspacing=0 theadtrth width=150/ththerste Am/ththzweite Am/ththdritte Am/ththvierte Am/th/tr/thead tbody id=Form:_id15:tbody_element tr td width=150erste Teilfrage/td tdlabel input type=radio name=Form:_id15_0:Frage_6_Teil_1 checked=checked value=1 / /label/td tdlabel input type=radio name=Form:_id15_0:Frage_6_Teil_1 value=2 / /label/td tdlabel input type=radio name=Form:_id15_0:Frage_6_Teil_1 value=3 / /label/td tdlabel input type=radio name=Form:_id15_0:Frage_6_Teil_1 value=4 / /label/td /tr tr td width=150zweite Teilfrage/td tdlabel input type=radio name=Form:_id15_1
Applying style to radio button / checkbox labels
Hi! I have to add some style to the text shown with a radio button or checkbox (using HtmlRadio or HtmlCheckbox), not to the controls themselves. A HtmlSelectOneRadio or HtmlSelectManyCheckbox has a styleClass attribute, but the settings do only apply to the controls themselves, not to the labels. My radio buttons are rendered as follows: tdlabelinput type=radio name=Form:Frage_7_2 value=4 class=surveyInputRadioCheck /#160;d/label/td - There is a label element around each radio button, which is rendered implicitely. Is it possible to set a style to that label elements? My checkboxes are rendered as follows: tdinput type=checkbox name=Form:Frage_7_4 id=Form:Frage_7_4 value=2 class=surveyInputRadioCheck /#160;zweite/td - Unfortunately, there's no label element around the checkbox elements (Why not?). The class surveyInputRadioCheck doesn't affect the text of the control... So how can I apply some style to the control's labels? I can't define a global style for td or label elements - that could inadvertently destroy other layouts... The most important style I have to apply is a margin or padding to add space between multiple columns of radiobuttons or checkboxes. That would improve the usability of the UI... Regards, Matthias
AW: Problem with evaluation of Tomahawk HtmlSelectOneRadio components inside UIData (programmatically created UI)
Hi Martin! If you can't imagine the cause of the problem, maybe you can give me a hint to a workable solution using HtmlDataTable ... Regards, Matthias -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Auftrag von Matthias Kahlau Gesendet: Mittwoch, 8. Februar 2006 20:45 An: MyFaces Discussion; [EMAIL PROTECTED] Betreff: AW: Problem with evaluation of Tomahawk HtmlSelectOneRadio components inside UIData (programmatically created UI) I didn't use JSP, the UI is programmatically created. This is a part of the method which adds HtmlSelectOneRadio components to the HtmlDataTable: HtmlDataTable table = new HtmlDataTable(); this.form.getChildren().add(table); table.setId(this.viewRoot.createUniqueId()); table.setVar(row); table.setBorder(1); table.setCellspacing(0); table.setCellpadding(5); // the snippet which creates the HtmlSimpleUIColumn components for the table: for (int i = 0; i columns; i++) { column[i] = new HtmlSimpleColumn(); table.getChildren().add(column[i]); if (i == 0) { HtmlOutputText hot = new HtmlOutputText(); hot.setId(this.viewRoot.createUniqueId()); ValueBinding vb = app.createValueBinding(#{row.matrixfragetext}); hot.setValueBinding(value, vb); hot.setEscape(false); column[i].setWidth(150); column[i].getChildren().add(hot); } else { String text = ((Auswahlmoeglichkeit)sortedAm.get(i - 1)).getText(); HtmlOutputText header = this.createHtmlOutputText(text, null); column[i].setHeader(header); HtmlRadio radio = new HtmlRadio(); radio.setId(this.viewRoot.createUniqueId()); ValueBinding vb = app.createValueBinding(#{row.htmlSelectOneRadioId}); radio.setValueBinding(for, vb); radio.setIndex(i - 1); column[i].getChildren().add(radio); } } // the snippet which creates the HtmlSelectOneRadio components for each row of the table: List rowData = new ArrayList(); for (int i = 0; i matrixfragetexte.length; i++) { Matrixfragetext mft = (Matrixfragetext)matrixfragetexte[i]; HtmlSelectOneRadio radios = new HtmlSelectOneRadio(); // Tomahawk table.getChildren().add(radios); radios.setId(id); radios.setLayout(spread); radios.setRendererType(org.apache.myfaces.Radio); radios.setConverter(new IntegerConverter()); List selectItems = SelectItemsCreator.createSelectItemsListByAuswMglWithoutLabel(sorted Am); UISelectItems usi = new UISelectItems(); usi.setValue(selectItems); radios.getChildren().add(usi); radios.setValue(selected); // initially selected value MatrixfrageRow row = new MatrixfrageRow(); row.setMatrixfragetext(mft.getText()); row.setHtmlSelectOneRadioId(radios.getId()); rowData.add(row); } table.setValue(model); // contains the rowData ArrayList When processing the user input, the HtmlSelectOneRadio components are located by using the findComponent() method of the UIComponent class. This works well. Then the submitted or local value is evaluated (taking the one which is not null), and it's always the initially selected value, no matter what had been selected by the user. I hope you can imagine what's going wrong... Many thanks, Matthias -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Auftrag von Martin Marinschek Gesendet: Mittwoch, 8. Februar 2006 20:19 An: MyFaces Discussion Betreff: Re: Problem with evaluation of Tomahawk HtmlSelectOneRadio components inside UIData (programmatically created UI) Can you give us the JSP sources? regards, Martin On 2/8/06, Matthias Kahlau [EMAIL PROTECTED] wrote: Hi! I tried to use a Tomahawk HtmlDataTable to programmatically display a matrix containing questions in the left column and some radiobuttons in the other columns. I added a HtmlRadio component to each HtmlSimpleColumn instance. For each row, I added a HtmlSelectOneRadio component to the table. The HtmlRadio components for attribute uses a value-binding to the current row object of the data set, to get the ID of the related HtmlSelectOneRadio component. I don't know if I've followed the right approach. The table is displayed correctly, but the evaluation of the selected radiobuttons doesn't work. It doesn't matter was has been selected, I always get value=1 for each HtmlSelectOneRadio component. Maybe this is the wrong approach. Do I have to use only one HtmlSelectOneRadio component with a component binding, and process the selections by iterating over the UIData's data set, like it is done when using JSP? Following a Html code snippet of the data table: table border=1 cellpadding=5 cellspacing=0 theadtrth width=150
AW: Problem with evaluation of Tomahawk HtmlSelectOneRadio components inside UIData (programmatically created UI)
BTW: With JSP, I only had a selectBooleanCheckbox in a column of the dataTable. It had a component binding and I could access it after setting the rowIndex of UIData. In my current case, I need multiple radiobuttons (HtmlRadio components) in each row, aligned with the column headers. If I would use only one HtmlSelectOneRadio component for all rows, and access it by using UIData, what should I set the HtmlRadio components for attribute to? I have only one HtmlSelectOneRadio component. Can you imagine that it would work if the HtmlRadio components of all rows refer the same HtmlSelectOneRadio component? Regards, Matthias -Ursprüngliche Nachricht- Von: Matthias Kahlau [mailto:[EMAIL PROTECTED] Gesendet: Mittwoch, 8. Februar 2006 22:46 An: MyFaces Discussion Betreff: AW: Problem with evaluation of Tomahawk HtmlSelectOneRadio components inside UIData (programmatically created UI) Hi Martin! If you can't imagine the cause of the problem, maybe you can give me a hint to a workable solution using HtmlDataTable ... Regards, Matthias -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Auftrag von Matthias Kahlau Gesendet: Mittwoch, 8. Februar 2006 20:45 An: MyFaces Discussion; [EMAIL PROTECTED] Betreff: AW: Problem with evaluation of Tomahawk HtmlSelectOneRadio components inside UIData (programmatically created UI) I didn't use JSP, the UI is programmatically created. This is a part of the method which adds HtmlSelectOneRadio components to the HtmlDataTable: HtmlDataTable table = new HtmlDataTable(); this.form.getChildren().add(table); table.setId(this.viewRoot.createUniqueId()); table.setVar(row); table.setBorder(1); table.setCellspacing(0); table.setCellpadding(5); // the snippet which creates the HtmlSimpleUIColumn components for the table: for (int i = 0; i columns; i++) { column[i] = new HtmlSimpleColumn(); table.getChildren().add(column[i]); if (i == 0) { HtmlOutputText hot = new HtmlOutputText(); hot.setId(this.viewRoot.createUniqueId()); ValueBinding vb = app.createValueBinding(#{row.matrixfragetext}); hot.setValueBinding(value, vb); hot.setEscape(false); column[i].setWidth(150); column[i].getChildren().add(hot); } else { String text = ((Auswahlmoeglichkeit)sortedAm.get(i - 1)).getText(); HtmlOutputText header = this.createHtmlOutputText(text, null); column[i].setHeader(header); HtmlRadio radio = new HtmlRadio(); radio.setId(this.viewRoot.createUniqueId()); ValueBinding vb = app.createValueBinding(#{row.htmlSelectOneRadioId}); radio.setValueBinding(for, vb); radio.setIndex(i - 1); column[i].getChildren().add(radio); } } // the snippet which creates the HtmlSelectOneRadio components for each row of the table: List rowData = new ArrayList(); for (int i = 0; i matrixfragetexte.length; i++) { Matrixfragetext mft = (Matrixfragetext)matrixfragetexte[i]; HtmlSelectOneRadio radios = new HtmlSelectOneRadio(); // Tomahawk table.getChildren().add(radios); radios.setId(id); radios.setLayout(spread); radios.setRendererType(org.apache.myfaces.Radio); radios.setConverter(new IntegerConverter()); List selectItems = SelectItemsCreator.createSelectItemsListByAuswMglWithoutLabel(sorted Am); UISelectItems usi = new UISelectItems(); usi.setValue(selectItems); radios.getChildren().add(usi); radios.setValue(selected); // initially selected value MatrixfrageRow row = new MatrixfrageRow(); row.setMatrixfragetext(mft.getText()); row.setHtmlSelectOneRadioId(radios.getId()); rowData.add(row); } table.setValue(model); // contains the rowData ArrayList When processing the user input, the HtmlSelectOneRadio components are located by using the findComponent() method of the UIComponent class. This works well. Then the submitted or local value is evaluated (taking the one which is not null), and it's always the initially selected value, no matter what had been selected by the user. I hope you can imagine what's going wrong... Many thanks, Matthias -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Auftrag von Martin Marinschek Gesendet: Mittwoch, 8. Februar 2006 20:19 An: MyFaces Discussion Betreff: Re: Problem with evaluation of Tomahawk HtmlSelectOneRadio components inside UIData (programmatically created UI) Can you give us the JSP sources? regards, Martin On 2/8/06, Matthias Kahlau [EMAIL PROTECTED] wrote: Hi! I tried to use a Tomahawk HtmlDataTable to programmatically
AW: Problem with evaluation of Tomahawk HtmlSelectOneRadio components inside UIData (programmatically created UI)
Thanks Martin, but do you know, why I might get components that aren't properly initialized? I wonder about that, because processing the user input after locating the components by using findComponent works for all the other question types I use (without UIData), e. g. by using - only one HtmlSelectOneRadio component and some HtmlRadio components, - only one HtmlSelectManyCheckbox component and some HtmlCheckbox components, - only one HtmlInputText or HtmlInputTextarea Has this sth. to do with UIData? Regards, Matthias -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Auftrag von Martin Marinschek Gesendet: Mittwoch, 8. Februar 2006 23:05 An: MyFaces Discussion Betreff: Re: Problem with evaluation of Tomahawk HtmlSelectOneRadio components inside UIData (programmatically created UI) Ok, I do think I know now what your problem is: the findComponent will deliver a component which is not properly initialized (it will return the stamp, but not the actual initialized component for this row...) So what you're really looking for is the functionality I implemented a few weeks ago for findComponent, to return a properly initialized component for this row. But: I can't help you out with fixing this in the radio-renderer right now, sorry. And you're in stress, too, to get your thesis finished, right? So I really don't know how to fix this. no clue. Anyone else able to help? regards, Martin On 2/8/06, Matthias Kahlau [EMAIL PROTECTED] wrote: Hi Martin! If you can't imagine the cause of the problem, maybe you can give me a hint to a workable solution using HtmlDataTable ... Regards, Matthias -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Auftrag von Matthias Kahlau Gesendet: Mittwoch, 8. Februar 2006 20:45 An: MyFaces Discussion; [EMAIL PROTECTED] Betreff: AW: Problem with evaluation of Tomahawk HtmlSelectOneRadio components inside UIData (programmatically created UI) I didn't use JSP, the UI is programmatically created. This is a part of the method which adds HtmlSelectOneRadio components to the HtmlDataTable: HtmlDataTable table = new HtmlDataTable(); this.form.getChildren().add(table); table.setId(this.viewRoot.createUniqueId()); table.setVar(row); table.setBorder(1); table.setCellspacing(0); table.setCellpadding(5); // the snippet which creates the HtmlSimpleUIColumn components for the table: for (int i = 0; i columns; i++) { column[i] = new HtmlSimpleColumn(); table.getChildren().add(column[i]); if (i == 0) { HtmlOutputText hot = new HtmlOutputText(); hot.setId(this.viewRoot.createUniqueId()); ValueBinding vb = app.createValueBinding(#{row.matrixfragetext}); hot.setValueBinding(value, vb); hot.setEscape(false); column[i].setWidth(150); column[i].getChildren().add(hot); } else { String text = ((Auswahlmoeglichkeit)sortedAm.get(i - 1)).getText(); HtmlOutputText header = this.createHtmlOutputText(text, null); column[i].setHeader(header); HtmlRadio radio = new HtmlRadio(); radio.setId(this.viewRoot.createUniqueId()); ValueBinding vb = app.createValueBinding(#{row.htmlSelectOneRadioId}); radio.setValueBinding(for, vb); radio.setIndex(i - 1); column[i].getChildren().add(radio); } } // the snippet which creates the HtmlSelectOneRadio components for each row of the table: List rowData = new ArrayList(); for (int i = 0; i matrixfragetexte.length; i++) { Matrixfragetext mft = (Matrixfragetext)matrixfragetexte[i]; HtmlSelectOneRadio radios = new HtmlSelectOneRadio(); // Tomahawk table.getChildren().add(radios); radios.setId(id); radios.setLayout(spread); radios.setRendererType(org.apache.myfaces.Radio); radios.setConverter(new IntegerConverter()); List selectItems = SelectItemsCreator.createSelectItemsListByAuswMglWithoutLabel(sorted Am); UISelectItems usi = new UISelectItems(); usi.setValue(selectItems); radios.getChildren().add(usi); radios.setValue(selected); // initially selected value MatrixfrageRow row = new MatrixfrageRow(); row.setMatrixfragetext(mft.getText()); row.setHtmlSelectOneRadioId(radios.getId()); rowData.add(row); } table.setValue(model); // contains the rowData ArrayList When processing the user input, the HtmlSelectOneRadio components are located by using the findComponent() method of the UIComponent class. This works well. Then the submitted or local value is evaluated (taking the one which
AW: Problem with evaluation of Tomahawk HtmlSelectOneRadio components inside UIData (programmatically created UI)
For UIData, not a thousand components represent thousand rows, but only one. But I didn't use only one HtmlSelectOneRadio component for all rows. Instead, I use many HtmlSelectOneRadio components, one component for one row. Using one HtmlSelectOneRadio component for all rows had only been a potential solution. Your explanation kills this idea for the moment, but I think it doesn't explain why my current solution doesn't work... Regards, Matthias -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Auftrag von Martin Marinschek Gesendet: Mittwoch, 8. Februar 2006 23:24 An: Matthias Kahlau Cc: MyFaces Discussion Betreff: Re: Problem with evaluation of Tomahawk HtmlSelectOneRadio components inside UIData (programmatically created UI) Yes, it has somehting to do with UIData. For UIData, not a thousand components represent thousand rows, but only one. Much like in Swing... So it's a little different there... regards, Martin On 2/8/06, Matthias Kahlau [EMAIL PROTECTED] wrote: Thanks Martin, but do you know, why I might get components that aren't properly initialized? I wonder about that, because processing the user input after locating the components by using findComponent works for all the other question types I use (without UIData), e. g. by using - only one HtmlSelectOneRadio component and some HtmlRadio components, - only one HtmlSelectManyCheckbox component and some HtmlCheckbox components, - only one HtmlInputText or HtmlInputTextarea Has this sth. to do with UIData? Regards, Matthias -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Auftrag von Martin Marinschek Gesendet: Mittwoch, 8. Februar 2006 23:05 An: MyFaces Discussion Betreff: Re: Problem with evaluation of Tomahawk HtmlSelectOneRadio components inside UIData (programmatically created UI) Ok, I do think I know now what your problem is: the findComponent will deliver a component which is not properly initialized (it will return the stamp, but not the actual initialized component for this row...) So what you're really looking for is the functionality I implemented a few weeks ago for findComponent, to return a properly initialized component for this row. But: I can't help you out with fixing this in the radio-renderer right now, sorry. And you're in stress, too, to get your thesis finished, right? So I really don't know how to fix this. no clue. Anyone else able to help? regards, Martin On 2/8/06, Matthias Kahlau [EMAIL PROTECTED] wrote: Hi Martin! If you can't imagine the cause of the problem, maybe you can give me a hint to a workable solution using HtmlDataTable ... Regards, Matthias -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Auftrag von Matthias Kahlau Gesendet: Mittwoch, 8. Februar 2006 20:45 An: MyFaces Discussion; [EMAIL PROTECTED] Betreff: AW: Problem with evaluation of Tomahawk HtmlSelectOneRadio components inside UIData (programmatically created UI) I didn't use JSP, the UI is programmatically created. This is a part of the method which adds HtmlSelectOneRadio components to the HtmlDataTable: HtmlDataTable table = new HtmlDataTable(); this.form.getChildren().add(table); table.setId(this.viewRoot.createUniqueId()); table.setVar(row); table.setBorder(1); table.setCellspacing(0); table.setCellpadding(5); // the snippet which creates the HtmlSimpleUIColumn components for the table: for (int i = 0; i columns; i++) { column[i] = new HtmlSimpleColumn(); table.getChildren().add(column[i]); if (i == 0) { HtmlOutputText hot = new HtmlOutputText(); hot.setId(this.viewRoot.createUniqueId()); ValueBinding vb = app.createValueBinding(#{row.matrixfragetext}); hot.setValueBinding(value, vb); hot.setEscape(false); column[i].setWidth(150); column[i].getChildren().add(hot); } else { String text = ((Auswahlmoeglichkeit)sortedAm.get(i - 1)).getText(); HtmlOutputText header = this.createHtmlOutputText(text, null); column[i].setHeader(header); HtmlRadio radio = new HtmlRadio(); radio.setId(this.viewRoot.createUniqueId()); ValueBinding vb = app.createValueBinding(#{row.htmlSelectOneRadioId}); radio.setValueBinding(for, vb); radio.setIndex(i - 1); column[i].getChildren().add(radio); } } // the snippet which creates the HtmlSelectOneRadio
AW: AW: Programmatically created UI does not contain important HTML elements
Currently i am also evaluating JTidyServlet, but currently i do not have that special case. Guess that if your html is prepared to be xml-conform, not having a html element is of no interest to JTidy. I am interested in your findings so please keep us updated. BTW What's your current JTidy config esp. the config parameters? - My current JTidy config is : I do not use JTidy myself. It's used as part of UPortal, which is the target framework my application should run under. I've no further information about the configuration of JTidy. In a few days/weeks, I will have to try my application running under UPortal in the institution I'm working for, and my application has to be prepared... Regards, Matthias -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Auftrag von lij Gesendet: Montag, 6. Februar 2006 13:09 An: MyFaces Discussion Betreff: Re: AW: Programmatically created UI does not contain important HTML elements Currently i am also evaluating JTidyServlet, but currently i do not have that special case. Guess that if your html is prepared to be xml-conform, not having a html element is of no interest to JTidy. I am interested in your findings so please keep us updated. BTW What's your current JTidy config esp. the config parameters? - My current JTidy config is : filter filter-nameJTidyFilter/filter-name filter-class org.w3c.tidy.servlet.filter.JTidyFilter /filter-class init-param param-nametee/param-name param-valuefalse/param-value /init-param init-param param-nameconfig/param-name param-value tab-size=4;wrap:5000;output-xhtml:true; /param-value /init-param init-param param-namedoubleValidation/param-name param-valuefalse/param-value /init-param init-param param-namevalidateOnly/param-name param-valuefalse/param-value /init-param init-param param-namedoubleValidation/param-name param-valuefalse/param-value /init-param /filter Matthias Kahlau wrote: AFAIK most browsers do wrap content with HTML tags in case content does not self set html...body. Guess you can inspect that by looking in the DOM inspector in Mozilla/Firefox after browsing to such special html-pages. In my special case, the rendered code has to go to the JTidy filter of UPortal, which transforms the HTML code to XHTML (AFAIK). I don't know if JTidy is capable to transform incomplete HTML pages... Regards, Matthias -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Auftrag von Jörg Liegler Gesendet: Montag, 6. Februar 2006 01:05 An: 'MyFaces Discussion' Betreff: AW: Programmatically created UI does not contain important HTML elements AFAIK most browsers do wrap content with HTML tags in case content does not self set html...body. Guess you can inspect that by looking in the DOM inspector in Mozilla/Firefox after browsing to such special html-pages. Jörg -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Gesendet: Sonntag, 5. Februar 2006 16:48 An: Users MyFaces Betreff: Programmatically created UI does not contain important HTML elements Hi! I examined the HTML source code of my programmatically build view and noticed, that no HTML elements like html or head are rendered, but I wonder because the page is rendered correctly in MS IE. Do I have to manually add the missing elements, e. g. with the ResponseWriter? (I need valid HTML...) Regards, Matthias
AW: Changing the text format of radio/checkbox button labels
Do you know how the text format of radio button/checkbox labels can be changed. I already applied a CSS class to the component, but the settings aren't reflected in the labels... I could solve the problem. It was caused by a CSS class definition defined in a foreign stylesheet. Regards, Matthias -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Auftrag von Matthias Kahlau Gesendet: Montag, 6. Februar 2006 00:30 An: MyFaces Discussion Betreff: AW: Changing the text format of radio/checkbox button labels Do you know how the text format of radio button/checkbox labels can be changed. I already applied a CSS class to the component, but the settings aren't reflected in the labels... BTW: Accessibility guidelines require that the font size can be changed by the user, e. g. by changing it in the browser, but this is not possible in my case (in MS IE), regarding the font used in the labels. I really need to overwrite this behaviour with a CSS class... Regards, Matthias -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Auftrag von Matthias Kahlau Gesendet: Sonntag, 5. Februar 2006 18:47 An: Users MyFaces Betreff: Changing the text format of radio/checkbox button labels Hi! Do you know how the text format of radio button/checkbox labels can be changed. I already applied a CSS class to the component, but the settings aren't reflected in the labels... Regards, Matthias
Error when using spread layout in programmatically created HtmlSelectOneRadio
Hi! I used spread layout successfully with HtmlSelectOneRadio and HtmlSelectManyCheckbox in JSP. Now I programmatically created a HtmlSelectOneRadio and set the layout attribute to spread: HtmlSelectOneRadio radios = new HtmlSelectOneRadio(); // Tomahawk selectOne = radios; this.form.getChildren().add(selectOne); selectOne.setId(id); radios.setLayout(spread); When the view is rendered, I receive the following error: 2006-02-05 12:43:56,921 ERROR [org.apache.myfaces.renderkit.html.HtmlRadioRendererBase] Wrong layout attribute for component _id0:Frage_2: spread Why do I get this error? (I need spread layout...) (MyFaces in use: 20051130) Regards, Matthias
WG: Error when using spread layout in programmatically created HtmlSelectOneRadio
BTW: In the console, I get the following stacktrace: 12:43:56,937 ERROR [Engine] StandardWrapperValve[Faces Servlet]: Servlet.service() for servlet Faces Servlet threw exception java.lang.IllegalArgumentException: Value is no String and component _id0:Frage_2with path: {Component-Path : [Class: javax.faces.component. UIViewRoot,ViewId: /ParticipationView_2][Class: javax.faces.component.UIForm,Id: _id0][Class: org.apache.myfaces.component.html.ext.HtmlSele ctOneRadio,Id: Frage_2]} does not have a Converter at org.apache.myfaces.renderkit.RendererUtils.getConvertedStringValue(RendererU tils.java:538) at org.apache.myfaces.renderkit.html.HtmlRadioRendererBase.encodeEnd(HtmlRadioR endererBase.java:92) at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:521) at de.fhzw.portal.umfragesystem.view.custom.CustomViewHandler.renderResponse(Cu stomViewHandler.java:230) at de.fhzw.portal.umfragesystem.view.custom.CustomViewHandler.renderResponse(Cu stomViewHandler.java:227) at de.fhzw.portal.umfragesystem.view.custom.CustomViewHandler.renderResponse(Cu stomViewHandler.java:227) at de.fhzw.portal.umfragesystem.view.custom.CustomViewHandler.renderView(Custom ViewHandler.java:177) at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:372) at javax.faces.webapp.FacesServlet.service(FacesServlet.java:107) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application FilterChain.java:237) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh ain.java:157) at org.apache.myfaces.component.html.util.ExtensionsFilter.doFilter(ExtensionsF ilter.java:123) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application FilterChain.java:186) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh ain.java:157) at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.ja va:75) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application FilterChain.java:186) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh ain.java:157) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja va:214) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex t.java:104) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContext Valve.java:198) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja va:152) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex t.java:104) at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalVal ve.java:66) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex t.java:102) at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssoci ationValve.java:150) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex t.java:102) at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java: 54) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex t.java:102) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137 ) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex t.java:104) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118 ) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex t.java:102) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java :109) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex t.java:104) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929) at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConne ction(Http11Protocol.java:705) at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav a:683) at java.lang.Thread.run(Thread.java:534) Regards, Matthias -Ursprüngliche Nachricht- Von: Matthias Kahlau [mailto:[EMAIL PROTECTED] Gesendet: Sonntag
AW: Error when using spread layout in programmatically created HtmlSelectOneRadio
Many thanks Volker, that was the missing part... Regards, Matthias -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Auftrag von Volker Weber Gesendet: Sonntag, 5. Februar 2006 13:25 An: MyFaces Discussion Betreff: Re: Error when using spread layout in programmatically created HtmlSelectOneRadio Hi Mathias, set the renderType to org.apache.myfaces.Radio; otherwise you won't get the tomahawk renderer. Regards, Volker Matthias Kahlau wrote: Hi! I used spread layout successfully with HtmlSelectOneRadio and HtmlSelectManyCheckbox in JSP. Now I programmatically created a HtmlSelectOneRadio and set the layout attribute to spread: HtmlSelectOneRadio radios = new HtmlSelectOneRadio(); // Tomahawk radios.setRendererType(org.apache.myfaces.Radio); selectOne = radios; this.form.getChildren().add(selectOne); selectOne.setId(id); radios.setLayout(spread); When the view is rendered, I receive the following error: 2006-02-05 12:43:56,921 ERROR [org.apache.myfaces.renderkit.html.HtmlRadioRendererBase] Wrong layout attribute for component _id0:Frage_2: spread Why do I get this error? (I need spread layout...) (MyFaces in use: 20051130) Regards, Matthias -- Don't answer to From: address! Mail to this account are droped if not recieved via mailinglist. To contact me direct create the mail address by concatenating my forename to my senders domain.
Changing the text format of radio/checkbox button labels
Hi! Do you know how the text format of radio button/checkbox labels can be changed. I already applied a CSS class to the component, but the settings aren't reflected in the labels... Regards, Matthias
AW: Changing the text format of radio/checkbox button labels
Do you know how the text format of radio button/checkbox labels can be changed. I already applied a CSS class to the component, but the settings aren't reflected in the labels... BTW: Accessibility guidelines require that the font size can be changed by the user, e. g. by changing it in the browser, but this is not possible in my case (in MS IE), regarding the font used in the labels. I really need to overwrite this behaviour with a CSS class... Regards, Matthias -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Auftrag von Matthias Kahlau Gesendet: Sonntag, 5. Februar 2006 18:47 An: Users MyFaces Betreff: Changing the text format of radio/checkbox button labels Hi! Do you know how the text format of radio button/checkbox labels can be changed. I already applied a CSS class to the component, but the settings aren't reflected in the labels... Regards, Matthias
Column/row number bug in HtmlInputTextArea?
Hi! When I set the column number of a HtmlInputTextArea, e. g. to 10, only 6 columns are displayed. Entering more than six characters causes a line break. I experience this behavior in IE 6. In Firefox 1.5, there are rendered 10 columns as expected, but 2 rows, although I set it to 1 row? In the source code, the textarea looks like this: textarea name=_id0:Frage_8 id=_id0:Frage_8 cols=10 rows=1/textarea Is this a browser problem or a JSF problem? Regards, Matthias
AW: Column/row number bug in HtmlInputTextArea?
Is this a browser problem or a JSF problem? Ok, stupid question - it must be a browser problem ;) Do you know, how to handle this? Regards, Matthias -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Auftrag von Matthias Kahlau Gesendet: Montag, 6. Februar 2006 00:45 An: Users MyFaces Betreff: Column/row number bug in HtmlInputTextArea? Hi! When I set the column number of a HtmlInputTextArea, e. g. to 10, only 6 columns are displayed. Entering more than six characters causes a line break. I experience this behavior in IE 6. In Firefox 1.5, there are rendered 10 columns as expected, but 2 rows, although I set it to 1 row? In the source code, the textarea looks like this: textarea name=_id0:Frage_8 id=_id0:Frage_8 cols=10 rows=1/textarea Is this a browser problem or a JSF problem? Regards, Matthias
AW: Programmatically created UI does not contain important HTML elements
AFAIK most browsers do wrap content with HTML tags in case content does not self set html...body. Guess you can inspect that by looking in the DOM inspector in Mozilla/Firefox after browsing to such special html-pages. In my special case, the rendered code has to go to the JTidy filter of UPortal, which transforms the HTML code to XHTML (AFAIK). I don't know if JTidy is capable to transform incomplete HTML pages... Regards, Matthias -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Auftrag von Jörg Liegler Gesendet: Montag, 6. Februar 2006 01:05 An: 'MyFaces Discussion' Betreff: AW: Programmatically created UI does not contain important HTML elements AFAIK most browsers do wrap content with HTML tags in case content does not self set html...body. Guess you can inspect that by looking in the DOM inspector in Mozilla/Firefox after browsing to such special html-pages. Jörg -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Gesendet: Sonntag, 5. Februar 2006 16:48 An: Users MyFaces Betreff: Programmatically created UI does not contain important HTML elements Hi! I examined the HTML source code of my programmatically build view and noticed, that no HTML elements like html or head are rendered, but I wonder because the page is rendered correctly in MS IE. Do I have to manually add the missing elements, e. g. with the ResponseWriter? (I need valid HTML...) Regards, Matthias
UISelectOne or UISelectMany with spread layout in HtmlPanelGrid
Hi! If I add a UISelectOne or UISelectMany component with spread layout as child to a HtmlPanelGrid, does this component count as child or not. In JSP, I think it doesn't count as child, but the single HtmlRadio or HtmlCheckbox components. This is what I'd expect when I build the UI programmatically. If it does also count as child, I have a problem... Regards, Matthias
AW: Panel Grid custom component
Hi Volker, do you know how to programmatically add a table header to the HtmlPanelGrid for each column? Regards, Matthias -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Auftrag von Volker Weber Gesendet: Freitag, 3. Februar 2006 12:14 An: MyFaces Discussion Betreff: Re: Panel Grid custom component Hi Ali, there are some things you made wrong: First, and this seems to be a popular error: you can't add a component to another by setting the parent of the child! use parent.getChildren().add(child) instead. Than: You dont neet to invoke encoding on every component, just create then component tree and let jsf do the rest. Try this : public void encodeBegin( FacesContext context ) { HtmlPanelGrid panelGrid = new HtmlPanelGrid(); panelGrid.setColumns(2); List children = panelGrid.getChildren(); UIOutput labelName = new UIOutput(); labelName.setValue(Enter name: ); labelName.setId(nameId); children.add(labelName); UIInput inputName = new UIInput(); inputName.setId(inputNameId); // UIInput needs a valueBinding children.add(inputName); UIOutput labelAge = new UIOutput(); labelAge.setValue(Enter age: ); labelName.setId(ageId); children.add(labelAge); UIInput inputAge = new UIInput(); inputAge.setId(inputAgeId); // UIInput needs a valueBinding children.add(inputAge); this.getChildren.add(panelGrid); super.encodeBegin(context); } Regards, Volker Ali Raza wrote: Greetings again, Instead of adding components by rendering the htl myself i am adding chilid components and calling their encode methods as following: public void encodeBegin( FacesContext context ) { try { ResponseWriter writer = context.getResponseWriter(); writer.writeComment(* THIS IS THE START OF COMPONENT **); HtmlPanelGrid panelGrid = new HtmlPanelGrid(); panelGrid.setColumns(2); panelGrid.encodeChildren(context); addComponentBegin(context, panelGridId, this, panelGrid); addComponentEnd(context, panelGrid); UIOutput labelName = new UIOutput(); labelName.setValue(Enter name: ); addComponentBegin(context, nameId, panelGrid, labelName); addComponentEnd(context, labelName); UIInput inputName = new UIInput(); addComponentBegin(context, inputNameId, panelGrid, inputName); addComponentEnd(context, inputName); UIOutput labelAge = new UIOutput(); labelAge.setValue(Enter age: ); addComponentBegin(context, ageId, panelGrid, labelAge); addComponentEnd(context, labelAge); UIInput inputAge = new UIInput(); addComponentBegin(context, inputAgeId, panelGrid, inputAge); addComponentEnd(context, inputAge); writer.writeComment(* THIS IS THE END OF COMPONENT **); } catch( IOException e ) { } } public static void addComponentBegin( FacesContext context, String componentId, UIComponent parentComponent, UIComponent childComponent ) throws IOException { if( componentId != null ) { childComponent.setId( componentId ); } childComponent.setParent( parentComponent ); childComponent.encodeBegin ( context ); } public static void addComponentEnd( FacesContext context, UIComponent childComponent ) throws IOException { childComponent.encodeEnd( context ); } My problem is that the layout of the panel grid (2 columns) that i have added is not maintained and all encoded children get rendered ina straight line quite like flowlayout in swing. can i use column wise layout without having to encode the html myself ??? Thanx a lot, Ali -- A sixteenth century inventor called Wan Hu designed a rocket-propelled chair on which he planned to ascend into heaven. He built an open cabin, to which he fitted 47 rockets underneath and above, and two kites to keep him aloft. Wan Hu disappeared in flame and smoke and was never seen again. A crater on the moon is now named after him, so in one sense he made it to the heavens after all. This is the first recorded design of something approximating to a manned space rocket. The Chinese Space Programme. From Conception to Future Capabilities. Brian Harvey -- Don't answer to From: address! Mail to this account are droped if not recieved via mailinglist. To contact me direct create the mail address by concatenating my forename to my senders domain.
AW: AW: Panel Grid custom component
Thanks Volker, you can take a look at the following example: http://www.irian.at/myfaces/masterDetail.jsf When you look at the source code, you can see that the f:facet name=header ... /f:facet element is used in more than one column. Regards, Matthias -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Auftrag von Volker Weber Gesendet: Freitag, 3. Februar 2006 13:03 An: MyFaces Discussion Betreff: Re: AW: Panel Grid custom component Hi Matthias, no i don't know. according to the sun spec this is not possible for h:panelGrid: http://java.sun.com/j2ee/javaserverfaces/1.1_01/docs/tlddocs/h/pan elGrid.html and i don't find any hint to such an addition in the tomahawk version at: http://myfaces.apache.org/tlddoc/tomahawk/t/panelGrid.html But if you point me to a working example, and i can take a look at the jsp sources i can figure out how to build it programatically. Regards Volker Matthias Kahlau wrote: Hi Volker, do you know how to programmatically add a table header to the HtmlPanelGrid for each column? Regards, Matthias -- Don't answer to From: address! Mail to this account are droped if not recieved via mailinglist. To contact me direct create the mail address by concatenating my forename to my senders domain.
AW: AW: AW: Panel Grid custom component
Ok, but with a dataTable, there's a similar problem. Both HtmlDataTable and HtmlPanelGrid are subclasses of UIComponentBase, and facet related methods are defined in this superclass (e. g. getFacets()). UIData does additionally provide convenience methods for setting the header and the footer, as you can read in the API doc of UIData: public void setHeader(javax.faces.component.UIComponent header) Set the header facet of this component. A convenience method for getFacets().put(header, header). http://java.sun.com/j2ee/javaserverfaces/1.1_01/docs/api/javax/faces/compone nt/UIData.html#setHeader(javax.faces.component.UIComponent) That looks to me like the facet thing of HtmlPanelGrid and HtmlDataTable is the same... Regards, Matthias -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Auftrag von Volker Weber Gesendet: Freitag, 3. Februar 2006 16:04 An: MyFaces Discussion Betreff: Re: AW: AW: Panel Grid custom component Hi, the masterDetail example uses dataTable not panelGrid. Matthias Kahlau wrote: Thanks Volker, you can take a look at the following example: http://www.irian.at/myfaces/masterDetail.jsf When you look at the source code, you can see that the f:facet name=header ... /f:facet element is used in more than one column. Regards, Matthias -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Auftrag von Volker Weber Gesendet: Freitag, 3. Februar 2006 13:03 An: MyFaces Discussion Betreff: Re: AW: Panel Grid custom component Hi Matthias, no i don't know. according to the sun spec this is not possible for h:panelGrid: http://java.sun.com/j2ee/javaserverfaces/1.1_01/docs/tlddocs/h/pan elGrid.html and i don't find any hint to such an addition in the tomahawk version at: http://myfaces.apache.org/tlddoc/tomahawk/t/panelGrid.html But if you point me to a working example, and i can take a look at the jsp sources i can figure out how to build it programatically. Regards Volker Matthias Kahlau wrote: Hi Volker, do you know how to programmatically add a table header to the HtmlPanelGrid for each column? Regards, Matthias -- Don't answer to From: address! Mail to this account are droped if not recieved via mailinglist. To contact me direct create the mail address by concatenating my forename to my senders domain. -- Don't answer to From: address! Mail to this account are droped if not recieved via mailinglist. To contact me direct create the mail address by concatenating my forename to my senders domain.
How to set the width of columns in a panelGrid?
Hi! Is there a way to define the width of columns when using a panelGrid element? Regards, Matthias
AW: AW: AW: AW: Panel Grid custom component
Hi! So you are right, in this point UIData and panelGrid are similar, but i think this are not the headers you want. No, I see. I don't explicitely use columns in a panelGrid, so I can't add facets as children of column components, neither in JSP nor programmatically. It seems like I have to use HtmlDataTable, but this will be more complex than using a simple HtmlPanelGrid... Regards, Matthias -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Auftrag von Volker Weber Gesendet: Freitag, 3. Februar 2006 17:40 An: MyFaces Discussion Betreff: Re: AW: AW: AW: Panel Grid custom component Hi, the header facet of a UIData renders a common header over all columns, To render a header for each column you must set a header facet on the column component. See: http://java.sun.com/j2ee/javaserverfaces/1.1_01/docs/tlddocs/h/dat aTable.html So you are right, in this point UIData and panelGrid are similar, but i think this are not the headers you want. Regards, Volker Matthias Kahlau wrote: Ok, but with a dataTable, there's a similar problem. Both HtmlDataTable and HtmlPanelGrid are subclasses of UIComponentBase, and facet related methods are defined in this superclass (e. g. getFacets()). UIData does additionally provide convenience methods for setting the header and the footer, as you can read in the API doc of UIData: public void setHeader(javax.faces.component.UIComponent header) Set the header facet of this component. A convenience method for getFacets().put(header, header). http://java.sun.com/j2ee/javaserverfaces/1.1_01/docs/api/javax/fac es/compone nt/UIData.html#setHeader(javax.faces.component.UIComponent) That looks to me like the facet thing of HtmlPanelGrid and HtmlDataTable is the same... Regards, Matthias -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Auftrag von Volker Weber Gesendet: Freitag, 3. Februar 2006 16:04 An: MyFaces Discussion Betreff: Re: AW: AW: Panel Grid custom component Hi, the masterDetail example uses dataTable not panelGrid. Matthias Kahlau wrote: Thanks Volker, you can take a look at the following example: http://www.irian.at/myfaces/masterDetail.jsf When you look at the source code, you can see that the f:facet name=header ... /f:facet element is used in more than one column. Regards, Matthias -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] m Auftrag von Volker Weber Gesendet: Freitag, 3. Februar 2006 13:03 An: MyFaces Discussion Betreff: Re: AW: Panel Grid custom component Hi Matthias, no i don't know. according to the sun spec this is not possible for h:panelGrid: http://java.sun.com/j2ee/javaserverfaces/1.1_01/docs/tlddocs/h/pan elGrid.html and i don't find any hint to such an addition in the tomahawk version at: http://myfaces.apache.org/tlddoc/tomahawk/t/panelGrid.html But if you point me to a working example, and i can take a look at the jsp sources i can figure out how to build it programatically. Regards Volker Matthias Kahlau wrote: Hi Volker, do you know how to programmatically add a table header to the HtmlPanelGrid for each column? Regards, Matthias -- Don't answer to From: address! Mail to this account are droped if not recieved via mailinglist. To contact me direct create the mail address by concatenating my forename to my senders domain. -- Don't answer to From: address! Mail to this account are droped if not recieved via mailinglist. To contact me direct create the mail address by concatenating my forename to my senders domain. -- Don't answer to From: address! Mail to this account are droped if not recieved via mailinglist. To contact me direct create the mail address by concatenating my forename to my senders domain.
AW: AW: AW: AW: Panel Grid custom component
Thanks, but only formatting some components as headers is not sufficient in my case, because the HTML output needs to contain structural header elements to comply to accessibility requirements... Regards, Matthias -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Auftrag von Volker Weber Gesendet: Freitag, 3. Februar 2006 18:36 An: MyFaces Discussion Betreff: Re: AW: AW: AW: Panel Grid custom component Hi, You can add as many 'header' components as you need (ie number of columns) as the first children, and use css to format them visualy as headers. Regards, Volker Matthias Kahlau wrote: Hi Volker, as I read in Bergsten's JSF book, JSF distinguishes between a table header facet and column header facets. - table header facet: rendered as one th element (with a colspan attribute set to the number of children) within a tr element - column header facets: rendered as th elements within a separate tr element - a thead element encloses both header tr elements Looks like the column header facets are what I searched for, and the facet elements are used as children of the column elements. But columns are not explicitely used with a panelGrid... and column header facets are not supported, as you already mentioned: according to the sun spec this is not possible for h:panelGrid: http://java.sun.com/j2ee/javaserverfaces/1.1_01/docs/tlddocs/h/ panelGrid.h tml Is there any way out when programmatically creating the UI? Maybe I can use a HtmlDataTable, but I don't know if this is possible because I don't have a simple list of objects to iterate over. I need to add a HtmlOutputText component in the first column (it's value may be fetched from an object of the data set) and radiobuttons (with spread layout) in the remaining columns. Regards, Matthias -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Auftrag von Matthias Kahlau Gesendet: Freitag, 3. Februar 2006 16:24 An: MyFaces Discussion Betreff: AW: AW: AW: Panel Grid custom component Ok, but with a dataTable, there's a similar problem. Both HtmlDataTable and HtmlPanelGrid are subclasses of UIComponentBase, and facet related methods are defined in this superclass (e. g. getFacets()). UIData does additionally provide convenience methods for setting the header and the footer, as you can read in the API doc of UIData: public void setHeader(javax.faces.component.UIComponent header) Set the header facet of this component. A convenience method for getFacets().put(header, header). http://java.sun.com/j2ee/javaserverfaces/1.1_01/docs/api/javax/fac es/compone nt/UIData.html#setHeader(javax.faces.component.UIComponent) That looks to me like the facet thing of HtmlPanelGrid and HtmlDataTable is the same... Regards, Matthias -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Auftrag von Volker Weber Gesendet: Freitag, 3. Februar 2006 16:04 An: MyFaces Discussion Betreff: Re: AW: AW: Panel Grid custom component Hi, the masterDetail example uses dataTable not panelGrid. Matthias Kahlau wrote: Thanks Volker, you can take a look at the following example: http://www.irian.at/myfaces/masterDetail.jsf When you look at the source code, you can see that the f:facet name=header ... /f:facet element is used in more than one column. Regards, Matthias -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Auftrag von Volker Weber Gesendet: Freitag, 3. Februar 2006 13:03 An: MyFaces Discussion Betreff: Re: AW: Panel Grid custom component Hi Matthias, no i don't know. according to the sun spec this is not possible for h:panelGrid: http://java.sun.com/j2ee/javaserverfaces/1.1_01/docs/tlddocs/h/pan elGrid.html and i don't find any hint to such an addition in the tomahawk version at: http://myfaces.apache.org/tlddoc/tomahawk/t/panelGrid.html But if you point me to a working example, and i can take a look at the jsp sources i can figure out how to build it programatically. Regards Volker Matthias Kahlau wrote: Hi Volker, do you know how to programmatically add a table header to the HtmlPanelGrid for each column? Regards, Matthias -- Don't answer to From: address! Mail to this account are droped if not recieved via mailinglist. To contact me direct create the mail address by concatenating my forename to my senders domain. -- Don't answer to From: address! Mail to this account are droped if not recieved via mailinglist. To contact me direct create the mail address by concatenating my forename to my senders domain. -- Don't answer to From: address! Mail to this account are droped if not recieved via mailinglist. To contact me direct create the mail address
AW: AW: AW: AW: Panel Grid custom component
Thanks Martin, this sounds good and helpful, but I'm pressed for time because of working for my diploma thesis in the context of JSF ;) I think I have to try the HtmlDataTable... Regards, Matthias -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Auftrag von Martin Marinschek Gesendet: Freitag, 3. Februar 2006 19:43 An: MyFaces Discussion Betreff: Re: AW: AW: AW: Panel Grid custom component Ok, I tell you how it would work - maybe you want to try to provide that to MyFaces: You'll need to create a new, custom tag and component (let's call it t:header) which you can add to the (t:)panel-grid. (t:header cause it will be used in t:panelGrid, and so we cannot add it to the sandbox. We'd do it with a facet, but facets accept only one child, and that's not enough in this case ;) regards, Martin On 2/3/06, Matthias Kahlau [EMAIL PROTECTED] wrote: Thanks, but only formatting some components as headers is not sufficient in my case, because the HTML output needs to contain structural header elements to comply to accessibility requirements... Regards, Matthias -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Auftrag von Volker Weber Gesendet: Freitag, 3. Februar 2006 18:36 An: MyFaces Discussion Betreff: Re: AW: AW: AW: Panel Grid custom component Hi, You can add as many 'header' components as you need (ie number of columns) as the first children, and use css to format them visualy as headers. Regards, Volker Matthias Kahlau wrote: Hi Volker, as I read in Bergsten's JSF book, JSF distinguishes between a table header facet and column header facets. - table header facet: rendered as one th element (with a colspan attribute set to the number of children) within a tr element - column header facets: rendered as th elements within a separate tr element - a thead element encloses both header tr elements Looks like the column header facets are what I searched for, and the facet elements are used as children of the column elements. But columns are not explicitely used with a panelGrid... and column header facets are not supported, as you already mentioned: according to the sun spec this is not possible for h:panelGrid: http://java.sun.com/j2ee/javaserverfaces/1.1_01/docs/tlddocs/h/ panelGrid.h tml Is there any way out when programmatically creating the UI? Maybe I can use a HtmlDataTable, but I don't know if this is possible because I don't have a simple list of objects to iterate over. I need to add a HtmlOutputText component in the first column (it's value may be fetched from an object of the data set) and radiobuttons (with spread layout) in the remaining columns. Regards, Matthias -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Auftrag von Matthias Kahlau Gesendet: Freitag, 3. Februar 2006 16:24 An: MyFaces Discussion Betreff: AW: AW: AW: Panel Grid custom component Ok, but with a dataTable, there's a similar problem. Both HtmlDataTable and HtmlPanelGrid are subclasses of UIComponentBase, and facet related methods are defined in this superclass (e. g. getFacets()). UIData does additionally provide convenience methods for setting the header and the footer, as you can read in the API doc of UIData: public void setHeader(javax.faces.component.UIComponent header) Set the header facet of this component. A convenience method for getFacets().put(header, header). http://java.sun.com/j2ee/javaserverfaces/1.1_01/docs/api/javax/fac es/compone nt/UIData.html#setHeader(javax.faces.component.UIComponent) That looks to me like the facet thing of HtmlPanelGrid and HtmlDataTable is the same... Regards, Matthias -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Auftrag von Volker Weber Gesendet: Freitag, 3. Februar 2006 16:04 An: MyFaces Discussion Betreff: Re: AW: AW: Panel Grid custom component Hi, the masterDetail example uses dataTable not panelGrid. Matthias Kahlau wrote: Thanks Volker, you can take a look at the following example: http://www.irian.at/myfaces/masterDetail.jsf When you look at the source code, you can see that the f:facet name=header ... /f:facet element is used in more than one column. Regards, Matthias -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Auftrag von Volker Weber Gesendet: Freitag, 3. Februar 2006 13:03 An: MyFaces Discussion Betreff: Re: AW: Panel Grid
Using HtmlPanelGrid with an odd amount of children?
Hi! Is it legal to use HtmlPanelGrid with an odd amount of children? I can recall some warnings shown in the logging output when not all possible cells are used, but it's only a warning - the rendered grid looks correct. Will the warning behaviour change to legal in the future, or shouldn't I use an odd number, but use invisible fillers? Regards, Matthias
Using HtmlPanelGrid with an odd amount of children?
Hi! Is it legal to use HtmlPanelGrid with an odd amount of children? I can recall some warnings shown in the logging output when not all possible cells are used, but it's only a warning - the rendered grid looks correct. Will the warning behaviour change to legal in the future, or shouldn't I use an odd number, but use invisible fillers? Regards, Matthias
AW: Using HtmlPanelGrid with an odd amount of children?
Thanks, and what happens if the number of children is not a a multiple of the @columns attribute for that grid? Regards, Matthias -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Auftrag von Dennis Byrne Gesendet: Freitag, 3. Februar 2006 01:16 An: MyFaces Discussion Betreff: Re: Using HtmlPanelGrid with an odd amount of children? Odd, even - whichever you want. Just so much as the number of children is a multiple of the @columns attribute for that grid. Dennis Byrne -Original Message- From: Matthias Kahlau [mailto:[EMAIL PROTECTED] Sent: Thursday, February 2, 2006 07:10 PM To: 'Users MyFaces' Subject: Using HtmlPanelGrid with an odd amount of children? Hi! Is it legal to use HtmlPanelGrid with an odd amount of children? I can recall some warnings shown in the logging output when not all possible cells are used, but it's only a warning - the rendered grid looks correct. Will the warning behaviour change to legal in the future, or shouldn't I use an odd number, but use invisible fillers? Regards, Matthias
How to programmatically add a table header to a HtmlPanelGrid?
Hi! When using JSP and dataTable, I can add f:facet name=header.../f:facet within more than one column. But now I want to add a table header to a HtmlPanelGrid when programmatically creating the UI components. It seems there's no facet component to use, and I have to use panelGrid.getFacets().put(header, header); This looks like only one header facet can be added. But I need to add more facets. And I think I can't use a container component for the header component (e.g. another HtmlPanelGrid), because the cell borders of table header and body have to be aligned. Do you know a solution? Regards, Matthias
AW: How to use the HtmlTag component when programmatically building the UI?
Hi! Is there nobody else who had the requirement to programmatically render HTML elements like H1, H2 etc.? This is an important requirement when creating Web pages which have to follow accessibility guidelines... Regards, Matthias -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Auftrag von Matthias Kahlau Gesendet: Dienstag, 31. Januar 2006 23:10 An: Users MyFaces Betreff: How to use the HtmlTag component when programmatically building the UI? Hi! Is it possible to use the Tomahawk HtmlTag component when programmatically building the UI. I know I can use setValue() to set the HTML element name to render, e. g. h1. But can I programmatically set the body content? If this is not possible, do you know alternatives to render arbitrary HTML elements? Regards, Matthias
How to use the HtmlTag component when programmatically building the UI?
Hi! Is it possible to use the Tomahawk HtmlTag component when programmatically building the UI. I know I can use setValue() to set the HTML element name to render, e. g. h1. But can I programmatically set the body content? If this is not possible, do you know alternatives to render arbitrary HTML elements? Regards, Matthias
AW: Custom ViewHandler - problem with navigation
Hi Frank Felix! My navigation works now, I've implemented a custom navigation handler. Many thanks for your hint. Regards, Matthias -Ursprungliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Auftrag von Frank Felix Debatin Gesendet: Montag, 30. Januar 2006 10:01 An: 'MyFaces Discussion' Betreff: RE: Custom ViewHandler - problem with navigation Hi Matthias, I'm not an expert in the inner workings of JSF, views and navigation. But here is what works for me. I never understood the sense of the xml navigation rules, and because we have a very large application with many pages, we were fed up typing in the navigation rules, and forgetting them from time to time. Thus, I took the myfaces implementation of the navigation handler, threw out all the xml navigation rule stuff, and used it as a custom navigation handler, that moves forward without looking for a rule. Essentially the navigation handler does the following things. Is is a redirect? If yes do a redirect via the external context. If no, call viewhandler create view, set the view id, call faces context set view root, and then render response. Long text, short message: try doing your own navigation handler. It's simple, and we were very happy with that, because we got a lot more control. Regards Frank Felix -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Monday, January 30, 2006 2:50 AM To: Users MyFaces Subject: Custom ViewHandler - problem with navigation Hi! I'm implementing a custom view handler and encounter problems with the navigation. The view handler is responsible for handling pure code-level Java views and delegates the rendering of JSP pages to the default view handler. Because of the Java views, I don't have any files to specify in the faces-config.xml navigation rules. When I use an outcome for a Java view, the navigation handler says that it cannot find a matching navigation case, and stays on the current view: outcome=ParticipationView no matching navigation-case found, staying on current ViewRoot Does anybody of you know how to handle that? Regards, Matthias
WG: Problem with UIData access in session scope when UIData is transient because of serialization
Hi! I use a reference to a UIData component in a session-scoped Backing-Bean with server-side state saving. The reference is declared as transient because of serialization. Do you know why that reference is null when processing other requests than the postback of the view with the dataTable belonging to the UIData? As I already know, this behaviour depends on using the transient attribute. When I don't declare the UIData as transient, it's always accessible. But do you know why? Actually, my problem is that I need to access the UIData from any request to call the scroll method, but I also need to declare it transient. Regards, Matthias -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Auftrag von Matthias Kahlau Gesendet: Samstag, 28. Januar 2006 10:44 An: MyFaces Discussion Betreff: AW: Problem with UIData access in session scope when UIData is transient because of serialization Hi! Does anybody of you have tried to scroll a data table (setting the first property) when processing another page, not the page with the data table. Is this possible? My problem is that the reference to the data table is null when processing another request, because the reference is declared as transient. This is necessary because the related Backing-Bean does have to implement java.io.Serializable. Regards, Matthias -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Auftrag von Matthias Kahlau Gesendet: Mittwoch, 25. Januar 2006 12:34 An: Users MyFaces Betreff: Problem with UIData access in session scope when UIData is transient because of serialization Hi! I have the following problem: - Backing-Bean property of type UIData (component-binding) - Backing-Bean is in session-scope - Backing-Bean implements Serializable - Backing-Bean has deleteSelected() method to delete selected rows in the UIData - Backing-Bean has scroll() method to scroll the UIData after deletion - deletion is not performed immediately when processing the postback, but a confirmation dialogue is shown first - so deletion is performed after confirming the dialogue There are two scenarios: 1) Backing-Bean property of type UIData (component-binding) is transient - That's necessary to make the Backing-Bean serializable - Marked as transient, the UIData can only be accessed in the postback - later, it is null! - That's a problem when the UIData selection evaluation or the scrolling is performed after showing the confirmation dialogue... (I can temporarily store the selected objects by accessing UIData before the confirmation dialogue, but it's bad to scroll before showing the confirmation dialogue, because the user may decide ro not delete, and the I cannot scroll back because UIData is null (or is this possible in any way?)) 2) Backing-Bean property of type UIData (component-binding) is NOT transient - My Backing-Bean is not serializable anymore - JBoss throws NotSerializable Exceptions - But I can access the UIData after showing the confirmation dialogue, too (not only when processing the postback) My Backing-Beans should all be serializable, so do you have an idea of how to access UIData in requests after the postback, when UIData is marked transient? (By the way: Can you explain why UIData not marked transient is accessible in requests after the postback and not accessible when it's marked transient?) Any help would highly be appreciated... Regards, Matthias
Custom ViewHandler - problem with navigation
Hi! I'm implementing a custom view handler and encounter problems with the navigation. The view handler is responsible for handling pure code-level Java views and delegates the rendering of JSP pages to the default view handler. Because of the Java views, I don't have any files to specify in the faces-config.xml navigation rules. When I use an outcome for a Java view, the navigation handler says that it cannot find a matching navigation case, and stays on the current view: outcome=ParticipationView no matching navigation-case found, staying on current ViewRoot Does anybody of you know how to handle that? Regards, Matthias
AW: Problem with UIData access in session scope when UIData is transient because of serialization
Hi! Does anybody of you have tried to scroll a data table (setting the first property) when processing another page, not the page with the data table. Is this possible? My problem is that the reference to the data table is null when processing another request, because the reference is declared as transient. This is necessary because the related Backing-Bean does have to implement java.io.Serializable. Regards, Matthias -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Auftrag von Matthias Kahlau Gesendet: Mittwoch, 25. Januar 2006 12:34 An: Users MyFaces Betreff: Problem with UIData access in session scope when UIData is transient because of serialization Hi! I have the following problem: - Backing-Bean property of type UIData (component-binding) - Backing-Bean is in session-scope - Backing-Bean implements Serializable - Backing-Bean has deleteSelected() method to delete selected rows in the UIData - Backing-Bean has scroll() method to scroll the UIData after deletion - deletion is not performed immediately when processing the postback, but a confirmation dialogue is shown first - so deletion is performed after confirming the dialogue There are two scenarios: 1) Backing-Bean property of type UIData (component-binding) is transient - That's necessary to make the Backing-Bean serializable - Marked as transient, the UIData can only be accessed in the postback - later, it is null! - That's a problem when the UIData selection evaluation or the scrolling is performed after showing the confirmation dialogue... (I can temporarily store the selected objects by accessing UIData before the confirmation dialogue, but it's bad to scroll before showing the confirmation dialogue, because the user may decide ro not delete, and the I cannot scroll back because UIData is null (or is this possible in any way?)) 2) Backing-Bean property of type UIData (component-binding) is NOT transient - My Backing-Bean is not serializable anymore - JBoss throws NotSerializable Exceptions - But I can access the UIData after showing the confirmation dialogue, too (not only when processing the postback) My Backing-Beans should all be serializable, so do you have an idea of how to access UIData in requests after the postback, when UIData is marked transient? (By the way: Can you explain why UIData not marked transient is accessible in requests after the postback and not accessible when it's marked transient?) Any help would highly be appreciated... Regards, Matthias
server-side panelTabbedPane, dataScroller and JavaScript
Hi! - Does the server-side switching panelTabbedPane require any JavaScript? - And the dataScroller? Regards, Matthias
WG: javax.faces.application.StateManager.SerializedView cannot be found
Hi all! The problem seems to be solved now - it looks like it's only a Java editor problem, because compilation works fine... Regards, Matthias -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Auftrag von Matthias Kahlau Gesendet: Donnerstag, 26. Januar 2006 00:45 An: MyFaces Discussion Betreff: AW: javax.faces.application.StateManager.SerializedView cannot be found Hi! That's really strange. I tried using a self-defined inner class, and that worked with JDeveloper 10.1.2. public class OuterClass { public class InnerClass { } } And in another package/class, I use the following import statement, which works: import mypackage.OuterClass.InnerClass; Is there sth. special with MyFaces? JDeveloper says the class or member StateManager.SerializedView cannot be found... That's a real blocker for me at the moment... Regards, Matthias -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Auftrag von Matthias Wessendorf Gesendet: Mittwoch, 25. Januar 2006 22:57 An: MyFaces Discussion Betreff: Re: javax.faces.application.StateManager.SerializedView cannot be found mmm just test that w/ eclipse. but import javax.faces.application.StateManager.SerializedView; works fine for me (tested w/ build from scratch) -Matthias On 1/25/06, Matthias Kahlau [EMAIL PROTECTED] wrote: Hi! I use the myFaces-all.jar nightly from 20051130. When I try to use the SerializedView class, it cannot be found (that's what JDeveloper says to me...). import javax.faces.application.StateManager; works! import javax.faces.application.StateManager.SerializedView; fails! Do you know the reasons? Many thanks. Regards, Matthias -- Matthias Wessendorf Zülpicher Wall 12, 239 50674 Köln http://www.wessendorf.net mwessendorf-at-gmail-dot-com
AW: Nightly builds in production enviroment
I disagree. Without that nighly builds, the realization of my application would have been questionable, because some bugs have been fixed. You should test your application in any case, and if all works with a nightly build, why not use it in a production environment... :) Regards, Matthias -Ursprüngliche Nachricht-Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]Im Auftrag von Nicklas KarlssonGesendet: Donnerstag, 26. Januar 2006 12:45An: MyFaces DiscussionBetreff: Re: Nightly builds in production enviroment On 1/26/06, Vladimir Coutinho [EMAIL PROTECTED] wrote: Could I user Nightly builds in production enviroment?That sounds like a Generally Bad Idea(tm), no matter what software/component is discussed.
AW: AW: Nightly builds in production enviroment
Hi! Is there any risk when migrating from a nightly build to the next stable release? Regards, Matthias -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Auftrag von Werner Punz Gesendet: Donnerstag, 26. Januar 2006 14:54 An: users@myfaces.apache.org Betreff: Re: AW: Nightly builds in production enviroment Matthias Kahlau schrieb: I disagree. Without that nighly builds, the realization of my application would have been questionable, because some bugs have been fixed. You should test your application in any case, and if all works with a nightly build, why not use it in a production environment... :) It really depends, if you run into an issue which you cannot fix or bypass in a stable, at least for development nightlies are sometimes recommendable, but only in such cases (I can never recommend fully to use an unstable build). The stables are not to bug ridden anymore like they used to be 1-2 years ago, huge improvements happened in this area. Therefore even if you run into issues and switch to the nightlies probably add a deployment plan for moving the project to the next stable asap once it comes out. Even if not for other reasons than that you have a clear reproducable tagged library version.
Problem with UIData access in session scope when UIData is transient because of serialization
Hi! I have the following problem: - Backing-Bean property of type UIData (component-binding) - Backing-Bean is in session-scope - Backing-Bean implements Serializable - Backing-Bean has deleteSelected() method to delete selected rows in the UIData - Backing-Bean has scroll() method to scroll the UIData after deletion - deletion is not performed immediately when processing the postback, but a confirmation dialogue is shown first - so deletion is performed after confirming the dialogue There are two scenarios: 1) Backing-Bean property of type UIData (component-binding) is transient - That's necessary to make the Backing-Bean serializable - Marked as transient, the UIData can only be accessed in the postback - later, it is null! - That's a problem when the UIData selection evaluation or the scrolling is performed after showing the confirmation dialogue... (I can temporarily store the selected objects by accessing UIData before the confirmation dialogue, but it's bad to scroll before showing the confirmation dialogue, because the user may decide ro not delete, and the I cannot scroll back because UIData is null (or is this possible in any way?)) 2) Backing-Bean property of type UIData (component-binding) is NOT transient - My Backing-Bean is not serializable anymore - JBoss throws NotSerializable Exceptions - But I can access the UIData after showing the confirmation dialogue, too (not only when processing the postback) My Backing-Beans should all be serializable, so do you have an idea of how to access UIData in requests after the postback, when UIData is marked transient? (By the way: Can you explain why UIData not marked transient is accessible in requests after the postback and not accessible when it's marked transient?) Any help would highly be appreciated... Regards, Matthias
javax.faces.application.StateManager.SerializedView cannot be found
Hi! I use the myFaces-all.jar nightly from 20051130. When I try to use the SerializedView class, it cannot be found (that's what JDeveloper says to me...). import javax.faces.application.StateManager; works! import javax.faces.application.StateManager.SerializedView; fails! Do you know the reasons? Many thanks. Regards, Matthias