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

Community Tip - Have a PTC product question you need answered fast? Chances are someone has asked it before. Learn about the community search. X

add a suggestionbox in the create part wizard

ipochi
1-Visitor

add a suggestionbox in the create part wizard

Hi ,

I am new to customization

I have a string attribute , which should pick up the from user input [like google search  , autocomplete ] the valid list of values from the database.

Could anyone please tell me what would be way to go  for this sort of customization.

ACCEPTED SOLUTION

Accepted Solutions

Hello Imran,

I recently worked on SuggestTextBox. You will have to create a suggestion class (implementing Suggestable interface) which would basically do the query. This class should be registered as a service, This service could be called from suggestTextBox wrapper tag.


Below URLs might be useful to you:

Re: Configure Auto Suggest Picker (SuggestTextBox) on object creation page?

SuggestTextBox should work with multiple values


Best Regards,

Shirish

View solution in original post

5 REPLIES 5

Hello Imran,

I recently worked on SuggestTextBox. You will have to create a suggestion class (implementing Suggestable interface) which would basically do the query. This class should be registered as a service, This service could be called from suggestTextBox wrapper tag.


Below URLs might be useful to you:

Re: Configure Auto Suggest Picker (SuggestTextBox) on object creation page?

SuggestTextBox should work with multiple values


Best Regards,

Shirish

ipochi
1-Visitor
(To:ipochi)

Björn Rüegg  -> -->  I went to the link , Yes its exactly what i want , although I am not sure how to copy that functionality or look at the source

ipochi
1-Visitor
(To:ipochi)

one more question.

Is this the same approach for the create part/document wizards ?
In this method we are overriding the JSP , is there a better way than overriding the jsp ?

You can have just a data utility to implement the suggest text box.

I don't have any manual. Just have a look at the source of following java code

Example with JSP:

com.ptc.carambola.tags.AutoSuggestSearchHelper

-> This one is registered

wt.services/svc/default/com.ptc.core.components.suggest.Suggestable/carambola_autosuggest_helper/null/0=com.ptc.carambola.tags.AutoSuggestSearchHelper/duplicate

And the JSP is under

codebase/netmarkets/jsp/carambola/customization/examples/picker/suggest.jsp

Example with Data Utiltiy

The Data Utility would look something like this:

SuggestTextBox localSuggestTextBox = new SuggestTextBox(component_id, "nameSuggestService");

localSuggestTextBox.setMinChars(2);

localSuggestTextBox.setRequired(true);

localSuggestTextBox.setColumnName(columnName);

localSuggestTextBox.setMaxResults(50);

localSuggestTextBox.setMaxLength(40);

localSuggestTextBox.setEnabled(true);

localSuggestTextBox.setWidth(40);

localSuggestTextBox.addParm("LANGUAGE", sLanguage);

if (paramModelContext.getDescriptorMode() == ComponentMode.EDIT || paramModelContext.getDescriptorMode() == ComponentMode.CREATE) {

  localSuggestTextBox.setValue(currentValue);

} else {

  localSuggestTextBox.setValue(localSuggestTextBox.getParm((String) value));

}

Announcements


Top Tags