Claudia Hirt
2018-10-26 11:54:41 UTC
Hi all,
i have a question about IChoiceRenderer used for Selectboxes.
There is a method String getIdValue(Tobject, int index) to get the unique id value of an option object.
The javadoc says the following:
"This method is called to get the id value of an object (used as the value attribute of a choice element) The id can be extracted from the object like a primary key, or if the list is stable you could just return a toString of the index."
I wonder if it's a good idea to have the object and the index as parameters in this method. If the id value should be kind of a primary key of the object, it should not depend on the index, which has nothing to do with the object.
I cannot use this method in my case to check if an object which is not in the choices list has the same id value than the selected one in my selectbox. I tried to do this with wicket-extensions Select, which does not have a choice renderer by default and I only have the object in isSelectedmethod of Select, but not the index.
Best regards,
Claudia
i have a question about IChoiceRenderer used for Selectboxes.
There is a method String getIdValue(Tobject, int index) to get the unique id value of an option object.
The javadoc says the following:
"This method is called to get the id value of an object (used as the value attribute of a choice element) The id can be extracted from the object like a primary key, or if the list is stable you could just return a toString of the index."
I wonder if it's a good idea to have the object and the index as parameters in this method. If the id value should be kind of a primary key of the object, it should not depend on the index, which has nothing to do with the object.
I cannot use this method in my case to check if an object which is not in the choices list has the same id value than the selected one in my selectbox. I tried to do this with wicket-extensions Select, which does not have a choice renderer by default and I only have the object in isSelectedmethod of Select, but not the index.
Best regards,
Claudia