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
BedrockMission!

Learn More

View all

Sign in to view all badges

Get PathBrowser Value

Avatar

Avatar
Boost 5
Level 2
keerthana_hn
Level 2

Likes

6 likes

Total Posts

20 posts

Correct Reply

0 solutions
Top badges earned
Boost 5
Boost 3
Boost 1
Validate 1
View profile

Avatar
Boost 5
Level 2
keerthana_hn
Level 2

Likes

6 likes

Total Posts

20 posts

Correct Reply

0 solutions
Top badges earned
Boost 5
Boost 3
Boost 1
Validate 1
View profile
keerthana_hn
Level 2

13-05-2021

Hi all,

 

keerthana_hn_0-1620889961350.png

I've created a button component and given resourceType "core/wcm/components/form/button/v2/button". I have added dialog to my component because an extra field was supposed to be added (Path Browser). I need to get the path browser value given in dialog box in js file. How can I do that? 

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Coach
MVP
Arun_Patidar
MVP

Likes

1,356 likes

Total Posts

3,227 posts

Correct Reply

917 solutions
Top badges earned
Coach
Contributor 2
Ignite 10
Give Back 700
Boost 1000
View profile

Avatar
Coach
MVP
Arun_Patidar
MVP

Likes

1,356 likes

Total Posts

3,227 posts

Correct Reply

917 solutions
Top badges earned
Coach
Contributor 2
Ignite 10
Give Back 700
Boost 1000
View profile
Arun_Patidar
MVP

14-05-2021

Answers (2)

Answers (2)

Avatar

Avatar
Boost 5
Level 2
keerthana_hn
Level 2

Likes

6 likes

Total Posts

20 posts

Correct Reply

0 solutions
Top badges earned
Boost 5
Boost 3
Boost 1
Validate 1
View profile

Avatar
Boost 5
Level 2
keerthana_hn
Level 2

Likes

6 likes

Total Posts

20 posts

Correct Reply

0 solutions
Top badges earned
Boost 5
Boost 3
Boost 1
Validate 1
View profile
keerthana_hn
Level 2

13-05-2021

@asutosh_jena 

 

keerthana_hn_0-1620893222421.png

<div class="hide" id="file_report_template">${properties.templatePath}</div>

I added this to my htl file and not able to hide the value

Avatar

Avatar
Give Back 100
Level 10
asutosh_jena
Level 10

Likes

559 likes

Total Posts

676 posts

Correct Reply

194 solutions
Top badges earned
Give Back 100
Boost 500
Affirm 100
Ignite 1
Establish
View profile

Avatar
Give Back 100
Level 10
asutosh_jena
Level 10

Likes

559 likes

Total Posts

676 posts

Correct Reply

194 solutions
Top badges earned
Give Back 100
Boost 500
Affirm 100
Ignite 1
Establish
View profile
asutosh_jena
Level 10

13-05-2021

Hi @keerthana_hn 

 

You want to read the path browser value from dialog field and perform some operation in JS which is located on clientlib.

So you need to read the field value and put it as a hidden value in HTML (put as hidden only if it's not required to be shown on page else you can attach to any attribute)

 

Now using the id or class attribute you can read the value and perform any action.

 

Let's say I have the node name as ./templatePath in the path browser and want to keep it as an hidden value in page.

<div class="hide" id="somevalue">${properties.templatePath}</div>

now in js:

var x = $("#somevalue").text();

x holds the value of the pathfield which is authored in dialog.

 

Thanks!