Community Tip - If community subscription notifications are filling up your inbox you can set up a daily digest and get all your notifications in a single email. X
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?
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;">    <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%>"> <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>
Solved! Go to Solution.
Hello, there is a video of training for example from the documentation
https://www.youtube.com/watch?v=-14BSAwteVw&list=PLjm4gmbLQwoeqQSP7xUhCnInGknqTBAZV&index=2
Hello, there is a video of training for example from the documentation
https://www.youtube.com/watch?v=-14BSAwteVw&list=PLjm4gmbLQwoeqQSP7xUhCnInGknqTBAZV&index=2