Delphi form won't open - forms

Just open my IDE (Delphi XE5) to continue coding and I got an error (never experienced similar error !) on creating one form, due to field not found on a Tdbedit. Checked the Table is OK and so the field. Having no access to the form I
am almost stump as I cannot edit the form. Before destroying the unit to start from scratch, as the form re-design would take time, can someone give an hint at least how to preserve the form drawing ? Thanks

You should find a yourFormName.dfm file in your project folder. This is simply a text file containing the attributes for all of the form controls. You may well be able to correct your form by editing in wordpad (or insert you favourite editor).
object DBText1: TDBText
Left = 40
Top = 48
Width = 65
Height = 17
DataField = 'quoteref'
DataSource = DataModule1.DSQuoteDetail
end
As you can see the datafield and datasource are both present.

Related

Cause one textbox to validate other textboxes/dropdowns

I am trying to make a form textbox in PowerShell in which I can paste data into the first textbox and have it auto populate to several other fields when I hit Tab.
I managed to get that part working fine, but the various validation steps that those other fields normally have don't work when filled out in this way.
Here's a sample of what I am talking about:
$InputTextBox.Add_Validating(CODE SEGMENT 1)
$DescriptionTextBox.Add_Validating(CODE SEGMENT 2)
$SplitComboBox.Add_Validating(CODE SEGMENT 3)
Is there anything I can put in CODE SEGMENT 1 to trigger CODE SEGMENT 2 and CODE SEGMENT 3 to run as well? Is there another way to do this with a different approach?
Edit:
When I tab out of $inputTextBox, it splits up the input there and distributes it to the other fields with $DescriptionTextBox.Text = $Description and $SplitComboBox.SelectedItem = $Split.
When that is done though, the values entered do not trigger the contents of Add_Validating() to run.

Wrap a DIV around every table | FE with TS

i want to wrap a DIV around every content table in FE.
The table is setting in a normal Text-Conentelement.
Know everyone who can i do this with TS?
I found only configurations for single CEs, not an special content item, like a .
Thank you for help
If you want to change the FE rendering when you use css_styled_content, you have to know that all is done in this file:
typo3/sysext/css_styled_content/static/setup.txt
here you'll find:
tt_content.table = COA
tt_content.table {
10 = < lib.stdheader
20 = USER
20.userFunc = TYPO3\CMS\CssStyledContent\Controller\CssStyledContentController->render_table
20.field = bodytext
...
20.innerStdWrap.wrap = |
}
Don't do your changes here, copy what you need in your own setup file (internal in a template object or include it from an external file)
Else your changes will be lost after a core update
And know that you are here in the css_styled_content world, take the time to look around and try to understand what most of the code is doing. It will help you a lot if you ever need to change the FE output

Setting the controlsource value of a listbox using Properties Window

I am new to VBA and am currently still studying the most basic ideas of the language. I haven't gotten that far in my VBA Code studies to write the code I need by hand, so, in the mean time, I have been using the VBA Editor to enter Property Values via the Properties Window. This has been proving far more difficult than I anticipated. My Goal is to create a drop down list for a VBA Form. I understand one of my options is to reference a range of cells in my excel worksheet by inputting it into the value field located right of the ControlSource Property. My attempts to input the desired range always comes up with the same error:
Could not set the ControlSource Property. Invalid Property Value.
I have tried looking in the VBA Help files and even searched online. I haven't had any luck finding the proper syntax to enter into this field.
I am assuming I may run into similar issues as I try to set other property values through the Property Window. Thus, I am diligently studying my VBA courses so I can simply write the raw code. But that takes time and I need this form to work as soon as possible.
Is there anyone out there that wouldn't mind lending me their brain for a moment? I would be most grateful. Having this working would bring a lot of stress off of me.
Thanks for reading!
What tigeravatar mentioned, works fine for me, for the ComboBox as well for the ListBox.
If I enter =a1:b5 into the ComboBox' RowSource, I see the values of the cells if I open the form and the Combobox. Tigeravatar's notation with $ and sheet! may be more reliable for the productive version.
The RowSource is where the boxes get their displayed items from. The ControlSource is where the chosen value finally is linked to. So if I write just A10 to the ControlSource, then open the form, then pick a value, close the form, I see the chosen value filled to the Excelsheet field A10.
Sometimes it helps to start a fresh UserForm and to add some simple fresh controls. If you seek around, you will probably alter property values that influence the behaviour in an unexpected way, and then you get lost. I have tested with Office 2010. If you have another version, it may be important to forum readers to know.

