As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.
Join the TIBCO Community TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.
From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
Request access to the private WebFOCUS User Group (login required) to network with fellow members.
Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.
I'm working on an html page in App Studio, which contains several user input fields that will be passed into the reports as parameters. For the numeric edit boxes, is there a way to automatically add comma's as the user types?This message has been edited. Last edited by: Joel Elscott,
Not sure on the "as they type" part, but once the value is submitted, you can do some formatting before passing it in Js, or in WF before using it in the fex it was passed to. For what you're wanting, you might check the control's properties panel for something like that. They MIGHT have added something in there. Not sure though.
8.2.02M (production), 8.2.02M (test), Windows 10, all outputs.
Posts: 1113 | Location: USA | Registered: January 27, 2015
To elaborate a bit on what Waz commented, I tried the following Key Up event and it seemed to work:
//Begin function edit1_onkeyup
function edit1_onkeyup(event) {
var eventObject = event ? event : window.event;
var ctrl = eventObject.target ? eventObject.target : eventObject.srcElement;
// TODO: Add your event handler code here
// skip for arrow keys
if(event.which >= 37 && event.which <= 40) return;
// format number
$(ctrl).val(function(index, value) {
return value
//eliminate non-digit characters
.replace(/\D/g, "")
//add comma for every group of 3 digits
.replace(/\B(?=(\d{3})+(?!\d))/g, ",")
;
});
}
//End function edit1_onkeyup
This message has been edited. Last edited by: Hallway,
Hallway
Prod: 8202M1
Test: 8202M4
Repository:
OS:
Outputs:
Posts: 608 | Location: Salt Lake City, UT, USA | Registered: November 18, 2015
Hallway and Waz - Thanks for the suggestion. I'm still learning JavaScript, but how do you trigger this js function? On a "selection changed" criteria in App Studio? I also would have expected to see a reference to the edit box, like edit1 in this code...how does this piece of code know I'm referring to edit1?
Sorry for the noob questions!
Dave - Thanks for the suggestion, but in this case the user wants a formatted dollar amount with commas, not passing in multiple values.
All that you need to do is go to the properties panel for the input and click on the events (lightning bolt) to bring up the list of available events. The event that you want is "Key Up." This will run the code every time a key is released on the keyboard while inputting text in the input box. Just click in the cell to the right of "Key Up" and you'll see a grey box with an ellipsis show up on the right. Just click on that ellipsis.
This will bring up the Embedded JavaScript tab of the HTML Canvas. You will see that the first 5 lines and the last two lines of the code I posted above were automatically created by AppStudio.
Then just put in the remaining code and it should work
This message has been edited. Last edited by: Hallway,
Hallway
Prod: 8202M1
Test: 8202M4
Repository:
OS:
Outputs:
Posts: 608 | Location: Salt Lake City, UT, USA | Registered: November 18, 2015