[
https://issues.apache.org/jira/browse/ISIS-3030?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Han Hui Wen updated ISIS-3030:
-------------------------------
Description:
Here has a mulitiple level drop down list.
{code:java}
@Property(editing = Editing.ENABLED)
@Getter
@Setter
private String tc1Name; @Property(editing = Editing.ENABLED)
@Getter
@Setter
private String tc2Name; @Property(editing = Editing.ENABLED)
@Getter
@Setter
private String tc3Name; @Property(editing = Editing.ENABLED)
@Getter
@Setter
private String tc4Name; public List<String> choices0Create() {
List<Tc1Object> list = tc1ObjectRepo.findAll();
List<String> nameList = list.stream().map(i ->
i.getTechCapabL1Name()).distinct().collect(Collectors.toList());
return nameList;
} public String default0Create() {
return getTc1Name();
} public List<String> choices1Create(String tc1Name) {
System.out.println("tc1Name: " + tc1Name);
Tc1Object tc1 = tc1ObjectRepo.findByTechCapabL1Name(tc1Name);
System.out.println("tc1: " + tc1);
List<Tc2Object> list = tc2ObjectRepo.findByTc1Object(tc1);
List<String> nameList = list.stream().map(i ->
i.getTechCapabL2Name()).distinct().collect(Collectors.toList());
return nameList;
} public String default1Create() {
return getTc2Name();
} public List<String> choices2Create(String tc2Name) {
System.out.println("tc2Name: " + tc2Name);
Tc2Object tc2 = tc2ObjectRepo.findByTechCapabL2Name(tc2Name);
System.out.println("tc2: " + tc2);
List<Tc3Object> list = tc3ObjectRepo.findByTc2Object(tc2);
System.out.println("tc list :" + list);
List<String> nameList = list.stream().map(i ->
i.getTechCapabL3Name()).distinct().collect(Collectors.toList());
return nameList;
} public String default2Create() {
return getTc3Name();
} public List<String> choices3Create(String tc3Name) {
Tc3Object tc3 = tc3ObjectRepo.findByTechCapabL3Name(tc3Name);
List<Tc4Object> list = tc4ObjectRepo.findByTc3Object(tc3);
List<String> nameList = list.stream().map(i ->
i.getTechCapabL4Name()).distinct().collect(Collectors.toList());
return nameList;
} public String default3Create() {
return getTc4Name();
} @Action(semantics = SemanticsOf.NON_IDEMPOTENT)
@ActionLayout(promptStyle = PromptStyle.DIALOG_MODAL)
public CtlgObject create(final String tc1Name, final String tc2Name, final
String tc3Name, final String tc4Name,
final String baseTechName) { setTc1Name(tc1Name);
setTc2Name(tc2Name); setTc3Name(tc3Name); setTc4Name(tc4Name);
return repositoryService.persist(new CtlgObject(tc1Name, tc2Name, tc3Name,
tc4Name, baseTechName));
} {code}
-----------------
in choices2Create(String tc2Name) function , value of tc2Name is equal
tc1Name ,it's equal the first drop dwon list value ,not the second drop down
list value .
was:
Here has a mulitiple level drop down list.
@Property(editing = Editing.ENABLED)
@Getter
@Setter
private String tc1Name;
@Property(editing = Editing.ENABLED)
@Getter
@Setter
private String tc2Name;
@Property(editing = Editing.ENABLED)
@Getter
@Setter
private String tc3Name;
@Property(editing = Editing.ENABLED)
@Getter
@Setter
private String tc4Name;
public List<String> choices0Create() {
List<Tc1Object> list = tc1ObjectRepo.findAll();
List<String> nameList = list.stream().map(i ->
i.getTechCapabL1Name()).distinct().collect(Collectors.toList());
return nameList;
}
public String default0Create() {
return getTc1Name();
}
public List<String> choices1Create(String tc1Name) {
Tc1Object tc1 = tc1ObjectRepo.findByTechCapabL1Name(tc1Name);
List<Tc2Object> list = tc2ObjectRepo.findByTc1Object(tc1);
List<String> nameList = list.stream().map(i ->
i.getTechCapabL2Name()).distinct().collect(Collectors.toList());
return nameList;
}
public String default1Create() {
return getTc2Name();
}
public List<String> choices2Create(String tc2Name) {
Tc2Object tc2 = tc2ObjectRepo.findByTechCapabL2Name(tc2Name);
List<Tc3Object> list = tc3ObjectRepo.findByTc2Object(tc2);
List<String> nameList = list.stream().map(i ->
i.getTechCapabL3Name()).distinct().collect(Collectors.toList());
return nameList;
}
public String default2Create() {
return getTc3Name();
}
@Action(semantics = SemanticsOf.NON_IDEMPOTENT)
@ActionLayout(promptStyle = PromptStyle.DIALOG_MODAL)
public CtlgObject create( final String tc1Name,
final String tc2Name,
final String tc3Name,
final String tc4Name,
final String baseTechName) {
setTc1Name(tc1Name);
setTc2Name(tc2Name);
setTc3Name(tc3Name);
return repositoryService.persist(new
CtlgObject(tc1Name,tc2Name,tc3Name,tc4Name,baseTechName));
}
-----------------
in choices2Create(String tc2Name) function , value of tc2Name is equal
tc1Name ,it's equal the first drop dwon list value ,not the second drop down
list value .
> Multiple level drop down List issue
> -----------------------------------
>
> Key: ISIS-3030
> URL: https://issues.apache.org/jira/browse/ISIS-3030
> Project: Isis
> Issue Type: Bug
> Components: Isis Applib (programming model)
> Reporter: Han Hui Wen
> Priority: Major
>
> Here has a mulitiple level drop down list.
>
>
> {code:java}
> @Property(editing = Editing.ENABLED)
> @Getter
> @Setter
> private String tc1Name; @Property(editing = Editing.ENABLED)
> @Getter
> @Setter
> private String tc2Name; @Property(editing = Editing.ENABLED)
> @Getter
> @Setter
> private String tc3Name; @Property(editing = Editing.ENABLED)
> @Getter
> @Setter
> private String tc4Name; public List<String> choices0Create() {
> List<Tc1Object> list = tc1ObjectRepo.findAll();
> List<String> nameList = list.stream().map(i ->
> i.getTechCapabL1Name()).distinct().collect(Collectors.toList());
> return nameList;
> } public String default0Create() {
> return getTc1Name();
> } public List<String> choices1Create(String tc1Name) {
> System.out.println("tc1Name: " + tc1Name);
> Tc1Object tc1 = tc1ObjectRepo.findByTechCapabL1Name(tc1Name);
> System.out.println("tc1: " + tc1);
> List<Tc2Object> list = tc2ObjectRepo.findByTc1Object(tc1);
> List<String> nameList = list.stream().map(i ->
> i.getTechCapabL2Name()).distinct().collect(Collectors.toList());
> return nameList;
> } public String default1Create() {
> return getTc2Name();
> } public List<String> choices2Create(String tc2Name) {
> System.out.println("tc2Name: " + tc2Name);
> Tc2Object tc2 = tc2ObjectRepo.findByTechCapabL2Name(tc2Name);
> System.out.println("tc2: " + tc2);
> List<Tc3Object> list = tc3ObjectRepo.findByTc2Object(tc2);
> System.out.println("tc list :" + list);
> List<String> nameList = list.stream().map(i ->
> i.getTechCapabL3Name()).distinct().collect(Collectors.toList());
> return nameList;
> } public String default2Create() {
> return getTc3Name();
> } public List<String> choices3Create(String tc3Name) {
> Tc3Object tc3 = tc3ObjectRepo.findByTechCapabL3Name(tc3Name);
> List<Tc4Object> list = tc4ObjectRepo.findByTc3Object(tc3);
> List<String> nameList = list.stream().map(i ->
> i.getTechCapabL4Name()).distinct().collect(Collectors.toList());
> return nameList;
> } public String default3Create() {
> return getTc4Name();
> } @Action(semantics = SemanticsOf.NON_IDEMPOTENT)
> @ActionLayout(promptStyle = PromptStyle.DIALOG_MODAL)
> public CtlgObject create(final String tc1Name, final String tc2Name,
> final String tc3Name, final String tc4Name,
> final String baseTechName) { setTc1Name(tc1Name);
> setTc2Name(tc2Name); setTc3Name(tc3Name); setTc4Name(tc4Name);
> return repositoryService.persist(new CtlgObject(tc1Name, tc2Name,
> tc3Name, tc4Name, baseTechName));
> } {code}
>
>
> -----------------
> in choices2Create(String tc2Name) function , value of tc2Name is equal
> tc1Name ,it's equal the first drop dwon list value ,not the second drop down
> list value .
--
This message was sent by Atlassian Jira
(v8.20.7#820007)