Store radiobutton checkedvalue in variable with TSQL - sql-server

I have a webform with a textfield.
The webform is connected to an integral database. But for this I don't need to store the value from this radiobutton into a table. I just want to take that value, and use it as a return for another field, just like it was not connected to a database at all.
In my TSQL code I assigned this textfield to a variable like this:
DECLARE #vak1 int
SET #vak1 = '[field name='vak1']'.
'field name' is the name of the object of that textfield. And I named it vak1.
I also want to put the checkedvalue from a radiobutton control into a variable, just like I did in the example above. But I dont know the name of the object, like in the above example it is field name for a textfield. So I need to know the standard name of a radiobutton object. These are all being used as LOCAL variables.
For example:
DECLARE #radio int
SET #radio = '[ x = 'No_cure_no_pay']'
The name No_cure_no_pay is the name of the radiobutton object. But what should I call x here? In the upper example it is 'field name' for a text field webcontrol.
What is the name for a radio button webcontrol?
The software I am using is custom made 3rd party software by a local Dutch company and it is not well known. So I cannot provide much info on the internals of the database. I don't have much code. Just these two lines would suffice, because the rest is pretty much the same just with different variable names. I will just use the values as return values. Just need to know how to declare and set a checked radiobutton value.

Related

how to store xtype value as String Array CQ5 / AEM

I have dialog with set of xtypes defined.
One of xtype is "selection" with type "select".
Now each option has a value type "String[]" , but when I add the component to a page and look at the option selected content.
It is stored as "String" rather than "String[]".
Could anyone tell me how to make/force a xtype store its values in a "String[]" , rather than "String".
You can use one of the Sling parameters to manipulate the content creation through the SlingPostServlet. Read more: here
In reality, just add a hidden field to your dialog that will pass the #TypeHint parameter with the expected property type. If your xtype saves data to e.g. cities property you can add the following:
<citiesTypeHint
jcr:primaryType="cq:Widget"
name="cities#TypeHint"
value="String[]"
xtype="hidden"
When you are adding xtype in dialog.xml, add it as :
property=value
This will create a property of String type with value as value.
If you want an array put the value in [], as :
property="[value1,value2,value3,...]"
This will create a property of String[] type with value as value. If you want to add more, separate then with coma.
If you want to define dataType, as :
property="{dataType}value"
This will create a property of dataType type with value as value. Where dataType may be any DataType like Boolean, Date, Long, etc
If you are adding Property with crx/de then click on add multi button in the bottom right corner.
Hope this Helps...:)
Mateusz Chromiński variant almost worked for me, except that value="String[]" results in emprty property, so I have used defaultValue="String[]" and it worked just perfect.
<targetGroupsTypeHint
jcr:primaryType="cq:Widget"
name="./targetGroups#TypeHint"
defaultValue="String[]"
xtype="hidden"/>
Enter the following in the dialog:
typeHint="String[]"

How to access to a Combo box value in Item Line on NetSuite?

In NETSUITE
is there any way to access to a value inside of a combo-box at the item line level?
I need to access to a value after inserting an item but all functions get me null value.
I have tried
nlapiGetCurrentLineItemValue
and
nlapiGetFieldValue
Both functions are getting me null values.
Thanks,
Pablo.
In general (for user event and client script) below code should work
nlapiGetLineItemValue(LINE_ITEM_TYPE, YOUR_FIELD_ID, LINE_NUMBER);
eg on SO to get the line item Id:
nlapiGetLineItemValue('item', 'item', 1);
PS: Syntax is independent of data type or field type
If you mean combo box as a mulitselect, and if you're trying to access via User Event Script, use:
nlapiGetLineItemValues(type, fldname, linenum);
Note the 's' in nlapiGetLineItemValues
If its just a standard field, nlapiGetLineItemValue(type, fldname, linenum) should work.
Which call to use depends on what event you are capturing.
For instance if you are trying to access the value in a post sourcing, field changed or line validate event of a client script you would use nlapiGetCurrentLineItemValue('item', 'fieldname');

