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

add a suggestionbox in the create part wizard

SOLVED
Highlighted
Level 1

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.

1 ACCEPTED SOLUTION

Accepted Solutions

Re: add a suggestionbox in the create part wizard

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

5 REPLIES 5

Re: add a suggestionbox in the create part wizard

Re: add a suggestionbox in the create part wizard

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

Re: add a suggestionbox in the create part wizard

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

Re: add a suggestionbox in the create part wizard

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 ?

Re: add a suggestionbox in the create part wizard

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));

}