Episerver 7.18 : Hide\Show a Block\Page properties on condition - episerver

I am using EPIServer 7 CMS. I have a requirement in block setup and its properties assignment in Edit mode for which I am trying to find the solution.
Scenario :
Created a Block Type which have 3 properties - Type, Input1, Input2
Type is a dropdown. Values are pupulated from enum. Values are Value1 and Value2
Requirement :
From Type when I select value "Value1" then I only need property "Input1" to be visible.
And from Type when I select value "Value2" then I need both properties "Input1" and "Input2" to be visible.

I'm assuming you need this in Edit Mode's Forms Editing. There is no built-in support for hiding other property fields from a property depending on it's value.
A workaround would be to have own block types for "Value1" and "Value2" and let the editor make the choice when creating the block.

There has been written a blogpost a world.episerver.com that might help you with this: http://world.episerver.com/Blogs/Duong-Nguyen/Dates/2014/1/Country-Region-drop-down-lists-in-All-properties-mode/

Related

how to store xtype value as String Array CQ5 / AEM

I have dialog with set of xtypes defined.
One of xtype is "selection" with type "select".
Now each option has a value type "String[]" , but when I add the component to a page and look at the option selected content.
It is stored as "String" rather than "String[]".
Could anyone tell me how to make/force a xtype store its values in a "String[]" , rather than "String".
You can use one of the Sling parameters to manipulate the content creation through the SlingPostServlet. Read more: here
In reality, just add a hidden field to your dialog that will pass the #TypeHint parameter with the expected property type. If your xtype saves data to e.g. cities property you can add the following:
<citiesTypeHint
jcr:primaryType="cq:Widget"
name="cities#TypeHint"
value="String[]"
xtype="hidden"
When you are adding xtype in dialog.xml, add it as :
property=value
This will create a property of String type with value as value.
If you want an array put the value in [], as :
property="[value1,value2,value3,...]"
This will create a property of String[] type with value as value. If you want to add more, separate then with coma.
If you want to define dataType, as :
property="{dataType}value"
This will create a property of dataType type with value as value. Where dataType may be any DataType like Boolean, Date, Long, etc
If you are adding Property with crx/de then click on add multi button in the bottom right corner.
Hope this Helps...:)
Mateusz ChromiƄski variant almost worked for me, except that value="String[]" results in emprty property, so I have used defaultValue="String[]" and it worked just perfect.
<targetGroupsTypeHint
jcr:primaryType="cq:Widget"
name="./targetGroups#TypeHint"
defaultValue="String[]"
xtype="hidden"/>
Enter the following in the dialog:
typeHint="String[]"

How can I declare and set the value from a radiobutton object with TSQL syntax?

I have a webform with a textfield.
The webform is connected to an integral database. But for this I don't need to store the value from this radiobutton into a table. I just want to take that value, and use it as a return for another field, just like it was not connected to a database at all.
In my TSQL code I assigned this textfield to a variable like this:
DECLARE #vak1 int
SET #vak1 = '[field name='vak1']'.
'field name' is the name of the object of that textfield. And I named it vak1.
I also want to put the checkedvalue from a radiobutton control into a variable, just like I did in the example above. But I dont know the name of the object, like in the above example it is field name for a textfield. So I need to know the standard name of a radiobutton object. These are all being used as LOCAL variables.
For example:
DECLARE #radio int
SET #radio = '[ x = 'No_cure_no_pay']'
The name No_cure_no_pay is the name of the radiobutton object. But what should I call x here? In the upper example it is 'field name' for a text field webcontrol.
What is the name for a radio button webcontrol?
The software I am using is custom made 3rd party software by a local Dutch company and it is not well known. So I cannot provide much info on the internals of the database. I don't have much code. Just these two lines would suffice, because the rest is pretty much the same just with different variable names. I will just use the values as return values. Just need to know how to declare and set a checked radiobutton value.

Store radiobutton checkedvalue in variable with TSQL

I have a webform with a textfield.
The webform is connected to an integral database. But for this I don't need to store the value from this radiobutton into a table. I just want to take that value, and use it as a return for another field, just like it was not connected to a database at all.
In my TSQL code I assigned this textfield to a variable like this:
DECLARE #vak1 int
SET #vak1 = '[field name='vak1']'.
'field name' is the name of the object of that textfield. And I named it vak1.
I also want to put the checkedvalue from a radiobutton control into a variable, just like I did in the example above. But I dont know the name of the object, like in the above example it is field name for a textfield. So I need to know the standard name of a radiobutton object. These are all being used as LOCAL variables.
For example:
DECLARE #radio int
SET #radio = '[ x = 'No_cure_no_pay']'
The name No_cure_no_pay is the name of the radiobutton object. But what should I call x here? In the upper example it is 'field name' for a text field webcontrol.
What is the name for a radio button webcontrol?
The software I am using is custom made 3rd party software by a local Dutch company and it is not well known. So I cannot provide much info on the internals of the database. I don't have much code. Just these two lines would suffice, because the rest is pretty much the same just with different variable names. I will just use the values as return values. Just need to know how to declare and set a checked radiobutton value.

How do get id & text from a dojo/dijit combobox?

How do you get the id for the underlying record in a combobox with dojo? I've tried altering the following sample but all I can get is the text shown to the user (the "name" property of each array element), and NOT the state's two-letter abbreviation ("id" property).
http://dojotoolkit.org/reference-guide/1.10/dijit/form/ComboBox.html#id3
thanks. PS, I'm a total noob with dojo. This is my first experiment with it.
It's like #CodeCrisis said, you can get the item by using dijit.byId('stateSelect').item. Though I'm not really pleased with how outdated the docs are (the dijit.byId()command is deprecated), this is a proper 1.10 solution:
query("button").on('click', function() {
console.log(comboBox.get('item'));
});
This will return the selected record in the store (containing both the id and name properties in this case).
A full, working example can be found here: http://jsfiddle.net/zt6xggL8/
How about this...
base on the link given
http://dojotoolkit.org/reference-guide/1.10/dijit/form/ComboBox.html#id3
change this onclick function
onClick="alert(dijit.byId('stateSelect').get('value'))"
into
onClick="alert(dijit.byId('stateSelect').item.id)"
i know this is not the best answer but i hope this will help you..
check out the answer of Philippe
Dojo : ComboBox selected and show data id
hehehe... :)
just passing by...
Not the prettiest but this works. Basically need to query the 'store' variable for the name that is being displayed when you just use 'value'. [0] denotes the first object in the store list, so if you have multiples with the same name, you'll need to use the foreach() function.
<button onClick="var namevar=dijit.byId('stateSelect').get('value');
alert(dijit.byId('stateSelect').get('store').query({name:namevar})[0].id);">
Get value
</button>

SSRS BIDS expression Show/Hide image based on passed through parameter

Is it possible to have an image available if a certain field is selected, in this case the parameter is #employeename, I only want the image that has been placed on the report to display if a certain value is true.
What is the syntax, field i am concerned with is employeename
The expression would be something like:
=IIf(Fields!employeename.Value = "Something", True, False)
You can have "Something" be a hard-coded value or another parameter. The key thing to remember is you have to access the .Value property.

Resources