Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Adobe Summit 2023 [19th to 23rd March, Las Vegas and Virtual] | Complete AEM Session & Lab list
SOLVED

AEM6.5 guideBridge API to get child data

Avatar

Level 8

Hello,

 

Could some one please provide inputs as how could I get the html text using guideBridge api from the below input field

 

The HTML content for the form is  :-

<label class="guideRadio " data-id="2" name="guideContainer-rootPanel" tabindex="0" aria-label="This is label" aria-required="true" aria-checked="false" placeholder="" data-original-title="" title="" role="radio">

<span class="guideRadioInput">

<input type="radio" id="guideContainer-rootPanel-2_widget" data-element-name="radioOption" name="radioOption" value="2" aria-required="true" style="position: relative;" element-name="radioOption" checkthis="test">

 </span>

<span class="guideRadioLabel"> This is radio label

<span class="guideRadioCaption">select a caption</span> </span>

</label>

 

On using the below code :-

let radioOption=guideBridge.resolveNode("radioOption");

 

1>on doing  console .log (radioOption.className) .

It is printing guideRadioButton

2>on doing radioOption.value  it gives the value as 2

 

How  to  get data for below:-

1> I would want to get the value from the attribute checkthis , how to get it using radioOption??

2>How to get data from other near elements based on class name guideRadioLabel and guideRadioCaption ??

 

Thanks,

Srinivas

 

 

 

 

1 Accepted Solution

Avatar

Correct answer by
Level 5

How  to  get data for below:-

1> I would want to get the value from the attribute checkthis , how to get it 

@srinivas_chann1 :

let radioOption=guideBridge.resolveNode("radioOption");

let checkthisValue = radioOption.checkthis;

 

2>How to get data from other near elements based on class name guideRadioLabel and guideRadioCaption ??

@srinivas_chann1 

you can use closest(".className") 

View solution in original post

2 Replies

Avatar

Level 6

try below by passing the property of the element.

 

var result = guideBridge.getElementProperty({
   propertyName: "value",
  somExpression: ["somExpression1", "somExpression2"]
});
if (result.errors) {
     console.log("some som expressions were invalid");
     var err = result.getNextMessage();
    while(err != null) {
         //err.somExpression will point to the invalid somExpression in the Field.
         console.log(err.message);
    }
}
for(var i = 0; i< result.data.length; i++) {
     console.log(result.data[i]);
}

Avatar

Correct answer by
Level 5

How  to  get data for below:-

1> I would want to get the value from the attribute checkthis , how to get it 

@srinivas_chann1 :

let radioOption=guideBridge.resolveNode("radioOption");

let checkthisValue = radioOption.checkthis;

 

2>How to get data from other near elements based on class name guideRadioLabel and guideRadioCaption ??

@srinivas_chann1 

you can use closest(".className")