If you have an updated Vaadin Eclipse plugin (version 1.3.1) you should be able to just create a new Vaadin project at the same location as your check out of the SQLContainer sources. This should then be deployable to e.g. Tomcat.
The included build.xml ant-script also packages a WAR file with the demos that can be deployed to your favorite container.
Is there coming in near future, any kind of fix for SQLContainer LazyLoading problem with Opera 11. When scrolling table, rows just won’t show properly. I think Table component had same kind of problem, but it is fixed. You can see what i mean just by scrolling SQLContainer
Sample application with Opera 11.
It is actually a problem in Opera 11 that has been worked around in Table in 6.5.0. It is not related to SQLContainer in any way and the reason it is visible in the SQLContainer demo application is that the demo still uses Vaadin 6.4.x.
Edit: Updated the demo to use 6.5.0 and still some extra scrollbars appear in Opera 11.01 (Opera 10.63 works fine). Hopefully the Opera team will get the browser to work correctly again soon. It is anyhow not a SQLContainer problem.
Hi I’m using SQLContainer with MYSQL database and I’m doing the SQLContainer’s tutorial.
My Application shows datas from database but when I calling table.setVisibleColumns(DatabaseHelper.NATURAL_COL_ORDER);
It’s gives me an error >>>
Ids must exist in the Container or as a generated column , missing id: FIRSTNAME
Please help me to solute my problem…
It’s my NATURAL_COL_ORDER
public static final Object[] NATURAL_COL_ORDER = new Object[]
{
"FIRSTNAME", "LASTNAME", "EMAIL", "PHONENUMBER", "STREETADDRESS",
"POSTALCODE", "CITYID" };
The “Ids must exist in the Container or as a generated column , missing id: FIRSTNAME” message means that SQLContainer doesn’t have such a property ID registered. This could be due to any number of things. For instance, the query that fills the SQLContainer might not contain the FIRSTNAME column. Or maybe the column’s name really is “firstname” (small characters instead of caps).
You could place a breakpoint on line 1170 in SQLContainer.java (cachedItems.put(id, new RowItem(this, id, itemProperties))) and inspect the value of itemProperties to see what properties have been registered with the container.
Perhaps we should add a debug message for this in a future release…
After I created and added a button. When I’m click the button It creates a Form and is adding an item(addItem()). Here is the code :
add.addListener(new ClickListener() {
public void buttonClick(ClickEvent event) {[color=#DE1717]
[/color]
//con.getContainer().removeAllContainerFilters();
try {
con.getContainer().rollback();
} catch (UnsupportedOperationException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
final Form myForm = new Form();
Object tempItemId = con.getContainer().addItem();
Item [color=#FD0000]
surce
[/color]= con.getContainer().getItem(tempItemId); // When my filter is on getting NULL ????
myForm.setItemDataSource(surce);
HorizontalLayout buttonsLayout = new HorizontalLayout();
Button save = new Button("save", new ClickListener() {
public void buttonClick(ClickEvent event) {
try {
con.getContainer().commit();
} catch (UnsupportedOperationException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
});
And as you have seen I also have a Filter, when It’s off-> My form works ok, But when I turning it on My form don’t get the
surce .
Please tell me how to solve my problem.
getItem only returns items that pass the filters, so you need to clear the filters before you can retrieve the Item and then re-filter the container. This is also how the stock Vaadin containers are implemented, however I see that this might be a case where SQLContainer perhaps could diverge from other containers or provide a method for bypassing the filtering… What do you think?
Please
create an enhancement ticket for such a feature if you’d like to have.
I think It would be better to have a such method to ease the query process.
And I also would like to know how does SQLContainer escaping works when I’m filtering. I have a login form where I’m retriving ID of my user by filtering my Login table. I’ve tried to write some data to login and password fields to get free access like ->> ’ OR ‘’ = '.
But the trick didn’t worked so I guessed that SQLContainer is using string escapes, but I would like to know how does this escapes work in SQLContainer and to know how do I have to write right filtering not to allow not well-wishers to get free access to my application and some data when they are searching in my database. I write my login filters like this:
Hi Again.
Thanks for fast reply. Now I’m relaxed about escaping, but I’m stil having a problem. I can’t write UTF-8 formated data to my database. Please tell me is there a way to enable UTF-8 writing in SQLContainer.
SQLContainer should not affect the charset in any way. Make sure that your DB is configured to use UTF-8. In some cases you need to specify this on the connection URL.