update design attribute value dynamically
Clash Royale CLAN TAG#URR8PPP
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty margin-bottom:0;
up vote
2
down vote
favorite
Is there a way to update a 'defaul' or manually entered design attribute value?
For example,
component.cmp
<aura:component implements="forceCommunity:availableForAllPageTypes" access="global" >
<aura:attribute name="someString" type="string" default="myString"/>
<lightning:input aura:id="inputString" name="someString" label="change someString Attribute" value="!v.someString"/>
<lightning:button variant="brand" label="update someString attribute" onclick="! c.handleClick "/>
<div>value should be:</div>
<div>!v.someString</div>
</aura:component>
controller.js
(
handleClick : function(component, event, helper)
const newValue = component.find('inputString').get("v.value");
component.set('v.someString', newValue);
)
design file
<design:component>
<design:attribute name="someString" description="want to update"/>
</design:component>
Why all the hassle?
I implemented a set of templates a user can select from from a
lightning component, however, since all the logic is client side, the
state resets itself as soon as I refresh the page (to be expected), I
was wondering if, without apex, there was a way of changing the set
designed attribute value.
lightning-components design-attributes
add a comment |Â
up vote
2
down vote
favorite
Is there a way to update a 'defaul' or manually entered design attribute value?
For example,
component.cmp
<aura:component implements="forceCommunity:availableForAllPageTypes" access="global" >
<aura:attribute name="someString" type="string" default="myString"/>
<lightning:input aura:id="inputString" name="someString" label="change someString Attribute" value="!v.someString"/>
<lightning:button variant="brand" label="update someString attribute" onclick="! c.handleClick "/>
<div>value should be:</div>
<div>!v.someString</div>
</aura:component>
controller.js
(
handleClick : function(component, event, helper)
const newValue = component.find('inputString').get("v.value");
component.set('v.someString', newValue);
)
design file
<design:component>
<design:attribute name="someString" description="want to update"/>
</design:component>
Why all the hassle?
I implemented a set of templates a user can select from from a
lightning component, however, since all the logic is client side, the
state resets itself as soon as I refresh the page (to be expected), I
was wondering if, without apex, there was a way of changing the set
designed attribute value.
lightning-components design-attributes
add a comment |Â
up vote
2
down vote
favorite
up vote
2
down vote
favorite
Is there a way to update a 'defaul' or manually entered design attribute value?
For example,
component.cmp
<aura:component implements="forceCommunity:availableForAllPageTypes" access="global" >
<aura:attribute name="someString" type="string" default="myString"/>
<lightning:input aura:id="inputString" name="someString" label="change someString Attribute" value="!v.someString"/>
<lightning:button variant="brand" label="update someString attribute" onclick="! c.handleClick "/>
<div>value should be:</div>
<div>!v.someString</div>
</aura:component>
controller.js
(
handleClick : function(component, event, helper)
const newValue = component.find('inputString').get("v.value");
component.set('v.someString', newValue);
)
design file
<design:component>
<design:attribute name="someString" description="want to update"/>
</design:component>
Why all the hassle?
I implemented a set of templates a user can select from from a
lightning component, however, since all the logic is client side, the
state resets itself as soon as I refresh the page (to be expected), I
was wondering if, without apex, there was a way of changing the set
designed attribute value.
lightning-components design-attributes
Is there a way to update a 'defaul' or manually entered design attribute value?
For example,
component.cmp
<aura:component implements="forceCommunity:availableForAllPageTypes" access="global" >
<aura:attribute name="someString" type="string" default="myString"/>
<lightning:input aura:id="inputString" name="someString" label="change someString Attribute" value="!v.someString"/>
<lightning:button variant="brand" label="update someString attribute" onclick="! c.handleClick "/>
<div>value should be:</div>
<div>!v.someString</div>
</aura:component>
controller.js
(
handleClick : function(component, event, helper)
const newValue = component.find('inputString').get("v.value");
component.set('v.someString', newValue);
)
design file
<design:component>
<design:attribute name="someString" description="want to update"/>
</design:component>
Why all the hassle?
I implemented a set of templates a user can select from from a
lightning component, however, since all the logic is client side, the
state resets itself as soon as I refresh the page (to be expected), I
was wondering if, without apex, there was a way of changing the set
designed attribute value.
lightning-components design-attributes
lightning-components design-attributes
edited 5 hours ago
asked 6 hours ago
glls
9,91961945
9,91961945
add a comment |Â
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
3
down vote
accepted
You can dynamically change the options available in a design attribute -- at least picklist attributes -- by extending the VisualEditor.DynamicPickList class, but there isn't a way to change a value that was entered in Lightning App Builder. (You can manipulate the value once the component loads, but that won't change the value you'll see in the App Builder.)
that has been my experience so far - not sure if there is/was a way of achieving this, guess im going to have to add some apex or server side controller to manage whatis displayed then.
â glls
5 hours ago
So what's the requirement you're trying to solve for?
â Shane Steinfeld
5 hours ago
1
i implemented a set of templates a user can select from from the lightning community builder, however, since all the logic is client side, the state resets itself as soon as i refresh the page, i was wondering if, without apex, there was a way of changing the set designed attribute value
â glls
5 hours ago
Interesting idea! So the problem is that the template selection is done inside the component, instead of in Community Builder, is that right?
â Shane Steinfeld
5 hours ago
_exactly that _
â glls
5 hours ago
 |Â
