cancel
Showing results for 
Search instead for 
Did you mean: 

Value Help using simpleType

former_member193964
Active Participant
0 Kudos

Hi all,

I'm using the SimpleType for show all contents in a Search Help. But I have two problems. The first is that I can only use two columns for it. Can I use more than 2 columns? The secod is that I need to put a sort in this search Help. I dont know if it is possible.

See my source code below:

Private void shBusca_Pais(IWDAttributeInfo attributeInfo) {

ISimpleTypeModifiable modeloType = attributeInfo.getModifiableSimpleType();

modeloType.setFieldLabel("Pais");

IModifiableSimpleValueSet valueSet = modeloType.getSVServices().getModifiableSimpleValueSet();

for (int i =0; i < wdContext.nodeS_Paises().size(); i++){

valueSet.put(wdContext.nodeS_Paises().getS_PaisesElementAt(i).getLand1(),

wdContext.nodeS_Paises().getS_PaisesElementAt(i).getLandx());

}

}

Great,

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Marcelo

Use this method, and pass the node as parameter

In this example i order the element using a IWorKCentreNode Interface

private void sortElements(IWDNode node) {
	  node.sortElements
		(
			new Comparator(){
				 public int compare(Object x, Object y) {
					String ax = ((IWorkCentreElement) x).modelObject().getDescription().getWorkCentreDescription().get$0023SimpleContent().toString().toUpperCase(); //Zdistname is the context attribute name of the sorted lement
					String ay =  ((IWorkCentreElement) y).modelObject().getDescription().getWorkCentreDescription().get$0023SimpleContent().toString().toUpperCase(); 
						if (ax == null) {
						  return ay == null ? 0 : 1;
						}
					return ax.compareTo(ay);
				 }
			}
		);
  }

Hope i help you

Marcos

former_member193964
Active Participant
0 Kudos

Marcos,

I'm so glad for your answer.. But I need to put too the sort icon in the "popup". The same way in the table when we have filter and sort. I think is no possoble because this view is created dynamically.

Regards,

Marcelo

Former Member
0 Kudos

Sorry,

I haven't had understanding your problem better.

You can use the OVS type of Value Help. This type of Value Help have sort and filter, and you can put more than one column in the search result table.

Regards

Marcos

Answers (1)

Answers (1)

siarhei_pisarenka3
Active Contributor
0 Kudos

Hi Marcelo

Sorting is available programmatically:

IModifiableSimpleValueSet.sort(boolean sortKey,boolean up,boolean ignoreCase);
IModifiableSimpleValueSet.sort(Comparator<? super T> comparator);

BR, Sergei