I want to be able to have the user type a number or use the slider bar to pick a value and have that value be stored as a global variable. How can I do that?
For getting input from the user, you can use the TextBox Object in Construct 2. If you put one in your layout, you can access it's current value in the Event Sheet at any time. You can use the On Text Changed (below) event and grab the current value by using the Text property (also below) and assign it to a Global Variable.
TextBox Manual
https://www.scirra.com/manual/117/textbox
On text changed
Triggered whenever the text in the field is modified, by typing, backspace/delete, cut/paste etc.
Text
Get a string containing the text currently entered in to the field.
Check out this little tutorial video on variables in connect 2 http://blogs.msdn.com/b/gamewords777/archive/2015/07/20/10-minutes-with-construct-2-global-and-instance-variables.aspx
Also note - instance variables are handled differently than global.
Related
Typically when referencing a userform control value in Excel VBA I would enter something to the effect of radiobutton.value
However, I want to be able to use a string as the name of the user control. The idea behind this would be to dynamically be able to generate the control name and reference a value from it.
For example I may want to reference ctradiobutton.value one time, and etradiobutton.value the next, these controls already exist on the form, I just want to reference a different name of the control from a string created on the current iteration.
Like this (where Me is the UserForm)
Me.Controls("TextBox1").Value
Is it possible that when you push an insert/ok button that it will insert the contents of a textbox into a specified column?
say i have column TEST and i type "testing123" into the text box and push insert it will fill entire TEST column with the text "testing123"?
Yes, it is.
But the answer depends on what you mean by "column".
Columns show the contents of attributes or the result of an attribute DXL script or of a Layout DXL script.
If you want to set an attribute: the result of a field DB or a text DB can be retrieved with string sContent = get (dbElement), an attribute X of an object o1 can be set with o1.x = sContent, the callback function on what to do when a button is pushed is defined when you define the button in the dialog using the perm DBE button(DB box, string label,void callback(DBE)) [,bool variableSize|int style]).
But judging from your question I get the feeling that you should get a lot deeper into the basics of DOORS before you will be able to program dialog boxes.
An alternative for you might be the usage of a form. http://www.ibm.com/support/knowledgecenter/SSYQBZ_9.6.1/com.ibm.doors.requirements.doc/topics/t_useformstoeditmodules.html gives an introduction to forms
I have a text field/editable, allow multiple values, semicolon for both Multi-Value Options property, in which I want to save current user when they click a button. On the button I have the following code:
#SetField("fieldA"; #Name([CN];#UserName));
The previous value always gets overwritten by the new. What would be the solution to have multiple values stored in?
#SetField("fieldA"; fieldA:#Name([CN];#UserName));
That will append the current user's name to the item.
You might want to look into using the #Unique function. Remember there's a 32K limit of summary field data, so don't let this list grow indefinitely. See #Subset function. Also, bear in mind that the user can save the document without clicking your button, so a Querysave event might be a better place to do this.
I would like to create a custom control which shows 3 columns,
column 1, value selected from checkbox (this is ok)
column 2, editable box , this is showing but not working 100%
column 3, a button to remove the row (still to be done)
So far:
After selecting the options, click "Create Rows" button and 1 row appears for each selected option.
Problem:
Only last value in editable box, is used, how can I get the value from each box ?
getComponent("inputText1").getValue() only shows the last value.
Example code is on this URL:
http://snipt.org/AAgd3
You bind the column values to array variables. Exercise 23 has a complete working example: http://www-10.lotus.com/ldd/ddwiki.nsf/dx/Tutorial-Introduction-to-XPages-Exercise-23
You just need to adjust it to the source/destination of your data. Let us know how it goes
If you want to bind them dynamically, you can also do this with expression language. It takes a bit of getting around in order to get the fields editable, but the way I've resolved it is to pass a calculated ID into a custom control, then using that for the binding.
For example: If I'm Working with a list of Unique Part Names, I may pass into my custom control a variable for a Comment. If I pass this in as fieldNameComment to my custom control, I can dynamically bind it to an inputText element through the following code.
I'm using a DominoDocument passed in as the dataSource.
Calling the Custom Control:
<xp:repeat var="CurrVal" value="#{DataSource}">
<xc:DynamicTableRow dataSource="#{EmissionsDocument}">
<xc:this.fieldNameComment><![CDATA[#{javascript:CurrVal+"Comment"}]]></xc:this.fieldNameComment>
</xc:DynamicTableRow>
</xp:repeat>
Inside the Custom Control:
<xp:inputText id="inputText5"
value="#{compositeData.dataSource[compositeData.fieldNameComment]}">
</xp:inputText>
As long as (for some reason) none of the string calculations are performed within the expression language syntax, this will yield an editable field. In my testing, if I tried to calculate a value by concatenating any strings, the field would be bound, but not appear as editable under any circumstances. If you want to bind directly to fields, this may be a good approach, but if you want to save your array and parse it through java, then Stephan's solution also works great Hope this helps!
Appended: Added repeat control to show iteration through the data source. Each iteration of the Data Source yeilds a value, CurrVal, to which the string "Comment" is appended. This creates a series of FieldNames based on the Values in the DataSource that are bound to inputs within the custom control called DynamicTableRow
I am attempting to get the array object from the autocomplete code to be able to use a string stored in the array. When I perform the on change action, I can show a plain alert, but am unable to get the array from the autocomplete code. I use the resultTextLocator successfully in the same autocomplete code, but I use it to put a person's first and last name in the text box associated with the autocomplete code. I am attempting to get the person's user id that is also stored in the array. Thank you for your help.
Subscribe to the select event & take a look at the result object. Assuming that data passed into AutoComplete has the id it should be accessible there.