I have two row commands running on a gridpanel like the following:
<ext:CommandColumn>
<Commands>
<ext:GridCommand Icon="NoteEdit" CommandName="mailEdit">
<ToolTip Text="Edit" />
</ext:GridCommand>
<ext:GridCommand Icon="ApplicationLightning" CommandName="mailChangeBlock">
<ToolTip Text="block/unblock" />
</ext:GridCommand>
</Commands>
</ext:CommandColumn>
now i listen to these row commands:
<Listeners>
<Command Handler="if(command == 'mailEdit'){mailEdit}else{mailChangeBlock}; console.log(command);"/>
</Listeners>
another try was following:
<Command Handler="(command == 'mailEdit') ? mailEdit : mailChangeBlock;" />
the console log is executed without problems, but a console.log in the function called is not executed, even though the function gets called as soon as you add brackets to each call, but then the data passed to the function is lost.
my question is now, how can i determine which command was executed and call a corresponding function and give value, metadata and record to it?
It is possible to send the Command name and other values by Extra Params:
<DirectEvents>
<Command OnEvent="GridCommand">
<ExtraParameters>
<ext:Parameter Name="commandname" Value="command" Mode="Raw" />
<ext:Parameter Name="recordid" Value="record.data.id" Mode="Raw" />
</ExtraParameters>
</Command>
</DirectEvents>
the determination of command can then be executed server-sided (command returns the CommandName defined in the CommandColumn) and then execute server-sided script.
Related
I've got these DEFs in my X3D file:
<ImageTexture DEF="texture1" URL="some/image1.png" />
...
<ImageTexture DEF="texture2" URL="some/image2.png" />
I wish to USE these in my ProtoInstances so that I don't have to create a texture node for each (with the corresponding http request for each), by referencing them by name in one of the proto fiels. Something like this:
<ProtoDeclare name="myProto">
<ProtoInterface>
<field name="texture" type="SFString" accessType="initializeOnly" />
</ProtoInterface>
<ProtoBody>
...
<!-- obviously this doesn't work, but you get the idea: -->
<ImageTexture USE="${texture}" />
...
</ProtoBody>
</ProtoDeclare>
...
<ProtoInstance name="myProto">
<FieldValue name="texture" value="texture1" />
</ProtoInstance>
I have tried with IS within the proto set to the one already defined, but it doesn't work for me:
<ProtoDeclare name="myProto">
<ProtoInterface>
<field name="texture" type="SFNode" accessType="initializeOnly" />
</ProtoInterface>
<ProtoBody>
...
<Appearance>
<IS><connect nodeField="texture" protoField="texture"/></IS>
</Appearance>
...
</ProtoBody>
</ProtoDeclare>
...
<ProtoInstance name="myProto">
<FieldValue name="texture">
<ImageTexture USE="texture1" />
</FieldValue>
</ProtoInstance>
I have also tried with a Script, but cannot find a way to make the link.
Any ideas are very welcome. Thanks!
The IS solution does work. My problem was a different one. The url of my textures was not properly written. Texture url is a MFString, so I had to enclose the value in additional single quotes, like this:
<ImageTexture DEF="texture1" URL='"some/image1.png"' />
...
<ImageTexture DEF="texture2" URL='"some/image2.png"' />
Note that at least in my case, with X_ITE as the browser, using quotes the other way round (double quotes around single quotes) did not work.
I have inside my MyVerifyReadyDlg.wxs checkbox control defined as following:
<Control Id="REMOVELOGSFILESCHECKBOX" Type="CheckBox" X="170" Y="170" Width="80" Height="17"
Property="REMOVINGLOGSPROPERTY" CheckBoxValue="0" Text="Remove logs files">
<Condition Action="show">Installed</Condition>
<Condition Action="hide">NOT Installed</Condition>
</Control>
and inside Product.wxs I have defined the property as:
<Property Id="REMOVINGLOGSPROPERTY" Secure="yes"/>
and also inside Product.wxs I have this component to remove a log files on uninstall:
<Component Id="logsFolderComponent" Guid="*" Directory="logsFolder">
<Condition>REMOVINGLOGSPROPERTY</Condition>
<RemoveFile Id="allLogsFiles" Name="*.log" On="uninstall"></RemoveFile>
</Component>
The problem is: it does not set the property(stays null) when I check the checkbox during an uninstallation, but if I use the checkbox on installation it removes the log files.
How I can set the property on uninstall?
Properties aren't automatically preserved anywhere between install and later operations. WiX provides the "remember property" pattern for this.
http://robmensching.com/blog/posts/2010/5/2/the-wix-toolsets-remember-property-pattern/
Scenario: I have an xml column in MSSQL database which I have to parse the XML data of that cell using XQuery .
Xml content : <AnchoredXml xmlns="urn:schema:Microsoft.Rtc.Management.ScopeFramework.2008" SchemaWriteVersion="2">
<Key ScopeClass="Global">
<SchemaId Namespace="urn:schema:Microsoft.Rtc.Management.Deploy.Topology.2008" ElementName="Topology" />
<AuthorityId Class="Host" InstanceId="00000000-0000-0000-0000-000000000000" />
</Key>
<Dictionary Count="1">
<Item>
<Key />
<Value Signature="b1ac04f7-d8f0-4300-86cf-fb2b3383536c">
<Topology xmlns="urn:schema:Microsoft.Rtc.Management.Deploy.Topology.2008">
<InternalDomains AllowAllDomains="false" DefaultDomain="ocsqa.com">
<InternalDomain Name="ocsqa.com" Authoritative="false" AllowSubDomains="false" />
</InternalDomains>
<Sites>
<CentralSite SiteId="1">
<Name>LyncSite</Name>
<Location />
</CentralSite>
</Sites>
<Clusters>
This is a piece of data of the xml content in that one cell.
I am using below query to traverse the nodes of above xml:
select #cluster = #Items.query('/DocItemSet/DocItem/Data/*[#SchemaWriteVersion="2"]/*[2]/*[1]/*[2]/*[1]/*[3]')
Output of the above query is :
<p1:Cluster xmlns:p1="urn:schema:Microsoft.Rtc.Management.Deploy.Topology.2008" RequiresReplication="true" RequiresSetup="true" Fqdn="XXXX.ocsqa.com">
<p1:ClusterId SiteId="1" Number="1" />
<p1:Machine OrdinalInCluster="1" Fqdn=" XXXX.ocsqa.com">
<p1:NetInterface InterfaceSide="Primary" InterfaceNumber="1" IPAddress="0.0.0.0" />
<p1:NetInterface InterfaceSide="External" InterfaceNumber="1" IPAddress="0.0.0.0" />
<p1:NetInterface InterfaceSide="Pstn" InterfaceNumber="1" IPAddress="0.0.0.0" />
</p1:Machine>
</p1:Cluster>
<p2:Cluster xmlns:p2="urn:schema:Microsoft.Rtc.Management.Deploy.Topology.2008" RequiresReplication="true" RequiresSetup="true" Fqdn=" XXXX2.ocsqa.com">
<p2:ClusterId SiteId="1" Number="2" />
<p2:Machine OrdinalInCluster="1" Fqdn=" XXXX2.ocsqa.com">
<p2:NetInterface InterfaceSide="Primary" InterfaceNumber="1" IPAddress="0.0.0.0" />
<p2:NetInterface InterfaceSide="External" InterfaceNumber="1" IPAddress="0.0.0.0" />
<p2:NetInterface InterfaceSide="Pstn" InterfaceNumber="1" IPAddress="0.0.0.0" />
</p2:Machine>
</p2:Cluster>
<p3:Cluster xmlns:p3="urn:schema:Microsoft.Rtc.Management.Deploy.Topology.2008" RequiresReplication="true" RequiresSetup="true" Fqdn=" XXXX2.ocsqa.com">
<p3:ClusterId SiteId="1" Number="3" />
<p3:Machine OrdinalInCluster="1" Fqdn=" XXXX2.ocsqa.com" />
</p3:Cluster>
Now using query mentioned as below :
select #fqdn = #cluster.value('(./*/*/#Fqdn)[1]','nvarchar(20)') Select #fqdn
Note the highlighted index no in above query.
Using this query we will be able to achieve the first Cluster available in xml, similarly I wanted to look for other Clusters as well.
So I wanted to use this query in while loop. For which I have to pass a variable instead of hardcoded int value. Something similar as below :
select #fqdn = #cluster.value('(./*/*/#Fqdn)[sql:variable("#test")]','nvarchar(20)')
I have referred some posts
How to use XPath with a variable in Oracle XMLTable?
http://www.jasonstrate.com/2011/01/xquery-for-the-non-expert-variable-use/
but I am getting error as below :
Msg 2389, Level 16, State 1, Line 35
XQuery [value()]: 'value()' requires a singleton (or empty sequence), found operand of type 'xdt:untypedAtomic *'
How to pass a variable into a XQuery of SQL statement?
You need to tell SQL Server that you are only interested in the a single node. Add a [1] at the end.
#cluster.value('(./*/*/#Fqdn)[sql:variable("#test")][1]','nvarchar(20)')
I have dotless installed on my website and it's running perfectly on my local machine and on the companys testserver but when deploying on production server it always returns 404 and I can't figure out why.
This is what I've done so far to get it to work:
Added the section
<section name="dotless" type="dotless.Core.configuration.DotlessConfigurationSectionHandler, dotless.Core" />
Added the mimeMap
<staticContent>
<mimeMap fileExtension=".less" mimeType="text/css" />
</staticContent>
Added the handler
<add name="dotless" path="*.less" verb="GET" type="dotless.Core.LessCssHttpHandler,dotless.Core" resourceType="File" preCondition="" />
And added the dotless element
<dotless minifyCss="true" cache="true" />
Did you add the handler at the correct place?
IIS6: under system.web\httpHandlers
IIS7: under system.webServer\handlers
Also make sure you have all less files in place. If you import other less files, all those files must be available. If a file is missing, dotless throws 404.
Is there a way to ensure, either through specifying order or by specifying dependencies, that one component will execute before another in WiX?
Specifically, I'm trying to create a database, then, optionally, run a script on it. My Wix looks similar to this:
<ComponentGroup Id="SQLServerComponentGroup">
<Component Id="SQLServerIstallScriptWA" Guid="" >
<Condition>INSTALLDB</Condition>
<mssql:SqlDatabase Id="dbWA" Server="localhost" Database="[DATABASENAME]" CreateOnInstall="yes" ConfirmOverwrite="yes" DropOnReinstall="no" DropOnUninstall="yes">
<mssql:SqlScript Id="dbWAScript" ContinueOnError="no" ExecuteOnInstall="yes" ExecuteOnReinstall="no" Sequence="1" BinaryKey="MSSQLCreateDBBin" />
</mssql:SqlDatabase>
</Component>
<Component Id="SQLServerCreateUserWA" Guid="">
<Condition>INSTALLDB AND DBCREATEUSER = 1</Condition>
<mssql:SqlDatabase Id="dbWA" Server="localhost" Database="[DATABASENAME]">
<mssql:SqlString Id="dbWACreateUser" ContinueOnError="no" ExecuteOnInstall="yes" ExecuteOnReinstall="no" ExecuteOnUninstall="no" Sequence="1" SQL="" />
</mssql:SqlDatabase>
</Component>
</ComponentGroup>
I want to ensure that the SQLServerInstallScriptWA component is executed before SQLServerCreateUserWA component.
Components are not ordered. However, SqlScript and SqlString have Sequence attributes that can be used to impose order. The SqlScript and SqlString Sequence attributes happen to be ordered together to handle just this scenario.