You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Francesco Consumi <co...@istitutodeglinnocenti.it> on 2004/11/02 15:55:25 UTC

again on ResultDataSet

Hi,

when I connect a ResultSet to a DataTable, I obtain this error:

javax.faces.FacesException: Not yet
implemented:javax.faces.model.ResultSetDataModel


these are the code fragments:
...bean.java

       try {
          rs1 = st.executeQuery("SELECT * FROM UTENTI"));
       } catch(SQLException e) {
           System.out.print(e.getMessage());
       }
     }
.....

index.jsf

<h:dataTable var="rows" value="#{mb.rs1}">
<h:column id="c1">
   <h:outputText value="#{rows.COGNOMENOME}"/>
</h:column>


.....


ideas ?
thanks.



--
Francesco Consumi
Ufficio Sistemi informativi
Istituto degli Innocenti
Piazza SS.Annunziata, 12
50122 Firenze
consumi at istitutodeglinnocenti.it
Tel. +39 055 2037320
ICQ# 12516133


Re: again on ResultDataSet

Posted by Mark Lowe <me...@gmail.com>.
Copying the properties into a list is better than all that reading a
result set into your view anyhow.

Sure allowing read access to a result set isn't the end of the world,
but copying it into a a list of beans would be my prefered way of
doing things even if the ResultSetModel were available.

If you like SQL in your view, then the JSTL sql tag lib is there at
your disposal. But personallty I dont like sql speak in my JSP in fact
seeing "row" mentioned in JSP (JSF or otherwise) gives me a nauseaous
sensation.

But if thats the way you like working, feed the result set to the jsp.
You could even to this in a backing bean for now and readdress later.

((HttpServletRequest)FacesContent.getCurrentInstance().getExternalContext().getRequest()).setAttribute("myresultset",rs);

Then use 

<f:verbatim>
.. some sql tag filth here
</f:verbartim>

Its not perfect, but is adequate.

Mark

On Wed,  3 Nov 2004 09:46:46 +0100, Francesco Consumi
<co...@istitutodeglinnocenti.it> wrote:
> Scrive Manfred Geiler <ma...@apache.org>:
> 
> > Hi Francesco, Hi all,
> > Yes, ResultSetDataModel is not yet implemented. It is not really
> > difficult to implement but my time is very limited at the moment. So, I
> > encourage you or any other interested developer to implement it. Could
> > be done in about 2-3 man hours, I think.
> > Francesco, thanks for your confidence and: you are just kidding about
> > the ASP.NET thing, arent' you ?!  ;-)
> >
> 
> Sure I do.. :-)
> I would provoke the java coder's susceptibility......
> 
> I'll wait for the implementation of ResultDataSet. I apologize, but I'm
> not able
> to help you in that work, I'm not a so good java programmer......
> 
> --
> Francesco Consumi
> 
>

Re: again on ResultDataSet

Posted by Francesco Consumi <co...@istitutodeglinnocenti.it>.
Scrive Manfred Geiler <ma...@apache.org>:

> Hi Francesco, Hi all,
> Yes, ResultSetDataModel is not yet implemented. It is not really
> difficult to implement but my time is very limited at the moment. So, I
> encourage you or any other interested developer to implement it. Could
> be done in about 2-3 man hours, I think.
> Francesco, thanks for your confidence and: you are just kidding about
> the ASP.NET thing, arent' you ?!  ;-)
>

Sure I do.. :-)
I would provoke the java coder's susceptibility......

I'll wait for the implementation of ResultDataSet. I apologize, but I'm 
not able
to help you in that work, I'm not a so good java programmer......

-- 
Francesco Consumi


Re: again on ResultDataSet

Posted by Manfred Geiler <ma...@apache.org>.
Hi Francesco, Hi all,
Yes, ResultSetDataModel is not yet implemented. It is not really
difficult to implement but my time is very limited at the moment. So, I
encourage you or any other interested developer to implement it. Could
be done in about 2-3 man hours, I think.
Francesco, thanks for your confidence and: you are just kidding about
the ASP.NET thing, arent' you ?!  ;-)

Manfred


Francesco Consumi wrote:
> Scrive Mark Lowe <me...@gmail.com>:
> 
>> Francesco
>>
>> I think you'd need to read the result set into something you can
>> display as judging by the message myfaces ResultSetDataModel isn't
>> implemenated in myfaces yet..
>>
>> That or use sun's implemenation which I imagine does. Myfaces
>> componants (at least the ones i've tried) work with sun's
>> implementation. But I imagine a list will should work just fine.
>>
> Mark,
> 
> thanks for the answer. I know that it works if I copy the ResultSet into 
> a list,
> but in that way the jsf technology is useless :-) .
> I can't write tons of code only in order to show a grid linked to a 
> dataset..
> :-), don't you think ?
> 
> Now, I'm able to understand why the people chooses ASP.NET.. :-)
> 
> I'm very grateful to those that are working hard writing MyFaces, but I 
> think
> the work is still a bit long........
> 
> -- 
> Francesco Consumi
> 
> 
> 
> 
> 


