cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - You can Bookmark boards, posts or articles that you'd like to access again easily! X

How I can add my button to some page that will run java code?

VladiSlav
17-Peridot

How I can add my button to some page that will run java code?

Hello, please tell me how I can add my button to some page that will run java code?

ACCEPTED SOLUTION

Accepted Solutions

  1. Create jsp page e.g test.jsp with your java code, put to the Windchill_home/codebase/netmarkets/test.jsp
  2. Add AJAX function to the button to invoke your page
    https://wnc_host/Windchill/netmarkets/test.jsp​
  3. new Ajax.Request('netmarkets/test.jsp​', {
      method:'get',
      onSuccess: function(transport) {
        var response = transport.responseText || "no response text";
        alert("Success! \n\n" + response);
      },
      onFailure: function() { alert('Something went wrong...'); }
    });

This information is just an example of how you can invoke a Java code.

Most of new administrative UI use Angular, you can see examples in the directory: Windchill_home/codebase/apps/

View solution in original post

4 REPLIES 4

Hi Vlad,

Can you add more details, what type of page you want to customize?

Did you read Windchill Customizer guide?

Windchill UI use different technology, solution may be different.

To invoke java code, you can use: Servlet, JSP, IE tasks, REST Services, RMI call via http...

Some UI customizations.

Hello, Ivan, I want to add a button to the main page, when you click on the button to run exactly java code, for example, the output of the contents of the database table. Foreign objects I created according to the documentation in the jsp file

 

Снимок.JPG

 

  1. Create jsp page e.g test.jsp with your java code, put to the Windchill_home/codebase/netmarkets/test.jsp
  2. Add AJAX function to the button to invoke your page
    https://wnc_host/Windchill/netmarkets/test.jsp​
  3. new Ajax.Request('netmarkets/test.jsp​', {
      method:'get',
      onSuccess: function(transport) {
        var response = transport.responseText || "no response text";
        alert("Success! \n\n" + response);
      },
      onFailure: function() { alert('Something went wrong...'); }
    });

This information is just an example of how you can invoke a Java code.

Most of new administrative UI use Angular, you can see examples in the directory: Windchill_home/codebase/apps/

 

Ivan, thank you very much for your help
Announcements

Top Tags