AEM sightly Binding Issue.!

Avatar

Avatar
Validate 1
Level 2
imadullakhan
Level 2

Likes

5 likes

Total Posts

53 posts

Correct reply

1 solution
Top badges earned
Validate 1
Establish
Give Back
Boost 5
Boost 3
View profile

Avatar
Validate 1
Level 2
imadullakhan
Level 2

Likes

5 likes

Total Posts

53 posts

Correct reply

1 solution
Top badges earned
Validate 1
Establish
Give Back
Boost 5
Boost 3
View profile
imadullakhan
Level 2

03-06-2020

Hi @All,

 

I am facing slightly AEM binding issue, I have some value for rating which is coming from somewhere that value I need to bind in below this html and the value will be example : 2.5 this value I need to bind in the html can anyone help me please.

And the Html is like this --->

 

<div class="rating" id="ratings">
<input type="radio" name="rating" value="5" id="5">
<label for="5">&#x2605;</label>
<input type="radio" name="rating" value="4" id="4">
<label for="4">&#x2605;</label>
<input type="radio" name="rating" value="3" id="3">
<label for="3">&#x2605;</label>
<input type="radio" name="rating" value="2" id="2">
<label for="2">&#x2605;</label>
<input type="radio" name="rating" value="1" id="1">
<label for="1">&#x2605;</label>
</div>

 

if i can bind means i would to get visible the CSS.

Here &#x2605; is some CSS configuration value.

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Validate 1
MVP
ArpitVarshney
MVP

Likes

136 likes

Total Posts

185 posts

Correct reply

36 solutions
Top badges earned
Validate 1
Establish
Give Back 5
Give Back 3
Give Back 25
View profile

Avatar
Validate 1
MVP
ArpitVarshney
MVP

Likes

136 likes

Total Posts

185 posts

Correct reply

36 solutions
Top badges earned
Validate 1
Establish
Give Back 5
Give Back 3
Give Back 25
View profile
ArpitVarshney
MVP

03-06-2020

Hi @imadullakhan 

 

If you are looking for a reference, you can go through the below link which lets you select a 1.5,2.5 rating as well.

 https://codepen.io/tonkin/pen/MWwWGGg

 

If you want to pass the selected value to the backend, you can write an ajax request while the user selects any rating. This logic needs to implemented in JS.

 

Regards,

Arpit

Answers (2)

Answers (2)

Avatar

Avatar
Establish
MVP
Veena_Vikram
MVP

Likes

484 likes

Total Posts

1,049 posts

Correct reply

121 solutions
Top badges earned
Establish
Coach
Contributor 2
Seeker
Ignite 5
View profile

Avatar
Establish
MVP
Veena_Vikram
MVP

Likes

484 likes

Total Posts

1,049 posts

Correct reply

121 solutions
Top badges earned
Establish
Coach
Contributor 2
Seeker
Ignite 5
View profile
Veena_Vikram
MVP

03-06-2020

Are you sure this needs be done via sightly? The way I see it , I think its more of a Jquery task. If I understand your question correctly ; you are getting rating value form another URL. You get the value and replace it in your HTML !? If that is the case, you can use Jquery to replace the value to the corresponding div in your HTML.

Avatar

Avatar
Establish
MVP
Nupur_Jain
MVP

Likes

165 likes

Total Posts

186 posts

Correct reply

76 solutions
Top badges earned
Establish
Ignite 1
Give Back 5
Give Back 3
Give Back 25
View profile

Avatar
Establish
MVP
Nupur_Jain
MVP

Likes

165 likes

Total Posts

186 posts

Correct reply

76 solutions
Top badges earned
Establish
Ignite 1
Give Back 5
Give Back 3
Give Back 25
View profile
Nupur_Jain
MVP

03-06-2020

Hi @imadullakhan 

 

Can you specify in more detail from where the rating value is coming and what is you trying at your side that is giving an error? Also mention the final html output you desire.