on 02-20-2014 2:13 PM
Hi experts,
I'm having a problem, on the contribution.ztl file, I created the following code
String getSelectedValue(){*
return this.selectedValue;
*}
Which I fire when the value is changed on the combobox, with the following code.
that.setProperty("selectedValue",that.getValue());
that.fireDesignStudioPropertiesChanged(["selectedValue"]);
that.fireDesignStudioEvent("onchange");
But it always return undifined when I try to show the result of the function getSelectedValue.
My code is here
https://github.com/olafecorcam/com.leandro.gp.combobox
Any ideas?
By the way, this component I'm creating so that I can add "ALL" to the list of values inside the combo, as per now the native one comes with the first value already selected, which is causing confusion on the users.
Best
Leandro
Add this property in contribution.xml:
<property type="String" id="selectedValue" title="Selected Value (Needed whether you want it in a property sheet or not)" visible="false"/>
Also, change this code snippet in component.js:
initDesignStudio : function() {
try {
var that = this;
this.attachChange(function() {
alert(that.getValue());
// Do this:
that.setSelectedValue(that.getValue());
// Not this:
// that.setProperty("selectedValue",that.getValue());
that.fireDesignStudioPropertiesChanged(["selectedValue"]);
that.fireDesignStudioEvent("onchange");
});
} catch (e) {
alert(e); // Aw snap
}
There, fixed.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Leandro,
just as a quick check on this comment here:
--------
By the way, this component I'm creating so that I can add "ALL" to the list of values inside the combo, as per now the native one comes with the first value already selected, which is causing confusion on the users.
-------
You are aware that the setItems option does have an option to add "ALL" to the list of items ?
regards
Ingo Hilgefort
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ingo,
Thanks for the tip, but now I came across another problem.
I'm using the native dropdown now, and there's 4 of them, and I created a button that clear all applied filters, I can't set the combo value back to "All".. I
tried
DP_RAMO.setSelectedValue("");
DP_RAMO.setSelectedValue("All");
DP_RAMO.setSelectedValue("(ALL_MEMBERS)");
But none of it worked.
Can you help me?
Best
Leandro
I tried that, and nothing.
What worked was,
DP_MES.setItems(DS_GRAFICO.getMemberList("0PLANT", MemberPresentation.INTERNAL_KEY, MemberDisplay.TEXT, 0,"Todos"));
DP_MES.setItems(DS_GRAFICO.getMemberList("0CALMONTH2", MemberPresentation.INTERNAL_KEY, MemberDisplay.TEXT, 0,"Todos"));
I had to set a different list, and than set the right one back, and that did the trick.
Best
Leandro
LOL, glad you found a combination of commands to knock it into submission for you.
I'd tend to agree with Ingo that having to do it in this manner is kind of unnecessary but at the end of the day sometimes you must do what works and move on, I suppose!
At least you've come to two options of how to overcome it now! (BIAL script trickery or an Addon).
User | Count |
---|---|
88 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.