1 2 3 Previous Next 38 Replies Latest reply on Mar 24, 2011 7:56 AM by waltc Go to original post
      • 30. Re: java.util.Vector cannot be cast to javax.faces.model.DataModel
        kragoth

        Have you gone to the richfaces demo page like I asked earlier? I'm not an IE fan, but to be fair there's still an awefull lot of people out there using IE6 and I haven't seen your issue being talked about. My own project uses IE6 and we have none of these issues.


        As tempting as it is to blame this on an 'IE' feature, I find that hard to accept at this late stage in the richfaces library.


        Pretty much all richfaces components have some javascript in them. Ajax is pretty much all javascript. There's javascript going on everywhere these days. If you have multiple component libs or extra javascript libs or css styles that are overwriting the components default styles all these can lead to issues.


        The column width issue is annoying cause as you have rightly pointed out browser behavior is different and thus getting a consistent look and feel can be tedious. There's ways to fix this but, ultimately becoming browser independent is a tough task. It requires lots of patience. ;)


        A common thing I use when dealing with areas that may be empty (your tab panel for instance) is a simple rich:spacer tag. Render it conditionally based on if there is other content in the panel (you'll have to work out that). The rich:spacer tag is a great 'filler' tag.


        I would be most interested in your results of browsing the richfaces demo page. Specifically the pages that deal with the components you are having trouble with. If they work on the demo page then.....it'll be time to put away the IE argument and work out what's different between your app and theirs.

        • 31. Re: java.util.Vector cannot be cast to javax.faces.model.DataModel
          waltc

          Yes, I certainly did and more on that in a moment.


          As I mentioned before, I lost the ability to try anything on IE6 as it was replaced when I upgraded to IE8. So I can not vet anything again on IE6. I also didn't realize there was a compatibility mode until the other day so I don't know if that would have helped in the case of IE6. This is not for public facing so it is sufficient for me to tell people on IE6 they should upgrade. However, I did subtlety change the tags.




          <a4j:form styleClass="edit">
          <rich:simpleTogglePanel  switchType="client" >
               <f:facet name="header">Activity Filter</f:facet>
               <s:decorate template="layout/display.xhtml">
                    <ui:define name="label">Technology</ui:define>     
                    <rich:comboBox id="compositeActivityEngineType" value="#{compositeActivityList.engineType}" label="Engine" selectFirstOnUpdate="true">
                    <f:selectItem itemValue="Option1"/>
                    <f:selectItem itemValue="NewAge"/>
                    </rich:comboBox>
               </s:decorate>
          
               <s:decorate template="layout/display.xhtml">
                    <ui:define name="label">Language</ui:define>     
                    <rich:comboBox id="compositeActivityCountry" value="#{compositeActivityList.country}" label="Language">
                       <f:selectItem itemValue="All"/>
                     <f:selectItem itemValue="EN"/>
                     <f:selectItem itemValue="FR"/>
                     <f:selectItem itemValue="DE"/>
                    </rich:comboBox>
               </s:decorate>     
          
               <s:decorate template="layout/display.xhtml">
                    <ui:define name="label">DocType</ui:define>     
                    <rich:comboBox id="compositeActivityDocType" directInputSuggestions="true" label="Document" value="#{compositeActivityList.docType}" selectFirstOnUpdate="true">
                     <f:selectItem itemValue="rows"/>
                     <f:selectItem itemValue="columns"/>
                    </rich:comboBox>
               </s:decorate>
               <s:decorate template="layout/display.xhtml">
                    <ui:define name="label">Smoothing</ui:define>     
                    <rich:inputNumberSpinner id="smoothingSpinner" label="Smoothing Period" maxValue="21" minValue="1" step="1" value="#{DailyActivity.smoothing}">
                    </rich:inputNumberSpinner>          
               </s:decorate>
               <s:decorate template="layout/display.xhtml">     
              <div class="actionButtons">
                  <h:commandButton id="DisplayButton" value="Display"  action="#{DailyActivity.createDayList()}" rerender="output"/>
                  <s:button id="reset" value="Reset" includePageParams="false"/>
              </div>
               </s:decorate>
          </rich:simpleTogglePanel>
          </a4j:form>
           



          This, as far as source code is very straight-forward. What is different is in the previous rendition I had tried to have the controls in one column. I since changed to have them span multiple rows.


          As far as the Richfaces demo, they do not use decorate or ui:defines, which implies they do not use templating. Consequently, the way control labels are rendered is different.  Again, that initial version of the facelets worked perfectly in Linux FF as well as Windows FF, IE7, and IE8 (in compatibility mode) Without compat mode the spinner control itself was on a different line from its label, (see above) source. Also on the tabpanel, if it were empty only the tabs themselves appeared, not the group box. This didn't change with compatibility mode on but with compatibility mode on the spinner and it's label were rendered correctly. I do not understand what compatibility mode means, especially when they say if it is on pages will render properly. Why would you not want to have it on then?

          • 32. Re: java.util.Vector cannot be cast to javax.faces.model.DataModel
            kragoth

            Ok, first of all IE8 compatibility mode is basically IE8 trying to emulate IE7. It is NOT the same, but...uses similar rules. (This link has some info).



            As far as the Richfaces demo, they do not use decorate or ui:defines, which implies they do not use templating. Consequently, the way control labels are rendered is different.


            This is exactly what I was talking about earlier. Taking away the extra stuff is your first step to solving the problem. Sure, eventually you want to get it back to what you have but, you must identify where the problem lies. There are many people around the world using s:docorate and I'd be very surprised if none of them are using it with the rich:inputNumberSpinner or combobox. It may be something very simple in your decorate template that is conflicting with how the components are rendered.


            If upgrading to IE8 is a viable solution for you then take it. There's no point in wasting time on browser compatibility if you don't have to.


            IE8 was a rather large change from the way the browser rendered html. This is why they introduced the compatibility mode. IE8 is closer to the w3 standard although still a LONG way off it. So, in order to allow people to upgrade while still allowing them to use sites that had been designed for IE6/7 the compatibility mode was introduced.


            With regards to your app now, outside of IE6 issues is everything working OK now?

            • 33. Re: java.util.Vector cannot be cast to javax.faces.model.DataModel
              waltc
              The weird thing is, my mgr runs IE7 and I don't believe he ever had a problem seeing it. There was one little thing I figured out a circumvention for:

              The first column in the grid is date, the column header is "Date", the format of the data is yyyy-mm-dd. I believe all other browsers determine the width of a column by the largest width display,

              max(header, max(columns)). This clearly happens in FF. In IE (period) it is determined, the best I can tell, by the width of the header as every row displayed is

              yyyy
              -mm-
              dd

              It didn't matter what state compatibility mode was in. What I did was change the header to "----Date----" and it worked perfectly.

              Oh, one other thing that was only fixed by compat mode...
              On the spinner above, in FF the row was header <tab> control, as it was for all the other controls.

              Without compat controls all the other controls were header<tab>control but the spinner was

              header
              <tab>   control

              Until I looked at the source really closely I didn't realize it was different than what facelets did.

              There is a guy I work with that used to do Web UI for a living and he said what he ended up doing was to, for every last column manually specify the width and height. Doesn't that defeat the purpose of widgets? Shouldn't Richfaces do that or isn't it supposed to? Perhaps a css per browser engine or some such? Yes, you are correct, I am not a UX engineer. Again Tim, I greatly appreciate all your assistance on this.

              Walt
              • 34. Re: java.util.Vector cannot be cast to javax.faces.model.DataModel
                kragoth

                The first column in the grid is date, the column header is Date, the format of the data is yyyy-mm-dd. I believe all other browsers determine the width of a column by the largest width display,

                max(header, max(columns)). This clearly happens in FF. In IE (period) it is determined, the best I can tell, by the width of the header as every row displayed is

                yyyy
                -mm-
                dd

                It didn't matter what state compatibility mode was in. What I did was change the header to ----Date---- and it worked perfectly.


                This problem is more to do with IE's amazingly stupid idea of always wrap text to conserve space idea. Try adding this style to the header.


                style="white-space: nowrap;"
                



                If that doesn't work I'll have to write a test. Unless you can provide me with some standard html that I could use to work it out.



                Oh, one other thing that was only fixed by compat mode...
                On the spinner above, in FF the row was header <tab> control, as it was for all the other controls.

                Without compat controls all the other controls were header<tab>control but the spinner was

                header
                <tab> control

                Until I looked at the source really closely I didn't realize it was different than what facelets did.


                I've read that a few times now and I don't understand what you are trying to explain sorry :S

                • 35. Re: java.util.Vector cannot be cast to javax.faces.model.DataModel
                  waltc

                  That sure didn't come out right did it?


                  The spinner came out





                  label followed by a new line
                  tab control



                  such that the label was left aligned on row n and the control was indented on row n plus 1


                  Geeze this formatting tool is hideous.

                  • 36. Re: java.util.Vector cannot be cast to javax.faces.model.DataModel
                    waltc

                    btw Tim,
                       Should you ever need help setting up a private cloud, I'm your guy!

                    • 37. Re: java.util.Vector cannot be cast to javax.faces.model.DataModel
                      kragoth

                      Walt Corey wrote on Mar 21, 2011 21:20:


                      That sure didn't come out right did it?

                      The spinner came out



                      label followed by a new line
                      tab control



                      such that the label was left aligned on row n and the control was indented on row n plus 1

                      Geeze this formatting tool is hideous.


                      Could you show the content of the layout/display.xhtml. Maybe something in your template will give me a clue as to what's going on there.


                      And yes, this forum is rather horrible for formatting...but putting everything in backticks is probably your best bet.


                      Row1
                          Row2
                          Stuff in backticks keep their original spacing.
                      
                      So you had.
                      
                      Label
                      Component
                      
                      But you wanted
                      
                      Label Component
                      



                      Is that right?

                      • 38. Re: java.util.Vector cannot be cast to javax.faces.model.DataModel
                        waltc

                        Close, You are correct in what I was looking for and got for all but the spinner but what I got for the spinner was indented such it was below and to the right of label.


                        Here is the template (canned/stock display template).


                        display.xhtml in view/layout




                        <ui:composition  xmlns="http://www.w3.org/1999/xhtml"
                                         xmlns:ui="http://java.sun.com/jsf/facelets"
                                         xmlns:h="http://java.sun.com/jsf/html"
                                         xmlns:f="http://java.sun.com/jsf/core"
                                         xmlns:s="http://jboss.com/products/seam/taglib">
                        
                            <div class="prop">
                                <span class="name">
                                    <ui:insert name="label"/>
                                </span>
                                <span class="value">
                                    <ui:insert/>
                                </span>
                            </div>
                        
                        </ui:composition>
                        



                        1 2 3 Previous Next