How to test for an item in a radio set - radio-button

In OpenEdge Progress, I want to add an item to a radio set, but first I want to test to make sure that it is not already there so it won't be duplicated. Is there a better way to do this other than :
dummy-log = radioset:delete(value) no-error.
dummy-log = radioset:add-last(label,value).
Using :delete causes issues if the current record has this as a screen value.
We use OpenEdge Release 10.2B05.

The RADIO-BUTTONS attribute gives you the label/value pair list for the radio set. You can then look for the value in it before adding a new one.
IF LOOKUP(value, radioset:RADIO-BUTTONS) = 0 THEN
dummy-log = radioset:add-last(label,value).

Related

composeTestRule checking that atleast 1 item exists

I have a list which has 2 different items. However, if the user gets close to the end of the list then the 2 same items are added again and again to create an infinite scrolling feel.
I've created a test to basically verify that the item exists like so:
composeTestRule
.onAllNodesWithContentDescription("Home")
.assertCountEquals(2)
As you can see this just finds nodes with the content description of "Home" and checks if their are 2.
Currently, this works as the screen size is small but let's say the screen size is doubled then this will fail as the assertCountEquals(2) would need to check for 4.
I was wondering to make this code better, is there a way to basically check that atleast 1 exists?
onAllNodes methods return an array, grab the first element and check whether it exists or is displayed.
composeTestRule
.onAllNodesWithContentDescription("Home")
.onFirst().assertExists()

Apex, Dynamic action, Confirm action, not picking up correct text - what am I missing?

I'm obviously missing something and hoping someone might be able to help.
I've an Interactive Grid, and a button.
When the button is pressed the dynamic action on the button has 2 steps.
Action 1 - Execute Javascript to take a value from one of the IG cells and put it into a page item.
Action 2 - Confirm Action - Are you sure you wish to delete &P10_JOB_ID.
I've made the page item, &P10_JOB_ID, visible and I can see the value has correctly been changed to the value from the IG.
I write P10_JOB_ID into a database table - I get the correct value
But the confirm message isn't picking up the correct value from P10_JOB_ID.
Namely it uses the value in P10_JOB_ID when the page starts, but then as I move around the IG pressing the button and changing the value of P10_JOB_ID, the text in the confirm message never changes.
Can anyone suggest what I might have missed, I'm baffled.
Thanks a lot
Substitutions like &P10_JOB_ID. are made when the page is rendered, not dynamically, so reflect the value at time of page load.
You will need to use Javascript to perform the conform action, something like:
apex.page.confirm ('Are you sure you wish to delete ' + $v('P10_JOB_ID') + '?', 'DELETE');
$v is an APEX Javascript function that returns the current value of a page item.
I used 'DELETE' as an example of a request value; you may want to do something different here.
Ok - having the setting of value and confirm as 2 separate actions is what causes the problem.
As per fac586
That is the expected behaviour. Static text substitutions are performed once during page show processing. They are not evaluated dynamically in the browser at runtime as values change.
Drop the second action and extend the first to display the confirm dialog using the apex.message.confirm JS API method, accessing the item value using the $v shorthand method.

Work Queue - Updating Narrative(Status - Text) in Work Queue Item

Working on sample process work queue in Blue Prism. I am successfully able to process work queue items. However, I am not able to update queue items.
I am using calc stage where I am setting value as [RetrievedData.Status] = "Test", after this calling Set Data action (Passing RetrievedData collection and Item ID). When retrieving an item as Get-Item I am not able to see the updated value "Test" in Status column.
Can anybody please help.
Please see the attached screenshot]1
I am using calc stage where I am setting value as [RetrievedData.Status] = "Test"
No, you are currently testing whether [RetrievedData.Status] is equal to "Test" (and storing True/False to the data item Result). To set [RetrievedData.Status] to "Test", you need to use it like this:
are you using that specific item id for which you have updated data in 2nd get item? if not then 2nd get item will pick a new item from queue not the same item. Instead of using get item 2nd time you can use get item data action to verify the updated data

Issue with vue.js conditional rending

I have problem in rendering a template
When a new data has been added, it won't go to the process of v-if even if the condition is both TRUE.
Can some please explain why?
I have provided some screenshot below to explain further my issue
This first image was my template for displaying the products, you will notice the add, update and remove in here.
The second image shows that I'm trying to add a new product
The third image shows that I have successfully added the new product. The problem is, the action button "update" is triggered but won't take any effect.
The image above shows that the update button works with the past data, but not with the new one.
This last image will prove that the button has been triggered. I've added a console.log to display the following upon clicking the update button.
INDEX of the row, which is [0].
The typeOf the variable 'isUpdate' [boolean].
The value of 'isUpdate' [True, False]
and the productID which is [151]
Any idea why it hasn't been triggered, or any idea how to debugged this?
If you want to see the code. I can provide it, just tell me which part are you looking for. As I don't have any idea which part has the error.
Thank you in advance.
Updated
AS per Amresh Venugopal Request
Here is the v-if in the template
<tr v-if='product.id > 0 && product.isUpdate' class='table-inputs'>
And the updatebtn function
canUpdate: function(data) {
console.log(data.pindex);
this.products[data.pindex].isUpdate = !this.products[data.pindex].isUpdate;
console.log(typeof this.products[data.pindex].isUpdate);
console.log(this.products[data.pindex].isUpdate);
console.log(this.products[data.pindex].id);
}
I only set the isUpdate value to 'true' if 'false', and viceversa.
The productID is added after the ajax save function.
I figure it out!
When I push the data in this.products, I didn't include the 'isUpdate' field.
Got it working now.

How do I set value of DateTextBox?

So basically I have these two DateTextBoxes and I want to copy the value from one to another? Sounds easy, right? Still, it is not...
I tried to do it this way:
dojo.byId("datetextbox1").value = dojo.byId("datetextbox2").value;
it actually looks like the value changes as the content of the field changes, but it doesn't really. When I inspect the element with firefox it still contains the old value in the code and when I try to submit the form, the old value is sent!
So my question is: how should I change that damn value?
You'll want to set the value on the widget and not directly on the node.
dijit.byId("datetextbox1").set('value', dijit.byId("datetextbox2").get('value'));
dijit.byId grabs widgets, dojo.byId grabs dom nodes