Friday, October 19, 2012

Demo-Combobox



1
 start>Programs>HTML5 Builder>Demos>
This opens a directory
C:\Users\Public\Documents\HTML5 Builder\5.0\Demos\ComboBox


Once again I face an issue / concern.
Logically I would have thought that double clicking on the project file would open the project but all it opens is the readme file.

So I try double clicking on index.php


This looks hopeful


It Works!



=====================================================


So now l will have a go at reverse engineering it.  A pity that there is no info as far as I can see on HOW this works.

1
Create a new blank project
New > Server Web Application
OK So far.
2
On the right hand side, expand the +Standard section
Find the Combobox
drag and drop two of them onto the canvas.
Also drag and drop two labels


 3



 Single click each label in turn.
In the obect inspector (bottom left of your screen), scroll down and find 'Caption'.
Change the Caption to "Combo1"
Note also that the label has a 'Name' =  "Label1" - Leave that as Label1

Similarly change the Caption of label2 to "Combo2"

So now we have two labels:
Name: Label1      Caption: "Combo1"
Name: Label2      Caption: "Combo2"








4
 Prepopulate ComboBox1 with some data
In the object Inspector, scroll down until you find the "Items" key.
Click on it and look at the right. Click on the three ... in white.
The "Value List Editor Opens.













5
In my newly created screen, when I single click on the combo box and then go to the Object inspector
the OnChange thing is blank.

In the demo
Object Inspector for ComboBox1 >>Onchange Sows ComboBox1JSC
Drop down and also see Combobox1Click













On the left I show the code from the embarcadero demo.
On the right I show the code from the screen as entered above.
The differences are in RED.
On the left at line 17, we note that we jump out pf php with a ?> and back into PHP again at line 39 <?PHP.











So the questions I have for myself are:
"Do I have to write the function ComboBox1JSChange($sender, $params)?"
and
"How do I know HOW to do this?"
WHY
is some of it jumped out of PHP?


2 comments:

  1. Did you ever get this going, or at least able to use it for anything ?

    ReplyDelete
  2. Hi leonzk,
    I work on this in fits and starts so I will have to get back to it.

    The short answer is "no" but only due to lack of time and I find the docs to have a lot of WHAT and not much on the HOW to.

    Frank

    ReplyDelete