Hi Paul,
I use debug mode to view how ajaxAutoCompletion use variables and I'm surprised about autoCompletion never set selection variable.
Is this normal for an autoCompletion?
I put a breakpoint on this method
public void setMyObjectSelection(MyClass myObject) {
_myObjectSelection = myObject
);
and runtime never stop there.
thanks.
Sorry for late answer, I was in training for Talend.
I use debug mode to view how ajaxAutoCompletion use variables and I'm surprised about autoCompletion never set selection variable.
Is this normal for an autoCompletion?
I put a breakpoint on this method
public void setMyObjectSelection(MyClass myObject) {
_myObjectSelection = myObject
);
and runtime never stop there.
thanks.
Sorry for late answer, I was in training for Talend.
Envoyé depuis iCloud
Le 17 nov 2011 à 03:31, Raymond NANEON <[email protected]> a écrit :
Hi Paul,
Thanks a lot.
I go to try your methods.
RayEnvoyé depuis iCloud
Le 17 nov 2011 à 03:14, Paul Yu <[email protected]> a écrit :RaymondI find that using the following variable naming convention helps a lot.public MyClass myObjectItem; // used for binding to item bindingprivate MyClass _myObjectSelection; // used for binding to selection bindingpublic MyClass myObjectSelction() { return _myObjectSelection};public void setMyObjectSelection(MyClass myObject) { _myObjectSelection = myObject );private NSArray<MyClass> _myObjects; // for binding to list of the componentpublic NSArray<MyClass> myObjects {if (_myObjects == null) {_myObjects = MyClass.fetchAllMyObjects(editingContext(), MyClass.SORT_ATTRIBUTE.ascs());}return _myObjects;}// if there is an AjaxObserveField actionpublic WOActionResults selectedMyObject() {// do what you need to do here.return null;}Hope this helps.PaulOn Nov 17, 2011, at 6:04 AM, Raymond NANEON wrote:_______________________________________________Hi Stefan,
I don't use selectedMotClefs because the value on selected item is NULL so I get javaNullPointerException in lesMotsClefs1() method with selectedMotClefs in parameter, it's the reason why I stuck on this problem.
Thanks for your helpEnvoyé depuis iCloud
Le 17 nov 2011 à 02:51, Stefan Klein <[email protected]> a écrit :Hi Raymond,
that sounds like you are using the value bound to "item". Try using selectedMotClefs and selectedMotClefs1;
Stefan
Am 17.11.11 11:08, schrieb Raymond NANEON:Hi All,
I try to create a cascading autocompletion but I have a big problem retrieving the id of the selected item. In fact when I select the data, the id that I get is the last item in the list. What I mean is that the id of the selected item never changes and I am completely stuck.
Example
HTML :
<wo name = "autoCompAOF1"><webobject name = "motClefsAutoComplete1" /></wo>
<webobject name = "autoComp2AUC">
<div id = "searchForm">
<webobject name = "motClefsAutoComplete2" />
</div>
</webobject>
WOD :
motClefsAutoComplete1 : AjaxAutoComplete {
id = "auto1";
list = matchMotcClefs;
item = motClefsRepetition;
displayString = .motClefsRepetition.refidxval;
selection = selectedMotClefs;
value = motClefs;
}
autoCompAOF1 : AjaxObserveField {
id="autoCompAOF1";
fullSubmit = true;
elementName = "span";
action = ""> updateContainerID = "pop2";
}
motClefsAutoComplete2 : AjaxAutoComplete {
id = "auto2";
list = matchMotcClefs1;
item = motClefsRepetition1;
displayString = motClefsRepetition1.refidxval;
selection = selectedMotClefs1;
value = motClefs1;
}
JAVA :
// AutoCompletion1 data list
public NSArray<EORefidx> matchMotcClefs() {
if(matchMotcClefs == null){
if(motClefs == null){
matchMotcClefs = null;
} else {
matchMotcClefs = EORefidx.REFIDXVAL.containsAll(motClefs).filtered(lesMotsClefs());
}
}
return matchMotcClefs.immutableClone();
}
// AutoCompletion2 data list which depends to selected item in AutoCompletion1
public NSArray<EORefidx> matchMotcClefs1() {
if(matchMotcClefs1 == null){
if(motClefs1 == null){
matchMotcClefs1 = null;
} else {
matchMotcClefs1 = EORefidx.REFIDXVAL.containsAll(motClefs1).filtered(listMotclefs1);
}
}
return matchMotcClefs1.immutableClone();
}
private NSArray<EORefidx> lesMotsClefs(){
if(listMotclefs == null){
listMotclefs = EORefidx.fetchGetMotsClefsParents(session().defaultEditingContext());
}
return listMotclefs;
}
public NSArray<EORefidx> lesMotsClefs1(){
if(listMotclefs1 == null){
listMotclefs1 = EORefidx.fetchGetMotClefs(session().defaultEditingContext(),Integer.valueOf(motClefsRepetition.primaryKey()));
}
return listMotclefs1;
}
public WOActionResults refreshPop2() {
if (motClefsRepetition() != null) {
lesMotsClefs1();
}
return null;
}
Thank you for your helpEnvoyé depuis iCloud_______________________________________________ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list ([email protected]) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/stefan.klein%40buero-sde.deThis email sent to [email protected]_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/rnaneon%40me.com
This email sent to [email protected]
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/pyu%40mac.com
This email sent to [email protected]_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/rnaneon%40me.com
This email sent to [email protected]
_______________________________________________ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list ([email protected]) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to [email protected]
