Hi Team bizzworxx,
today, I upgraded to version 2022.12.09
After the update ... I have now an issue with getValue() ... everything worked ok with the previous version 2021.07.29
Example:
var dv = AppGiniHelper.DV;
var ACTION = AppGiniField('ActionR').getValue(); ... not work now
Does the syntax changed in the new version ?
Thank's for your help
AppGiniField('field').getValue() ... with version 2022.12.09
-
- Posts: 5
- Joined: 2021-12-07 17:58
Re: AppGiniField('field').getValue() ... with version 2022.12.09
Can you please give me more details:
- Datatype settings of that field "ActionR"
- Does the problem occur in readonly- or in edit-mode?
- What is the expected result and what is the actual return value?
- Is it on load or later on? For lazy-loaded fields (like lookups) you will have to wait for them.
- Are there any (red) error messages in console tab? Fix them first!
- Are there any (yellow) warning messages in console tab, starting with "AppGiniHelper |"?
Kind regards,
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
AppGini 24.10 Revision 1579 + all AppGini Helper tools
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
[code]...[/code]
blocks for better readabilityAppGini 24.10 Revision 1579 + all AppGini Helper tools
Re: AppGiniField('field').getValue() ... with version 2022.12.09
By the way:
If you send your order number to me by email, within your 1-year-free-updates period I can send the latest version to you. There have been some improvements to
If you send your order number to me by email, within your 1-year-free-updates period I can send the latest version to you. There have been some improvements to
.getValue()
function recently.Kind regards,
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
AppGini 24.10 Revision 1579 + all AppGini Helper tools
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
[code]...[/code]
blocks for better readabilityAppGini 24.10 Revision 1579 + all AppGini Helper tools
Re: AppGiniField('field').getValue() ... with version 2022.12.09
No, but I recommend using...Does the syntax changed in the new version ?
Code: Select all
var field = AppGiniHelper.DV.getField("FIELDNAME");
var field_value = f.getValue();
Kind regards,
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
AppGini 24.10 Revision 1579 + all AppGini Helper tools
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
[code]...[/code]
blocks for better readabilityAppGini 24.10 Revision 1579 + all AppGini Helper tools
Re: AppGiniField('field').getValue() ... with version 2022.12.09
Ifvar ACTION = AppGiniField('ActionR').getValue();
ActionR
-field is a lookup (which I cannot see from your bugreport), remember that .getValue()
returns an object, having id
and text
, not a simple type value. Check return value in console:
Code: Select all
var field = AppGiniHelper.DV.getField("FIELDNAME");
var field_value = f.getValue();
console.log(field_value);
Here are two examples, directly from console.
- First calls
.getValue()
on a field which isVarChar[100]
field, converted to color-picker by usingdv.getField("varchar").toColorPicker();
(just an example from a previous forum thread).getValue()
evaluates as a (simple-type) string. - Second calls
.getValue()
on a field which is a Lookup field (unsigned int
).getValue()
evaluates as an object, havingid
andtext
properties.
Use
field_value.id
and/or field_value.text
for getting the id
or the text
of the selected entry of a lookup field, if set.Tip (2)
If you only need the text-value of a lookup-field's selection, you can use
.getValue(true)
:Tip (3)
If there is no selection, yet, .getValue() returns null and getValue(true) returns an empty string:
Kind regards,
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
AppGini 24.10 Revision 1579 + all AppGini Helper tools
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
[code]...[/code]
blocks for better readabilityAppGini 24.10 Revision 1579 + all AppGini Helper tools
-
- Posts: 5
- Joined: 2021-12-07 17:58
Re: AppGiniField('field').getValue() ... with version 2022.12.09
Hi Jsetzer ,
Wow ... very fast answer !!!
I will try it this evening (I live in Canada ... not the same time zone)
P.S: I like the AppGINI Helper ... it save a lot of time ... very cool to use it
Best !!!
Michel Berthiaume
Wow ... very fast answer !!!
I will try it this evening (I live in Canada ... not the same time zone)
P.S: I like the AppGINI Helper ... it save a lot of time ... very cool to use it
Best !!!
Michel Berthiaume
-
- Posts: 5
- Joined: 2021-12-07 17:58
Re: AppGiniField('field').getValue() ... with version 2022.12.09
Great !!!
var ACTION = AppGiniField('ActionR').getValue(); ... not work before.
Now: var ACTIONR = AppGiniHelper.DV.getField("ActionR").getValue(); ... Work A1
Thank's for your time !!!
Regards
var ACTION = AppGiniField('ActionR').getValue(); ... not work before.
Now: var ACTIONR = AppGiniHelper.DV.getField("ActionR").getValue(); ... Work A1
Thank's for your time !!!
Regards
Re: AppGiniField('field').getValue() ... with version 2022.12.09
Arghhh, I have just seen why your original code did not work. I have missed that beforevar ACTION = AppGiniField('ActionR').getValue();
You can still use the "old" constructor, but this requires a "new" keyword:
Wrong
Code: Select all
var ACTION = AppGiniField('ActionR').getValue();
Code: Select all
var ACTION = new AppGiniField('ActionR').getValue();
Code: Select all
// deprecated
var field = new AppGiniField('FIELDNAME');
var field_value = field.getValue();
Code: Select all
// recommended
var field = AppGiniHelper.DV.getField('FIELDNAME');
var field_value = field.getValue();
Kind regards,
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
AppGini 24.10 Revision 1579 + all AppGini Helper tools
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
[code]...[/code]
blocks for better readabilityAppGini 24.10 Revision 1579 + all AppGini Helper tools
Re: AppGiniField('field').getValue() ... with version 2022.12.09
Pro-Tip
If you declare the (Javascript)
If you declare the (Javascript)
DV
-variable in hooks/header-extras.php
already, you don't have to declare it in every DV.Code: Select all
<!-- file: hooks/header-extras.php -->
<script>
var DV = AppGiniHelper.DV;
</script>
DV
will be available automatically in each hooks/TABLENAME-dv.js
:Code: Select all
// file: hooks/TABLENAME-dv.js
var field = DV.getField("fieldname");
var field_value = field.getValue();
console.log(field_value);
Kind regards,
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
AppGini 24.10 Revision 1579 + all AppGini Helper tools
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
[code]...[/code]
blocks for better readabilityAppGini 24.10 Revision 1579 + all AppGini Helper tools