AEM6.5 guideBridge API to get child data | Community
Skip to main content
srinivas_chann1
Level 7
February 14, 2023
Solved

AEM6.5 guideBridge API to get child data

  • February 14, 2023
  • 2 replies
  • 827 views

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

 

 

 

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by SivakumarKanoori

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") 

2 replies

Vijay_Katoch
Community Advisor
Community Advisor
February 15, 2023

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]);
}
SivakumarKanoori
Community Advisor
SivakumarKanooriCommunity AdvisorAccepted solution
Community Advisor
February 21, 2023

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") 

Thanks,Siva