newhck / php-form-builder-class

Automatically exported from code.google.com/p/php-form-builder-class
GNU General Public License v3.0
0 stars 0 forks source link

Setting Width of Textbox not setting width of Text Label (pfbc-element) #153

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.Create a form
2.Use Grid style
3.Put 4 text fields in a row
4. Set the width of on of the fields to something specific

$form->addElement(new PFBC\Element\Textbox("Label2", "Text2",
    array(
            "style" => "width: 200px;")
    ));

What is the expected output? What do you see instead?

I expected to see BOTH the text box itself and the pfbc-element be set to 200px.

What is see is JUST the text box being set to the new width.

What version of the product are you using? On what operating system?
    Version: 2.1
    Released: May 15, 2011
Windows 7 using uWamp
PHP 5.3.5

Please provide any additional information below.

GREAT CLASS!  I am enjoying it and learning from it all the time.  
I don't think this is a bug, I am just hoping there is an easy way around it.

What I am trying to do is have different length input fields on the same row. I 
can adjust the text fields, but if I make one longer then all the others it 
overruns the next field.  

Looking at this I saw that the pfbc-element width appears to be the form 
width/# of fields (approx).

What I get is:

Label1(width 147)    Label2 (width 147)    Label3 (width 147)    Label4 (width 
147)
Text1 (width 147)    Text2 (width 200)     Text3 (width 147)     Text4 (width 
147)

Text2 runs into Text3

Thanks!

Original issue reported on code.google.com by jb13bobi...@gmail.com on 30 Aug 2011 at 4:19

GoogleCodeExporter commented 8 years ago
Currently, the Grid layout class will divide the form's width by how many 
elements on in a given row - as you've mentioned above.  Currently, there's no 
built-in way to override this and create a row of elements with varying widths.

That being said, I think this functionality would make a great addition to the 
project.  Is this something you would be interested in working on?  Let me know 
and I can assist with any questions you may have.

- Andrew

Original comment by ajporterfield@gmail.com on 30 Aug 2011 at 5:48

GoogleCodeExporter commented 8 years ago
Hi Andrew,
Thanks for the quick reply.

Sure, I will give it a try and see what I can come up with to add this 
functionality.

What is the best way to communicate with you?

Regards,
Joseph

Original comment by jb13bobi...@gmail.com on 31 Aug 2011 at 11:34

GoogleCodeExporter commented 8 years ago
Joseph,

I know we've been emailing privately regarding this issue, but I also wanted to 
document in this issue thread for future readers.

r539 added support within the Grid view class to adjust an element's container. 
 This is handled by using the newly added "width" property of the abstract 
Element class (which is inherited by all concrete elements).

This new feature will be rolled our with the 2.3 version release.

- Andrew

Original comment by ajporterfield@gmail.com on 13 Sep 2011 at 10:22