Is fpdi shrinking template and/or adding whitespace?

Using FPDI, I first use a template to create a table of contents. I then import additional pages, which are linked to by the table of contents. What I'm experiencing is that FPDI is shrinking the templates and possible adding white space. I believe I have eliminated any browser added whitespace/shrinkage by merging the same documents into one via the passthru() command.
I have pasted code here: http://pastebin.com/VeLEN8nz. Line 45 - 57 is where the Table of Contents gets included as a template file.
The original file is here: http://truckingshow.com/TOC.pdf
The post-FPDI file is here: http://truckingshow.com/TOC-afterFPDI.pdf
The most noticeable difference is in the right and bottom margins.
Thank you for taking a look, please let me know if I can provide more info.
The document that was given to me was "Letter", not "A4" (the default for FPDF())
Instead of $pdf = new FPDI('P', 'pt') Simply using $pdf = new FPDI('P', 'pt', 'Letter') solved the problem.
Thanks!

Zend Framework Dynamically added fields of a form and populate

I have been attempting to create a form where a user can simply press a button and the form will add a new field for the user to use. I have 2 of these dynamically added field types.
Firstly a field where a user can upload files, by pressing the add button another field is pasted underneath the current field and is ready for use.
I have followed an old guide on how to get this done with a bit of ajax and jQuery.
This guide to be exact: http://www.jeremykendall.net/2009/01/19/dynamically-adding-elements-to-zend-form/
As you can see it's from 2009 and a bit outdated yet it still works under the current Zend Framework version 1.11.11
The problem however arises now that i want an edit / update version of the form. I need to populate it's fields but first of all i need to create enough fields for the data to be stored in. So when there's 3 files that have been uploaded it should create 2 additional fields and place the 3 file names in these fields ready to be edited and updated. Simply using $form->populate($stuff) is not going to work
I just have no idea how to accomplish this and the tutorial on dynamically added fields only goes as far as the addAction and not how to create the editAction under these conditions.
Is there any tutorial out there on how to create and manage forms such as these? I'm sure i am not the only one who's had the idea to builds these kind of forms?
I can add my code if there's a request for it but it's the same as the example from the guide, just a different set of elements in the form.
Adding a small example of it's use.
A user adds an item with 3 files, these files are uploaded along with a filename so in the database it appears like this : File_Id : '1' , File_Name : 'SomeFile' , File_location : 'somewhere/on/my/pc/SomeFile.txt'.
Now the user realizes he forgot a file or wants to delete a file from that list, he goes to the edit page and here i want the form to display the previously added filenames. So if there's 3 files it shows 3 and when there's 2 it shows 2 etc. How do i build a form to dynamically add fields based on the number of uploaded files and then populate them?
Any advice on how to handle this is well appreciated :)
You can make use of the semi-magic setXxx() methods of the form.
Inside the form:
public function setFiles($files) {
foreach ($files as $file) {
$this->addElement(/* add a file element */);
//do other stuff, like decorators to show the file name, etc.
}
}
In your controller:
$files = $model->getFiles();
$form = new Form_EditFiles(array('files' => $files));
By passing an array with key files you will make the form try to call the method named setFiles(), which you have conveniently provided above.
This should push you in the right direction, or so I hope at least.
If I understand you correctly you want to populate file upload fields, which is not possible because of security reasons.
Edit:
You can add Elements inside of the Controller via $form->addElement() (basicly just like the $this->addElement() statements in the Tutorial)