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

Community Tip - Your Friends List is a way to easily have access to the community members that you interact with the most! X

How to create a table using JSP and Info *Engine?

VladiSlav
17-Peridot

How to create a table using JSP and Info *Engine?

Hello everyone, I'm trying to implement Breed's  example https://community.ptc.com/t5/Windchill/JSP-Page-to-Set-State/m-p/238010#M28450. How to put all the data in the table to look like in the tables below?
And how do I make sure that when I click on the "Search" button I stay on the same page and the data is updated?

DB.JPG

 

All the code I wrote in the JSP-file customHomePageAction.jsp ( codebase/netmarkets/jsp/myCompany/customHomePageAction.jsp) 

 

<%@ page language="java" session="false" %>
<%@ taglib uri="http://www.ptc.com/infoengine/taglib/core" prefix="ie" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ page import="com.jbtc.*" %>
<%@ page import="java.util.regex.*" %>
<%@ page import="java.util.Pattern.*" %>
<%@ page import="java.io.*" %>
<%@ page import="java.net.URL" %>
<%@ page import="wt.method.RemoteMethodServer" %>
<%@ page import="wt.util.WTException" %>
<%@ page import="wt.epm.EPMDocument" %>
<%@ page import="wt.doc.WTDocument" %>
<%@ page import="wt.fc.ObjectIdentifier" %>
<%@ page import="wt.fc.Persistable" %>
<%@ page import="wt.fc.PersistenceHelper" %>
<%@ page import="wt.lifecycle.LifeCycleHelper" %>
<%@ page import="wt.lifecycle.State" %>
<%@ page import="wt.lifecycle.LifeCycleManaged" %>


<ie:webject name="Get-Properties" type="MGT">
    <ie:param name="ATTRIBUTE" data="wt.federation.ie.VMName"/>
    <ie:param name="GROUP_OUT" data="properties"/>
</ie:webject>
<html>
<head>
    <title>Engineering Set State App</title>
    <link rel="stylesheet" type="text/css" href="jsp.css">
</head>
<body>

<%
    String where = request.getParameter ("where");
    if ( where == null )
        where = "()";
    else if( where != null )
        where= "(name='*" + where + "*')";
    String wherevalue = request.getParameter ("where");
%>

<div class="main">
    <div class="logo">
        <img src="netmarkets/images/cyclops.png" alt="setstate logo"      style="width:auto;">&nbsp&nbsp&nbsp&nbsp<img src="netmarkets/images/database.png" alt="setstate logo" style="width:auto;">
    </div>
    <div class="searchbox">
        <form action="netmarkets/jsp/myCompany/customHomePageAction.jsp" method="post">
        <input type="hidden" name="obid" value="" />
        <input type="hidden" name="state" value="" />
        <input class="submit-textbox" type="text" name="where" value="<%=wherevalue%>">&nbsp<input class="submit-button" type="submit" value="Search">
        </form>
    </div>
</div>
<ie:webject name="Search-Objects" type="OBJ">
    <ie:param name="INSTANCE" data="$(properties[0]wt.federation.ie.VMName[0])"/>>
    <ie:param name="TYPE" data="wt.epm.EPMDocument"/>
    <ie:param name="VERSION" data="LATEST"/>
    <ie:param name="ITERATION" data="ALL"/>
    <ie:param name="WHERE" data="<%=where%>"/>
    <ie:param name="WHERE" data="CADName='*'" />
    <ie:param name="ATTRIBUTE" data="CADName,name,state.state,versionInfo.identifier.versionId,iteration,obid" delim=","/>
    <ie:param name="GROUP_OUT" data="epmdocument"/>
</ie:webject>
<ie:webject name="Search-Objects" type="OBJ">
    <ie:param name="INSTANCE" data="$(properties[0]wt.federation.ie.VMName[0])"/>
    <ie:param name="TYPE" data="wt.doc.WTDocument"/>
    <ie:param name="VERSION" data="LATEST"/>
    <ie:param name="ITERATION" data="All"/>
    <ie:param name="WHERE" data="<%=where%>"/>
    <ie:param name="WHERE" data="(state.state='*')"/>
    <ie:param name="ATTRIBUTE" data="name,state.state,versionInfo.identifier.versionId,iteration,obid" delim=","/>
    <ie:param name="GROUP_OUT" data="pdfdocument"/>
</ie:webject>
<ie:webject name="Merge-Groups" type="GRP">
    <ie:param name="CASE_IGNORE" data="true"/>
    <ie:param name="CLASS" data="class"/>
    <ie:param name="COMPARISON" data="ALPHA"/>
    <ie:param name="GROUP_IN" data="epmdocument"/>
    <ie:param name="GROUP_IN" data="pdfdocument"/>
    <ie:param name="GROUP_OUT" data="outdata"/>
    <ie:param name="SORTBY" data="name"/>
    <ie:param name="SORTED" data="ASC"/>
</ie:webject>
<div class="atable">
    <br />
    <table id="items">
        <tr>
            <th>File Name</th><th>Windchill Name</th><td>Current State</td><td>Rev</td><th></th><th></th><th></th><th></th><th></th>
        </tr>
        <ie:forEach groupIn="outdata" groupOut="row">
            <tr>
                <td><ie:getValue name="CADName"/></td>
                <td><ie:getValue name="name"/></td>
                <td><ie:getValue name="state.state"/></td>
                <td><ie:getValue name="versionInfo.identifier.versionId"/></td>
                <td><ie:getValue name="Iteration"/></td>
            </tr>
        </ie:forEach>
    </table>
    <br />
</div>
</body>
</html>

ACCEPTED SOLUTION

Accepted Solutions

Basic Customization Getting Started With Windchill Customization https://support.ptc.com/help/wnc/r11.2.0.0/en/index.html#page/Windchill_Help_Center%2FWCCG_Oview_GetStartCust_Intro.html%23
1 REPLY 1

Hello, there is a video of training for example from the documentation

https://www.youtube.com/watch?v=-14BSAwteVw&list=PLjm4gmbLQwoeqQSP7xUhCnInGknqTBAZV&index=2

Basic Customization Getting Started With Windchill Customization https://support.ptc.com/help/wnc/r11.2.0.0/en/index.html#page/Windchill_Help_Center%2FWCCG_Oview_GetStartCust_Intro.html%23
Announcements

Top Tags