PDA

View Full Version : MultiLine Input problem


FoxLeader
01-13-2008, 10:04 PM
I have a project I'm working on as a part of my WanUI series and a little detail is making me angry ( Grrrrrrrrrr! ). I need to dynamically create an input object and put it multiline -but it doesn't seems to work. I tried in AMS6 and in the AMS7 demo, but none works.

Here's that code:

--//Gets the current object properties of the paragraph
Paragraph_Properties = Paragraph.GetProperties(this);
--//Creates the corresponding input
Page.CreateObject(OBJECT_INPUT, "Editor", Paragraph_Properties);
--//Sets multiline, since it is a paragraph
Paragraph_Properties = {}
Paragraph_Properties.MultiLine = true;
Paragraph_Properties.VScrollbar = true;
Input.SetProperties("Editor", Paragraph_Properties);

Doesn't works for everything (in fact, averything but VScrollbar and MultiLine. I tried with the following too, on an blank project without more sucess:
-- //Create properties table (only include items that should be changed)
tProperties = {};
tProperties.MultiLine = true;
tProperties.VScrollbar = true;
tProperties.Text = "I am new text!!!";

--// Set the properties of an input object
Page.CreateObject(OBJECT_INPUT, "Input", tProperties);

That last one worked to change the text, but not to set it multiline.

Any help appreciated :)
Regards,
FoxLeader

holtgrewe
01-14-2008, 07:36 AM
Confirmed on AMS6 here.
I created the input object and reset the properties after creation and it still failed to establish Multi-Line and Vscroll.
Appears to be a bug.

TimeSurfer
01-14-2008, 12:55 PM
I'm not to familiar with php but I did try this in ams6 and 7 and it worked fine. Perhaps it will help you.

-- Input object properties table.
tblInputProps = {};
tblInputProps.Text = "I am new text!!!";
tblInputProps.VScrollbar = true;
tblInputProps.Multiline = true;
Page.CreateObject(OBJECT_INPUT, "Editor", tblInputProps);

it did make the input object multiline and added the VSscrollbar. I tested the code in a function under globals and as just plain code in preload event. although you should prob set the pos of the object as it just creates it in the topleft corner with the code above. but all is tested and working. I did however notice that if you set the text of the object and you want it to be multiline you need to use carriage returns so that it will split the text into lines =p

FoxLeader
01-14-2008, 03:43 PM
Well... it's not php. It's just saying this by default, and I'm using tags instead of [code] tags only because the first one has coloration. Anyway. That's not important ;)

I tried the code you provided and it works, so it seems real strange...

Ok, I looked a little bit and I foud the difference:

What I used:
[PHP]
.MultiLine = true;


What you used:
.Multiline = true;

The difference? The "L". I used it with caps, and you didn't. However, in the helpfile, it's written with a maj. It should only be corrected in the helpfile :)

Regards,
FoxLeader

TimeSurfer
01-14-2008, 05:19 PM
Glad I could help Fox, hopefully the devs will read this and it will get corrected.

FoxLeader
01-14-2008, 05:38 PM
Thanks TimeSurfer ;)
That probably saved me a lot of time. I had already lost enough just for this issue.