IDEMPIERE-191 Product Info search dialog assign the wrong value to the name field.

http://jira.idempiere.com/browse/IDEMPIERE-191
This commit is contained in:
Carlos Ruiz 2012-03-14 19:47:50 -05:00
parent 36494f3e91
commit cc07ae21b7
3 changed files with 24 additions and 5 deletions

View File

@ -480,9 +480,11 @@ public class InfoProduct extends Info implements ActionListener, ChangeListener
// Pick init // Pick init
fillPicks(M_PriceList_ID); fillPicks(M_PriceList_ID);
int M_PriceList_Version_ID = findPLV (M_PriceList_ID); int M_PriceList_Version_ID = findPLV (M_PriceList_ID);
// Set Value or Name // Set Value
if (value.startsWith("@") && value.endsWith("@")) if (value != null && value.length() > 0 && value.indexOf("_") > 0) {
fieldName.setText(value.substring(1,value.length()-1)); String values[] = value.split("_");
fieldValue.setText(values[0]);
}
else else
fieldValue.setText(value); fieldValue.setText(value);
// Set Warehouse // Set Warehouse

View File

@ -203,7 +203,7 @@ public class WSearchEditor extends WEditor implements ContextMenuListener, Value
public void onEvent(Event e) public void onEvent(Event e)
{ {
if (Events.ON_CHANGE.equals(e.getName()) || Events.ON_OK.equals(e.getName())) if (Events.ON_CHANGE.equals(e.getName()))
{ {
if (infoPanel != null) if (infoPanel != null)
{ {
@ -211,7 +211,19 @@ public class WSearchEditor extends WEditor implements ContextMenuListener, Value
infoPanel = null; infoPanel = null;
} }
actionText(getComponent().getText()); actionText(getComponent().getText());
}
else if ((Events.ON_OK.equals(e.getName()))) {
if (getComponent().getText() == null || getComponent().getText().length() == 0) {
// open Info window similar to swing client
if (infoPanel != null)
{
infoPanel.detach();
infoPanel = null;
}
actionText(getComponent().getText());
} else {
actionRefresh(getValue());
}
} }
else if (Events.ON_CLICK.equals(e.getName())) else if (Events.ON_CLICK.equals(e.getName()))
{ {

View File

@ -203,6 +203,11 @@ public class InfoProductPanel extends InfoPanel implements EventListener
// AutoQuery // AutoQuery
if (value != null && value.length() > 0) if (value != null && value.length() > 0)
{ {
// Set Value
if (value.indexOf("_") > 0) {
String values[] = value.split("_");
value = values[0];
}
// Set Value or Name // Set Value or Name
fieldValue.setText(value); fieldValue.setText(value);
testCount(); testCount();