show 7 more comments
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
3
down vote
accepted
You can dynamically change the options available in a design attribute -- at least picklist attributes -- by extending the VisualEditor.DynamicPickList class, but there isn't a way to change a value that was entered in Lightning App Builder. (You can manipulate the value once the component loads, but that won't change the value you'll see in the App Builder.)
that has been my experience so far - not sure if there is/was a way of achieving this, guess im going to have to add some apex or server side controller to manage whatis displayed then.
â glls
5 hours ago
So what's the requirement you're trying to solve for?
â Shane Steinfeld
5 hours ago
1
i implemented a set of templates a user can select from from the lightning community builder, however, since all the logic is client side, the state resets itself as soon as i refresh the page, i was wondering if, without apex, there was a way of changing the set designed attribute value
â glls
5 hours ago
Interesting idea! So the problem is that the template selection is done inside the component, instead of in Community Builder, is that right?
â Shane Steinfeld
5 hours ago
_exactly that _
â glls
5 hours ago
 |Â
show 7 more comments
up vote
3
down vote
accepted
You can dynamically change the options available in a design attribute -- at least picklist attributes -- by extending the VisualEditor.DynamicPickList class, but there isn't a way to change a value that was entered in Lightning App Builder. (You can manipulate the value once the component loads, but that won't change the value you'll see in the App Builder.)
that has been my experience so far - not sure if there is/was a way of achieving this, guess im going to have to add some apex or server side controller to manage whatis displayed then.
â glls
5 hours ago
So what's the requirement you're trying to solve for?
â Shane Steinfeld
5 hours ago
1
i implemented a set of templates a user can select from from the lightning community builder, however, since all the logic is client side, the state resets itself as soon as i refresh the page, i was wondering if, without apex, there was a way of changing the set designed attribute value
â glls
5 hours ago
Interesting idea! So the problem is that the template selection is done inside the component, instead of in Community Builder, is that right?
â Shane Steinfeld
5 hours ago
_exactly that _
â glls
5 hours ago
 |Â
show 7 more comments
up vote
3
down vote
accepted
up vote
3
down vote
accepted
You can dynamically change the options available in a design attribute -- at least picklist attributes -- by extending the VisualEditor.DynamicPickList class, but there isn't a way to change a value that was entered in Lightning App Builder. (You can manipulate the value once the component loads, but that won't change the value you'll see in the App Builder.)
You can dynamically change the options available in a design attribute -- at least picklist attributes -- by extending the VisualEditor.DynamicPickList class, but there isn't a way to change a value that was entered in Lightning App Builder. (You can manipulate the value once the component loads, but that won't change the value you'll see in the App Builder.)
answered 5 hours ago
Shane Steinfeld
1,247418
1,247418
that has been my experience so far - not sure if there is/was a way of achieving this, guess im going to have to add some apex or server side controller to manage whatis displayed then.
â glls
5 hours ago
So what's the requirement you're trying to solve for?
â Shane Steinfeld
5 hours ago
1
i implemented a set of templates a user can select from from the lightning community builder, however, since all the logic is client side, the state resets itself as soon as i refresh the page, i was wondering if, without apex, there was a way of changing the set designed attribute value
â glls
5 hours ago
Interesting idea! So the problem is that the template selection is done inside the component, instead of in Community Builder, is that right?
â Shane Steinfeld
5 hours ago
_exactly that _
â glls
5 hours ago
 |Â
show 7 more comments
that has been my experience so far - not sure if there is/was a way of achieving this, guess im going to have to add some apex or server side controller to manage whatis displayed then.
â glls
5 hours ago
So what's the requirement you're trying to solve for?
â Shane Steinfeld
5 hours ago
1
i implemented a set of templates a user can select from from the lightning community builder, however, since all the logic is client side, the state resets itself as soon as i refresh the page, i was wondering if, without apex, there was a way of changing the set designed attribute value
â glls
5 hours ago
Interesting idea! So the problem is that the template selection is done inside the component, instead of in Community Builder, is that right?
â Shane Steinfeld
5 hours ago
_exactly that _
â glls
5 hours ago
that has been my experience so far - not sure if there is/was a way of achieving this, guess im going to have to add some apex or server side controller to manage whatis displayed then.
â glls
5 hours ago
that has been my experience so far - not sure if there is/was a way of achieving this, guess im going to have to add some apex or server side controller to manage whatis displayed then.
â glls
5 hours ago
So what's the requirement you're trying to solve for?
â Shane Steinfeld
5 hours ago
So what's the requirement you're trying to solve for?
â Shane Steinfeld
5 hours ago
1
1
i implemented a set of templates a user can select from from the lightning community builder, however, since all the logic is client side, the state resets itself as soon as i refresh the page, i was wondering if, without apex, there was a way of changing the set designed attribute value
â glls
5 hours ago
i implemented a set of templates a user can select from from the lightning community builder, however, since all the logic is client side, the state resets itself as soon as i refresh the page, i was wondering if, without apex, there was a way of changing the set designed attribute value
â glls
5 hours ago
Interesting idea! So the problem is that the template selection is done inside the component, instead of in Community Builder, is that right?
â Shane Steinfeld
5 hours ago
Interesting idea! So the problem is that the template selection is done inside the component, instead of in Community Builder, is that right?
â Shane Steinfeld
5 hours ago
_exactly that _
â glls
5 hours ago
_exactly that _
â glls
5 hours ago
 |Â
show 7 more comments
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsalesforce.stackexchange.com%2fquestions%2f234419%2fupdate-design-attribute-value-dynamically%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password