Back to Four Js Website
Four Js Customer Forum
Subscribe for automatic updates:
RSS
Sign in for full access
|
Help
Four Js Development Tools Forum
>
Discussions by product
>
Genero BDL
>
How do you set default for form field dynamically?
Most recent posts
Pages: [
1
]
« previous
next »
Reply
|
Print
Author
Topic: How do you set default for form field dynamically? (Read 11010 times)
Candy M.
Posts: 139
How do you set default for form field dynamically?
«
on:
October 25, 2008, 12:37:01 am »
We would like to set the default for a form field dynamically.
Are there any methods like setFieldHidden(), etc?
We would like to search through DOM tree and set the default.
Any help is appreciated.
Thanks,
Candy
Sebastien F.
Posts: 545
Re: How do you set default for form field dynamically?
«
Reply #1 on:
October 27, 2008, 10:01:16 am »
Candy,
I let support people write you an example using the OM interface.
The attribute to be set is "defaultValue", in FormField, Matrix or TableColumn nodes.
Some questions:
- Why don't you use WITHOUT DEFAULTS option and set the field default values in program variables?
- Are you using multiple dialogs (DIALOG instruction)?
Seb
Candy M.
Posts: 139
Re: How do you set default for form field dynamically?
«
Reply #2 on:
October 27, 2008, 08:29:29 pm »
Seb,
We do use INPUT WITHOUT DEFAULTS now and set it in
program variables.
What we would like to do is provide a utility so that user
can hide fields, activate/inactivate fields, and set their own
defaults. I thought it might be easier setting the defaults
in the DOM tree and more general so that the code we use, we
could use everywhere and not depend on setting program
variables.
Candy
Sebastien F.
Posts: 545
Re: How do you set default for form field dynamically?
«
Reply #3 on:
November 01, 2008, 05:14:14 pm »
Candy, (sorry for the late answer)
I would not use the AUI tree to implement an application feature like customizable default values.
From my understanding, it's just a matter of default value storage.... right?
Why don't you just use a simple database table like:
CREATE TABLE user_defaults
(
target_name VARCHAR(50) NOT NULL,
user_name VARCHAR(50) NOT NULL,
value VARCHAR(100),
PRIMARY KEY (target_name, user_name)
)
And write some API around to get/set the values?
CALL defaults_setValue("order.ord_state", user_name, "valid")
LET rec_order.ord_state = defaults_getValue("order.ord_state", user_name, <default-default>)
The get function would need to interpret special values like TODAY, and return a default-default value if nothing found in table:
SELECT value INTO p_value FROM user_defaults
WHERE target_name = name AND user_name = uname
IF SQLCA.SQLCODE == NOTFOUND THEN RETURN default_default END IF
IF p_value == "TODAY" THEN RETURN TODAY END IF
IF p_value == "CURRENT" THEN RETURN CURRENT END IF
RETURN p_value
?
Seb
Candy M.
Posts: 139
Re: How do you set default for form field dynamically?
«
Reply #4 on:
November 02, 2008, 06:06:55 am »
Thanks, Seb for your input.
When setting the values on the form, I wanted to
avoid having to set it to a program variable. I thought
it would be nifty to have one function that I could call
and set the default values in the AUI tree instead of
having to set the program variables, thus saving on
lots of code.
Candy
Pages: [
1
]
Reply
|
Print
« previous
next »
Jump to:
Please select a destination:
-----------------------------
General
-----------------------------
=> General Discussion
=> Ask Reuben
=> WWDC21
-----------------------------
Discussions by product
-----------------------------
=> Products announcements
=> Genero BDL
=> GWS
=> GAS and GBC
=> GDC
=> Genero Mobile for Android or iOS
=> Genero Studio
=> Reporting tools (GRW, GRE)
-----------------------------
Jobs
-----------------------------
=> Jobs
Powered by SMF 1.1.21
|
SMF © 2015, Simple Machines
Loading...