incubator-adffaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Adam Winer" <awi...@gmail.com>
Subject Re: Fwd: [jira] Reopened: (ADFFACES-445) Converters not working , Javascript error occuring on submit
Date Tue, 17 Apr 2007 16:40:12 GMT
Safurudin,

Trinidad HTML source should always have something like:

<script>var _reset_idJsp1Names=["source"];</script><script>function
__idJsp1Validator(){return true;}var _idJsp1_SF={};</script>

... near the end.  Yours doesn't.  By any chance, do
you have:
   <client-validation-disabled>true</client-validation-disabled>
in your trinidad-config.xml?  If so, does the problem go away when
you remove it?

-- Adam


On 4/17/07, Safurudin Mahic <safurum@stud.hist.no> wrote:
> Adam,
>
> I wasn't sure how to do the Firebug breakpoint thingy,
> I've attached the generated HTML code instead.
>
>
> -- Safi
>
> Adam Winer skrev:
> > Safurudin,
> >
> > I still can't reproduce this.  What you're doing should work
> > without hitch;  you're not supposed to have to code anything
> > differently.  With the latest trunk, Firefox 2.0.0.3, and the following
> > page:
> >
> > <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0"
> >          xmlns:f="http://java.sun.com/jsf/core"
> >          xmlns:tr="http://myfaces.apache.org/trinidad" >
> >  <jsp:directive.page
> contentType="text/html;charset=utf-8"/>
> >  <f:view>
> >   <tr:document>
> >    <tr:form id="form1">
> >      <tr:inputText value="#{data.int}"/>
> >      <tr:outputText value="#{data.int}"/>
> >      <tr:commandButton text="Submit"/>
> >    </tr:form>
> >   </tr:document>
> >  </f:view>
> > </jsp:root>
> >
> > ... everything works fine for me.
> >
> > To get to the bottom of this, I'll need your help to
> > look into the Javascript and see what's going wrong.
> > For example, install Firebug and put a breakpoint
> > in this code.  Or, if you can't do that, maybe e-mail
> > me the HTML generated by this simple page?
> >
> > The lines where you're getting the error are:
> >
> > var converter=eval(converterConstructor);
> > try{
> >  value=converter.getAsObject(value,label);
> > }
> > catch(e)
> > {
> >  converterError=true;
> >  if(firstFailure)
> >  {
> >    _setFocus(currInput);
> >    firstFailure=false;
> >  }
> >  var errorString1=e.getFacesMessage().getDetail();
> > ...
> > }
> >
> > ... and if "e" doesn't have a FacesMessage, that means
> > there *is* an exception being thrown, but it's somehow not
> > of the right type.  Which is very, very strange - "converter"
> > here should be an instance of TrIntegerConverter,
> > which only throws TrConverterException.
> >
> > If anyone else on the list has reproduced this bug
> > and can help out, please do. :)
> >
> > -- Adam
> >
> >
> >
> > ---------- Forwarded message ----------
> > From: Safurudin Mahic (JIRA)
> <adffaces-issues@incubator.apache.org>
> > Date: Apr 15, 2007 3:37 AM
> > Subject: [jira] Reopened: (ADFFACES-445) Converters not working ,
> > Javascript error occuring on submit
> > To: awiner@gmail.com
> >
> >
> >
> >     [
> >
> https://issues.apache.org/jira/browse/ADFFACES-445?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
> >
> > ]
> >
> > Safurudin Mahic reopened ADFFACES-445:
> > --------------------------------------
> >
> >
> > With a clean browser cache - using both Firefox (2.0.3) and IE7,
> > latest trunk I get this error on both the
> > convertValidate/convertValidate.jspx
> > and a simple file with a single <tr:inputText> component, bound to an
> > integer/long value in a backing bean.
> >
> > The simple file looks something like this:
> >
> > <tr:document>
> > <tr:form id="form1">
> >   <tr:inputText value="#{TestBean.intVal}"/>
> >   <tr:outputText value="#{TestBean.intVal}"/>
> >   <tr:commandButton text="Submit" action="success"/>
> > </tr:form>
> > </tr:document>
> >
> > This causes the earlier mentioned JavaScript error, which I suspect
> > comes from that Trinidad is trying to validate the field with
> > JavaScript before submittal of the form. But when the JavaScript
> > produces an error, the form is never submitted.
> >
> > However, I see that when I attach a converter to the <tr:inputText>
> > component, something like <tr:inputText value="#{TestBean.intVal}"
> > converter="javax.faces.convert.IntegerConverter">
> component, this
> > seems to resolve the issue in my simple form.
> >
> > The issue with the demo application still remains though,
> > convertValidate/convertValidate.jspx has attached
> <f:convertNumber> to
> > its fields, but here I still get the JavaScript error.
> >
> > Conclusion:
> >
> > <tr:inputBox> used without a converter for values of type Integer/Long
> > etc produces a JavaScript error
> >
> > <tr:inputBox> used with an explicit converter for the required
> > datatype works fine.
> >
> > <h:inputBox> used without a converter works fine, and is able to
> > convert automatically to these datatypes, with built-in converters.
> >
> > This issue is confusing, because you are never required to use
> > explicit converters with <h:inputText> components for these datatypes,
> > since MyFaces and the vanilla version of JSF have these converters
> > built-in (IntegerConverter, LongConverter etc). I guess, I was
> > expecting Trinidad having a similar behaviour, using the built-in
> > converters of MyFaces. How is Trinidad supposed to behave? Should
> > expected behaviour be documented somewhere?
> >
> >
> >
> >> Converters not working , Javascript error occuring on submit
> >>
> ------------------------------------------------------------
> >>
> >>                 Key: ADFFACES-445
> >>                 URL:
> https://issues.apache.org/jira/browse/ADFFACES-445
> >>             Project: MyFaces ADF-Faces
> >>          Issue Type: Bug
> >>          Components: Components
> >>    Affects Versions: 1.0.1-incubating-core-SNAPSHOT
> >>            Reporter: Safurudin Mahic
> >>         Assigned To: Adam Winer
> >>            Priority: Blocker
> >>
> >> When using a Trinidad InputBox bound to an eg. Long value in a backing
> >> bean, such as in the demo application (convertValidate.jspx), when
> >> trying to submit the form,
> >> one gets a javascript error :
> >> e.getFacesMessage is not a function
> >>  var errorString1=e.getFacesMessage().getDetail();  (Common11-m7.js,
> >> line 4650)
> >> This only affects the Trindad InputBox component, the myfaces version
> >> is working properly.
> >> This basically means that one cannot bind InputBox components to
> >> values other than a String.
> >
> > --
> > This message is automatically generated by JIRA.
> > -
> > You can reply to this email to add a comment to the issue online.
>
>
>
>
>
>  Your name Submit Real housewives write extensions.
>

Mime
View raw message