In HaxeFlixel, What is Box object and how to use it?

I'm trying to use FlxUICheckBox. In the official documentation, the constructor looks like this:
new(X:Float = 0, Y:Float = 0, ?Box:Dynamic, ..)
What is the Box object?
How should I send a Box object as a parameter to this constructor?
I should probably change it to BoxAsset. It's the image asset you want to use for the box part of the checkbox.
A simple checkbox has three components, and looks a bit like this:
[X] Checkbox
Box means the box part, "[ ]"
Check means the check part, "X"
Label means the text that goes in the textfield next to the checkbox
If you don't provide Box or Check, it will use default FlxUIAssets automatically to skin your checkbox. If you provide your own asset (such as "assets/mybox.png" for example), it will use that instead. It is expecting the same sort of thing you would pass into FlxSprite.loadGraphic() -- a String, a BitmapData, or a FlxGraphic.
I should probably also update the type from :Dynamic to :FlxGraphicAsset, I originally wrote this code a long time ago before they added that new helper type.

How can I declare and set the value from a radiobutton object with TSQL syntax?

I have a webform with a textfield.
The webform is connected to an integral database. But for this I don't need to store the value from this radiobutton into a table. I just want to take that value, and use it as a return for another field, just like it was not connected to a database at all.
In my TSQL code I assigned this textfield to a variable like this:
DECLARE #vak1 int
SET #vak1 = '[field name='vak1']'.
'field name' is the name of the object of that textfield. And I named it vak1.
I also want to put the checkedvalue from a radiobutton control into a variable, just like I did in the example above. But I dont know the name of the object, like in the above example it is field name for a textfield. So I need to know the standard name of a radiobutton object. These are all being used as LOCAL variables.
For example:
DECLARE #radio int
SET #radio = '[ x = 'No_cure_no_pay']'
The name No_cure_no_pay is the name of the radiobutton object. But what should I call x here? In the upper example it is 'field name' for a text field webcontrol.
What is the name for a radio button webcontrol?
The software I am using is custom made 3rd party software by a local Dutch company and it is not well known. So I cannot provide much info on the internals of the database. I don't have much code. Just these two lines would suffice, because the rest is pretty much the same just with different variable names. I will just use the values as return values. Just need to know how to declare and set a checked radiobutton value.

Make variable name using loop and string in PowerBuilder

