Hi Sven,
there is the JS plugin to detect changes in attributes (this might help to
detect changes in the star-rating.
http://meetselva.github.io/attrchange/ <http://meetselva.github.io/attrchange/>
This works fine in a pure html-file, but in Wicket the JS function is not
called (see below). I have created a quick start project:
https://github.com/cat1000/AttrChange <https://github.com/cat1000/AttrChange>
Would you mind to have a look at it?
$attrchange.attrchange({
trackValues: true,
callback: function(e) {
}
});
Thanks, Chris
> Am 18.04.2015 um 14:41 schrieb Chris <[email protected]>:
>
> Hi Sven,
>
> I tried following function but that still does only work with JQuery Rating
> JS disabled.
> With JQuery Rating, the function is not called.
>
> $('input[name=field1_type]').change(function() {
> trigger('click');
> });
>
>
> Below is the HTML code when Rating JS is enabled:
>
> <div class="rating" id="field1__type1482">
> <span class="star-rating-control"><div
> class="rating-cancel"><a title="Cancel Rating"></a></div>
> <div role="text" aria-label=""
> class="star-rating rater-0 star wicket-field1__type1482 star-rating-applied
> star-rating-live star-rating-on" id="tt1__field11489"><a
> title="radio16">radio16</a></div><div role="text" aria-label=""
> class="star-rating rater-0 star wicket-field1__type1482 star-rating-applied
> star-rating-live star-rating-on" id="tt1__field2148a"><a
> title="radio17">radio17</a></div><div role="text" aria-label=""
> class="star-rating rater-0 star wicket-field1__type1482 star-rating-applied
> star-rating-live star-rating-on" id="tt1__field3148b"><a
> title="radio18">radio18</a></div><div role="text" aria-label=""
> class="star-rating rater-0 star wicket-field1__type1482 star-rating-applied
> star-rating-live star-rating-on" id="tt1__field4148c"><a
> title="radio19">radio19</a></div><div role="text" aria-label=""
> class="star-rating rater-0 star wicket-field1__type1482 star-rating-applied
> star-rating-live" id="tt1__field5148d"><a
> title="radio20">radio20</a></div></span><input name="field1_type"
> type="radio" class="star wicket-field1__type1482 star-rating-applied"
> id="tt1__field11489" value="radio16" style="display: none;">
> <input name="field1_type" type="radio" class="star
> wicket-field1__type1482 star-rating-applied" id="tt1__field2148a"
> value="radio17" style="display: none;">
> <input name="field1_type" type="radio" class="star
> wicket-field1__type1482 star-rating-applied" id="tt1__field3148b"
> value="radio18" style="display: none;">
> <input name="field1_type" type="radio" class="star
> wicket-field1__type1482 star-rating-applied" id="tt1__field4148c"
> value="radio19" style="display: none;">
> <input name="field1_type" type="radio" class="star
> wicket-field1__type1482 star-rating-applied" id="tt1__field5148d"
> value="radio20" style="display: none;">
> </div>
>
>
> br Chris
>
>
>> Am 18.04.2015 um 13:46 schrieb Sven Meier <[email protected]>:
>>
>> Hi Chris,
>>
>> does the JS trigger click() on the radio when the user selects a rating?
>> When not, check for a callback to trigger click() by yourself.
>>
>> Regards
>> Sven
>>
>>
>> On 18.04.2015 13:34, Chris wrote:
>>> Hi Sven,
>>>
>>> thanks a lot for your help!
>>> I am using the jquery star rating JS to replace the radio boxes through
>>> stars - with that it does not work. Without it I just tried it and AJAX
>>> works (thanks for your feedback!)
>>> Why might there be a problem with the jQuery JS?
>>>
>>> br, Chris
>>>
>>>
>>>> Am 18.04.2015 um 13:24 schrieb Sven Meier <[email protected]>:
>>>>
>>>> Looks good.
>>>>
>>>> I've just added an AjaxFormChoiceComponentUpdatingBehavior to
>>>> wicket-examples' RadioGroupPage and it worked as expected.
>>>>
>>>> Which Wicket version? Can you create a quickstart?
>>>>
>>>> Have fun
>>>> Sven
>>>>
>>>> On 18.04.2015 13:19, Chris wrote:
>>>>> The html is as follows:
>>>>>
>>>>> <wicket:panel>
>>>>> <form wicket:id="form" class="form">
>>>>> <div class="rating" wicket:id="group">
>>>>> <input wicket:id="radio1" type="radio"/>
>>>>> <input wicket:id="radio2" type="radio"/>
>>>>> ...
>>>>> </div>
>>>>> </form>
>>>>> </wicket:panel>
>>>>>
>>>>> best regards, Chris
>>>>>
>>>>>
>>>>>> Am 18.04.2015 um 13:14 schrieb Chris <[email protected]>:
>>>>>>
>>>>>> Hi Sven,
>>>>>>
>>>>>> the form is added to a panel.
>>>>>>
>>>>>> Chris
>>>>>>
>>>>>>
>>>>>>> Am 18.04.2015 um 11:26 schrieb Sven Meier <[email protected]>:
>>>>>>>
>>>>>>> Hi,
>>>>>>>
>>>>>>> is your RadioGroup is bound to <wicket:container> in your markup?
>>>>>>>
>>>>>>> Sven
>>>>>>>
>>>>>>> On 18.04.2015 07:00, Chris wrote:
>>>>>>>> Hi all,
>>>>>>>>
>>>>>>>> I have a radio group with different radio choices and I would like to
>>>>>>>> add ajax behavior to the group.
>>>>>>>> With the method #AjaxFormChoiceComponentUpdatingBehavior, the
>>>>>>>> #onUpdate is never called currently.
>>>>>>>>
>>>>>>>> How to fix this?
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> Form form = new Form("form");
>>>>>>>> RadioGroup<RadioChoice> radioGroup = new
>>>>>>>> RadioGroup<RadioChoice>("group", new Model<RadioChoice>() {...}
>>>>>>>>
>>>>>>>> Radio<RadioChoice> radio1 = new Radio<RadioChoice>("radio1", new
>>>>>>>> Model<RadioChoice>(1));
>>>>>>>> Radio<RadioChoice> radio2 = new Radio<RadioChoice>("radio2", new
>>>>>>>> Model<RadioChoice>(2));
>>>>>>>> radioGroup.add(radio1);
>>>>>>>> radioGroupd.add(Radio2);
>>>>>>>>
>>>>>>>> form.add(radioGroup);
>>>>>>>>
>>>>>>>> radioGroup.add(new AjaxFormChoiceComponentUpdatingBehavior() {
>>>>>>>> protected void onUpdate(AjaxRequestTarget target) {
>>>>>>>> // Ajax actions here
>>>>>>>> }
>>>>>>>> });
>>>>>>>>
>>>>>>>> Thanks, Chris
>>>>>>>> ---------------------------------------------------------------------
>>>>>>>> To unsubscribe, e-mail: [email protected]
>>>>>>>> For additional commands, e-mail: [email protected]
>>>>>>>>
>>>>>>> ---------------------------------------------------------------------
>>>>>>> To unsubscribe, e-mail: [email protected]
>>>>>>> For additional commands, e-mail: [email protected]
>>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: [email protected]
>>>>>> For additional commands, e-mail: [email protected]
>>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: [email protected]
>>>>> For additional commands, e-mail: [email protected]
>>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: [email protected]
>>>> For additional commands, e-mail: [email protected]
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: [email protected]
>>> For additional commands, e-mail: [email protected]
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [email protected]
>> For additional commands, e-mail: [email protected]
>>
>