Re: again on ResultDataSet

Posted by Manfred Geiler <ma...@apache.org>.
Hi Francesco, Hi all,
Yes, ResultSetDataModel is not yet implemented. It is not really
difficult to implement but my time is very limited at the moment. So, I
encourage you or any other interested developer to implement it. Could
be done in about 2-3 man hours, I think.
Francesco, thanks for your confidence and: you are just kidding about
the ASP.NET thing, arent' you ?!  ;-)

Manfred


Francesco Consumi wrote:
> Scrive Mark Lowe <me...@gmail.com>:
> 
>> Francesco
>>
>> I think you'd need to read the result set into something you can
>> display as judging by the message myfaces ResultSetDataModel isn't
>> implemenated in myfaces yet..
>>
>> That or use sun's implemenation which I imagine does. Myfaces
>> componants (at least the ones i've tried) work with sun's
>> implementation. But I imagine a list will should work just fine.
>>
> Mark,
> 
> thanks for the answer. I know that it works if I copy the ResultSet into 
> a list,
> but in that way the jsf technology is useless :-) .
> I can't write tons of code only in order to show a grid linked to a 
> dataset..
> :-), don't you think ?
> 
> Now, I'm able to understand why the people chooses ASP.NET.. :-)
> 
> I'm very grateful to those that are working hard writing MyFaces, but I 
> think
> the work is still a bit long........
> 
> -- 
> Francesco Consumi
> 
> 
> 
> 
> 


Re: again on ResultDataSet

Posted by Francesco Consumi <co...@istitutodeglinnocenti.it>.
Scrive Mark Lowe <me...@gmail.com>:

> Francesco
>
> I think you'd need to read the result set into something you can
> display as judging by the message myfaces ResultSetDataModel isn't
> implemenated in myfaces yet..
>
> That or use sun's implemenation which I imagine does. Myfaces
> componants (at least the ones i've tried) work with sun's
> implementation. But I imagine a list will should work just fine.
>
Mark,

thanks for the answer. I know that it works if I copy the ResultSet 
into a list,
but in that way the jsf technology is useless :-) .
I can't write tons of code only in order to show a grid linked to a dataset..
:-), don't you think ?

Now, I'm able to understand why the people chooses ASP.NET.. :-)

I'm very grateful to those that are working hard writing MyFaces, but I think
the work is still a bit long........

--
Francesco Consumi




Re: again on ResultDataSet

Posted by Mark Lowe <me...@gmail.com>.
Francesco

I think you'd need to read the result set into something you can
display as judging by the message myfaces ResultSetDataModel isn't
implemenated in myfaces yet..

That or use sun's implemenation which I imagine does. Myfaces
componants (at least the ones i've tried) work with sun's
implementation. But I imagine a list will should work just fine.

private List userList = new ArrayList();


UserBean user;;
while(rs... ) {
      user = new UserBean()
      user.setCognome(.. );
       this.userList.add(user);
.. 
}

public List getUsers() {
   return this.userList;
}


<h:dataTable var="userBean" value="#{mb.users}">
<h:column>
  <h:outputText value="#{userBean.cognome}"/>
</h:column>


Mark

On Tue,  2 Nov 2004 15:55:25 +0100, Francesco Consumi
<co...@istitutodeglinnocenti.it> wrote:
> Hi,
> 
> when I connect a ResultSet to a DataTable, I obtain this error:
> 
> javax.faces.FacesException: Not yet
> implemented:javax.faces.model.ResultSetDataModel
> 
> these are the code fragments:
> ...bean.java
> 
>        try {
>           rs1 = st.executeQuery("SELECT * FROM UTENTI"));
>        } catch(SQLException e) {
>            System.out.print(e.getMessage());
>        }
>      }
> .....
> 
> index.jsf
> 
> <h:dataTable var="rows" value="#{mb.rs1}">
> <h:column id="c1">
>    <h:outputText value="#{rows.COGNOMENOME}"/>
> </h:column>
> 
> .....
> 
> ideas ?
> thanks.
> 
> --
> Francesco Consumi
> Ufficio Sistemi informativi
> Istituto degli Innocenti
> Piazza SS.Annunziata, 12
> 50122 Firenze
> consumi at istitutodeglinnocenti.it
> Tel. +39 055 2037320
> ICQ# 12516133
> 
>