I am interested if it is possible to make variable name in PowerBuilder using a loop and a string. For example:
long ll_go
string lst_new
for ll_go = 1 to 8
lst_new = "text" + ll_go
lst_new.tag = 5500
next
So, it should give me variables text1, text2..,.,text8 and I would be able to assign values for them. Let me know if anybody succeeded, thanks in advance
Your description is lacking some term precision.
If you actually want to dynamically create new variables as "variable in a powerscript subroutine or function" this is simply not possible.
If instead you want to create dynamically some new controls statictext or textedit objects in a window or visual userobject this is possible:
use a local variable of the type of the new object you need to create, e.g. static text
make it a live object (instantiate) with create
set the object properties to whatever you need
"attach" the new object to its parent (either a window or a visual userobject - though any graphicobject is possible with using the win32api SetParent function) with the OpenUserObject() method. Note that you cannot simply add it directly to the parent's Control[] array.
you can also keep the object in your own array for later convenience access to the created objects instead of looping on the Control[] array
once the object is attached it its parent, you can reuse the local variable to create another one
Here is an example:
//put this in a button clicked() event on a window
//i_myedits is declared in instances variables as
//SingleLineEdit i_myedits[]
SingleLineEdit sle
int i
for i = 1 to 8
sle = create singlelineedit
sle.text = string(i)
sle.tag = "text_" + string(i)
sle.height = pixelstounits(20, ypixelstounits!)
sle.width = pixelstounits(100, xpixelstounits!)
parent.openuserobject(sle, pixelstounits(10, xpixelstounits!), pixelstounits(22 * i, ypixelstounits!))
i_myedits[i] = sle //keep our own reference
next
An exemple of values access:
//put that in another button clicked() event
SingleLineEdit sle
int i
string s_msg
for i = 1 to upperbound(i_myedits[])
sle = i_myedits[i]
if i > 1 then s_msg += "~r~n"
s_msg += "edit #" + string(i) + " (" + sle.tag + ") says '" + sle.text + "'"
next
messagebox("Edits values", s_msg)
As you can see, one practicality problem is that you cannot refer to these controls by constructing the control's name like "text"+2, instead you must access the my edits[] array or loop through the controls and test their .tag property if you set it to something specific.
I do not think that it is possible. Workaround could be an array maybe.
Br. Gábor
I'd see two ways to do this, but they aren't as easy as it seems that you were hoping:
1. Control Array
First method would be to go through the control arrays (on windows, tabs and user objects). I'd create a function that took the control name as a string, then another that overloaded the same function and took control name and an array of windowobject. The string-only method would just call the string/array method, passing the string through and adding the window.Control as the second parameter. The string/array method would go through the array, and for each element, get the ClassDefinition. Pull the name off of it, and parse it apart the way you want it to match the string parameter (e.g. for w_test`tab_first`tabpage_first`cb_here, do you want cb_here to match, or tab_first`tabpage_first`cb_here?). Deal with matches as appropriate. When you find a control of type tab or user object, call the string/array function again with the Control array from that object; deal with success/fail returns as appropriate.
2. DataWindow
What you're describing works extremely well with DataWindows, and their Describe() and Modify() functions. Since you pass these functions only a string, you can build not only the control names, but the values they're set to as you would build any string. In fact, you can build multiple Modify() strings together (delimited by a space) and make a single call to Modify(); this is not only faster, but reduces window flicker and visible activity.
Don't fall into the trap of thinking that, since your data isn't from a database, you can't use a DataWindow. Create an external DataWindow, and simply use it with one row inserted during the Constructor event.
As you might guess, I'd strongly favour the DataWindow approach. Not only is it going to perform better, but it's going to provide a lot more flexibility when you want to move on and tag more control types than just static text. (You'll have to do some type casting even with one control type, but if you want to get into multiples, you'll need to start a CHOOSE CASE to handle all your types.)
Good luck,
Terry
You can't create a variable name in a script because the variables have to be declared before you can use them. With PBNI it's possible to generate a name the way you describe and then get a reference to a variable of that name that already exists but I don't think that's what you want. If you want to keep track of additional properties for your controls, just inherit a new user object from whatever it is (sle, mle, etc.) and add the properties you want. Then you can place your user object on a window and use the properties. Another approach is to use the control's Tag property. It holds a string that you can put whatever you want in. PFC uses this technique. Terry's DataWindow solution is a good approach for storing arbitrary data.
Yes, and there are more than one way to skin a cat.
Sounds like you have several properties so I'd use an array of custom non visual user objects, or an array of structures. Otherwise you could probably use something from the .NET framework like a dictionary object or something like that, or a datawidnow using an external datasource, where you can refer to column names as col + ll_index.ToString().
SIMPLE Example:
Make custom NVO with following instance variables, plus getter/setter functions for each, name it n_single_field
// add the properties and recommend getter and setter functions
public string myTag
public string myText
public int myTabOrder
...
// To USE the NVO define an unbounded array
n_single_field fields[]
// to process the populated fields
integer li_x, li_max_fields
// loop through field 1 through max using array index for field number
li_max_fields = upperbound(fields)
for li_x = 1 to li_max_fields
fields[li_x].myTag = 'abc'
fields[li_x].myText = 'text for field number ' + li_x.ToString()
fields[li_x].myTabOrder = li_x * 10
next
Maybe I'm oversimplifying if so let me know, if there is a will there is always a way. ;)

Resources