Great app! Need some advise on form customization.

A place for users and developers of the Xataface to discuss and receive support.

Postby alexst » Thu Feb 08, 2007 6:37 pm

First of all thanks for the great piece of software.

I have a small problem that's nearly driving me insane. The way I am trying to use Dataface is pretty straightforward - I have a MySQL database ready, installed through the makesite script and voila, Add / Edit / Del works just fine and is basically all that I am looking for. However on the Add new record Form there is one field out of place due to an align="right" tag. I tried tinkering the fields.ini to no avail. I spent the past 2 days reading the docs here and trying out few things, but this dreaded tag is still there. What would be the easiest/fastest fix.

Some details:

There are about 20 fields one below the other lined up to the left - all this by default, the third one is of type DATETIME and shows almost in the middle of the page, here's the HTML source:




Timestamp



alexst
 
Posts: 7
Joined: Wed Dec 31, 1969 5:00 pm

Postby alexst » Fri Feb 09, 2007 12:57 pm

Update: changing the MySQL data type of the field from DATETIME to TEXT fixes the layout issue, however this is not acceptable solution, plus the autocomplete feature doesn't work from me on Opera 9.1, while in IE 7 it does its job.
alexst
 
Posts: 7
Joined: Wed Dec 31, 1969 5:00 pm

Postby shannah » Fri Feb 09, 2007 1:53 pm

Certainly changing a date field to a Text field is no solution.Ê The issue is:

Edit forms are laid out in tables with 2 columns.Ê The left column is the field label (aligned right) and the right column is the widget (aligned left).Ê EXCEPT for TEXT fields which (because they likely contain more content) are laid out with colspan=2 (i.e. it spans both columns with label just above the field).

This may look funny if you have some really long labels for your fields.Ê This will push the label column to be far too big and your non-textarea widgets will appear quite far right on the page.

Solution: Use CSS to force the label column to be narrower.Ê In Dataface 0.6.13r3 and earlier this may be tricky because the tables/td tags in the edit forms don't have CSS selectors to be able to easily manipulate them.Ê I have added CSS classes in the templates for 0.6.13r4 and set the label columns to be 25% width all the time.Ê You can override this with your own stylesheet though.

I have uploaded a patch to upgrade from previous versions to the latest version at http://framework.weblite.ca/development/issue-tracker/146

These changes will also be included in the next release on sourceforge when that happens.


-Steve

--
Steve Hannah
@shannah78 (on twitter)
sjhannah.com blog
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Postby alexst » Fri Feb 09, 2007 4:38 pm

Thank you Steve, I will give it a try.

PS Yes, I do have some quite long labels :)
alexst
 
Posts: 7
Joined: Wed Dec 31, 1969 5:00 pm

Postby alexst » Mon Feb 12, 2007 5:02 pm

OK :) I am almost there where I wanna be . . . just a quick note on my progress that might be useful to others. I have long labels and lots of fields - after the last patch (mentioned above) the long field names are ok, but then I wanted to use grouping and there the width is fixed in plone.css like:

.groupFieldLabelWrapper
...
width: 150px;
...

and this caused some unappealing messy formatting of my long named fields, solved it by replacing the default css width entry with "width: 50%;
".
alexst
 
Posts: 7
Joined: Wed Dec 31, 1969 5:00 pm


Return to Xataface Users

Who is online

Users browsing this forum: No registered users and 34 guests

cron
Powered by Dataface
© 2005-2007 Steve Hannah All rights reserved