Focal Point Banner


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.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Frustrated to no end with AppStudio and getting validation bef...

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Frustrated to no end with AppStudio and getting validation bef...
 Login/Join
 
Virtuoso
posted
Hey all!

So, I've been fighting AppStudio for some time now trying to get basic form validation to work. The 'Selection & Validation' property for input elements fails to work in AppStudio 8.1.04 (using). I've also made several attempts to find adequate documentation for this (found what you can in the online docs). I've also opened a case w/o any solution returned as of yet (in regards to the 'Selection & Validation' property). I've spent time trying to figure out where my event handler code for the submit button should go and what if any IBI API functions I should be using, where to place code, etc. For some reason AppStudio won't even let me create .js (from the tool) or add .js files (from my desktop that I've created in Notepad++) to my Content folders. It is quite infuriating. I REALLY REALLY REALLY despise the individual who thought it was a good move to axe the ability to access the HTML for your apps. I'm motivated to move on from IBI products all together if they think the majority of us are too stupid not to mess with tool generated code. I understand the importance of not touching the tool generated code. I've coded in C# with Visual Studio where they (far more intelligently) place the tool generated code within collapsible #region tags with comments letting you know that area is off limits. But no... IBI treats us like children.

Here's my current code from the 'Embedded JavaScript/CSS' tab. I've had different versions with onIntitialUpdate(), etc. in there as well. Can anyone here help me see what I'm doing wrong? I'm very frustrated.

  
if(typeof(bRuntime) != 'undefined') {
    // TODO: Add your inline runtime code here
}


//Begin function window_onload
function window_onload() {


    UpdateData();


    // TODO: Add your event handler code here


    //Begin function form1Submit_onclick
    function form1Submit_onclick(event) {
        var eventObject = event ? event : window.event;
        var ctrl = eventObject.target ? eventObject.target : eventObject.srcElement;


        function checkInput() {
            if(document.form1.edit1.value == "") {
                alert("You must enter a car brand!");
                return false;
            }
            else {
                return true;
            }
            document.form1.submit();
        }
    }
    //End function form1Submit_onclick
}
//End function window_onload

This message has been edited. Last edited by: CoolGuy,


8.2.02M (production), 8.2.02M (test), Windows 10, all outputs.
 
Posts: 1113 | Location: USA | Registered: January 27, 2015Report This Post
Master
posted Hide Post
So, most of this seems to be merely a rant against the design of App Studio (which I agree with mostly by the way), but in all that ranting, I couldn't quite understand what it is that you are experiencing as your issue? What is failing? and how is it failing?

Personally I don't use App Studio because in version 8.0.08, I can't even add a graph to the page without App Studio crashing. So I use Developer Studio (At least there I can still get to the HTML where I know the code is written correctly ie proper use of div v span tags etc. because I wrote it). But assuming the form creation works the same way in App Studio as it does in Developer studio, the report will fire off using onSubmit. That is where you want your function to be. You want to replace the current call which in DS is created as onSubmit="onExecute(this);return false;" and replace that with your function. in this case form1Submit_onclick(event). From the naming of that function, I'm assuming that you have assigned it to the onclick event of the Submit button for form 1.

Also you can use the document.form.submit function, but I generally prefer to use onExecute("FormID");. Using the OnExecute command will invoke all of the JS that IBI has already built that includes form validation etc. where I'm not sure that document.form.submit will.


Eric Woerle
8.1.05M Gen 913- Reporting Server Unix
8.1.05 Client Unix
Oracle 11.2.0.2
 
Posts: 750 | Location: Warrenville, IL | Registered: January 08, 2013Report This Post
Expert
posted Hide Post
You have coded functions within functions.

They should be separate, then call the function.

e.g.
//Begin function window_onload
function window_onload() {


    UpdateData();


    // TODO: Add your event handler code here


}
//End function window_onload

    //Begin function form1Submit_onclick
    function form1Submit_onclick(event) {
        var eventObject = event ? event : window.event;
        var ctrl = eventObject.target ? eventObject.target : eventObject.srcElement;


    }
    //End function form1Submit_onclick

        function checkInput() {
            if(document.form1.edit1.value == "") {
                alert("You must enter a car brand!");
                return false;
            }
            else {
                return true;
            }
            document.form1.submit();
        }



You may need to do a lot more to the javascript to implement validation.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Virtuoso
posted Hide Post
Thank you eric.woerle and Waz for your insights. I didn't know that you couldn't define functions within functions with Js. I come from Java where that is allowed. Good thing to know, right? haha Sorry about my rant on AppStudio last Friday. Had a long week last week. Need to spend some time with Js to get myself acquainted with it.


8.2.02M (production), 8.2.02M (test), Windows 10, all outputs.
 
Posts: 1113 | Location: USA | Registered: January 27, 2015Report This Post
Master
posted Hide Post
CoolGuy, you're not alone. I don't much care for it either. I dread the day when IBI no longer supports Dev Studio. I may keep using Dev Studio forever unless I absolutely can't do something any other way.


In FOCUS since 1985. Prod WF 8.0.08 (z90/Suse Linux) DB (Oracle 11g), Self Serv, Report Caster, WebServer Intel/Linux.
 
Posts: 975 | Location: Oklahoma City | Registered: October 27, 2006Report This Post
Expert
posted Hide Post
You may be getting confused at the js level with creating methods for objects, which you can do with prototyping, but in this case no, they have to be separate.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Frustrated to no end with AppStudio and getting validation bef...

Copyright © 1996-2020 Information Builders