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

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

SOLVED
Highlighted
Pearl

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?

1 ACCEPTED SOLUTION

Accepted Solutions

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

  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

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

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.

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

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

 

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

  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

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

 

Ivan, thank you very much for your help
Announcements
LiveWorx Call For Papers Happening Now!