Skip to main content
1-Visitor
March 7, 2016
Solved

Table with Text box in windchill

  • March 7, 2016
  • 1 reply
  • 5128 views

Hello,

Is there any way we can create the Textbox in the component builder and a search button

Please help if any body know this

Best answer by BhushanNehe

Hi Ankit,

As mentioned earlier, the second link should be helpful.

Also, you may want to try following to get started. It's not a complete example though.

1. Create a jsp with a simple form, you can also do this by creating attribute panel

<input type="text" size="25px" id="EnterNumber" name="EnterNumber" value="">

<input type="text" size="25px" id="EnterName" name="EnterName" value="">

  <input type="button"  id="SubmitButtonID" name="SubmitButtonID" value="Search" onClick="submitFunction();">

<div id="mvcTable">

  <mvc:tableContainer compId="<<YOUR COMPONENT ID>>" height="600" />

  </div>

2. Include the JS

function submitFunction() {

  var number = document.getElementById('EnterNumber').value;

  var name = document.getElementById('EnterName').value;

  var params = {

  number : number,

  name : name

  };

  //reload the table builder

  PTC.jca.table.Utils.reload('<<YOUR COMPONENT ID>>',params,true);

}

3. In your builder you should be able to get the parameters as shown below

public Object buildComponentData(ComponentConfig  config, ComponentParams params) throws Exception {

  String PartNumber= (String) params.getParameter("number");

  String PartName = (String) params.getParameter("name");

Regards,

Bhushan

1 reply

16-Pearl
March 7, 2016

Are you creating a Wizard? Can you check following links on your server to see if that helps.

http://<<HOSTNAME>>/Windchill/app/#netmarkets/jsp/componentCatalog/wizardComponent.jsp

http://<<HOSTNAME>>/Windchill/app/#ptc1/comp/carambola.testClients.search

Regards,

Bhushan

adev1-VisitorAuthor
1-Visitor
March 8, 2016

Hello Bhushan,

No I am not creating a Wizard I like the functionality like search where I can input some values and as per that I will get the result

Thanks

Ankit

16-Pearl
March 9, 2016

Hi Ankit,

As mentioned earlier, the second link should be helpful.

Also, you may want to try following to get started. It's not a complete example though.

1. Create a jsp with a simple form, you can also do this by creating attribute panel

<input type="text" size="25px" id="EnterNumber" name="EnterNumber" value="">

<input type="text" size="25px" id="EnterName" name="EnterName" value="">

  <input type="button"  id="SubmitButtonID" name="SubmitButtonID" value="Search" onClick="submitFunction();">

<div id="mvcTable">

  <mvc:tableContainer compId="<<YOUR COMPONENT ID>>" height="600" />

  </div>

2. Include the JS

function submitFunction() {

  var number = document.getElementById('EnterNumber').value;

  var name = document.getElementById('EnterName').value;

  var params = {

  number : number,

  name : name

  };

  //reload the table builder

  PTC.jca.table.Utils.reload('<<YOUR COMPONENT ID>>',params,true);

}

3. In your builder you should be able to get the parameters as shown below

public Object buildComponentData(ComponentConfig  config, ComponentParams params) throws Exception {

  String PartNumber= (String) params.getParameter("number");

  String PartName = (String) params.getParameter("name");

Regards,

Bhushan