WiX. Run a custom action when a checkbox is checked - checkbox

I have two files Product.wxc there i wrote
<Property Id="CheckBoxProp">
and Custom Action
<InstallExecuteSequence>
<Custom Action="MyCustomAction" After="InstallInitialize">
CheckBoxProp=1
</Custom>
</InstallExecuteSequence>
In another file MyCheckBoxDlg.wxc I wrote UI dialog there I described checkbox
<Control Type="CheckBox" Id="MyCheckBoxID" Width="125" Height="26" X="26" Y="124" Text="My text" Property="CheckBoxProp" CheckBoxValue="1" />
All publishs I wrote in another file where I have a DialogRef to MyCheckBoxDlg
When I start my installation customaction doesn't see change of value CheckBoxProp.
Help plz! I wait for your help.

CheckBoxProp is a private not a secure (public) property. Change it to CHECKBOXPROP and use the Secure attribute to get it listed in the SecureCustomProperties property.

Related

How can I have a custom URL for Episerver Edit mode?

I wanted to have a custom URL for the pages displayed in edit mode.
Yes, this is possible. You need to change some places in web.config:
<episerver.packaging protectedVirtualPath="~/episerver" />
and
<applicationSettings uiUrl="~/episerver/CMS/" />
and
<virtualPathProviders> entry for ProtectedModules, <add name="ProtectedModules" virtualPath="~/episerver/" />
and all the <location> elements pointing to "episerver...".

Wix does not set property value based on checkbox on unistall

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/

Submit data-table in JSF / Primefaces?

I am working on a web application using jsf/ primefaces, netbeans and tomcat.
I have a datatable with some values loaded in from another table and some editable fields. My question is, after the user has edited this table how do i submit the whole table so it can be stored in a database, in a new table?
<h:form id="form" prependId="false">
<h3>All of your Paddocks</h3>
<p:dataTable var="paddock" value="#{paddock.getfromPaddock()}" editable="true">
<p:ajax event="rowEdit" listener="#{paddock.onRowEdit}" />
<p:ajax event="rowEditCancel" listener="#{paddock.onRowCancel}" />
<p:column headerText="Id">
<h:outputText value="#{paddock.idPaddock}" />
</p:column>
<p:column headerText="Name">
<h:outputText value="#{paddock.name}" />
</p:column>
<p:column headerText="Area">
<h:outputText value="#{paddock.area}" />
</p:column>
<p:column headerText="Enter Grass Weight">
<p:cellEditor>
<f:facet name="output"><h:outputText value="0" /></f:facet>
<f:facet name="input"><p:inputText id="modelInput" value="0" style="width:100%"/></f:facet>
</p:cellEditor>
</p:column>
<p:column style="width:32px">
<p:rowEditor />
</p:column>
</p:dataTable>
<h:commandButton value="Log" action="#{paddock.add}" />
</h:form>
Note that the only editable column is the grass column.
First of all, there are two main mistakes which may have undesired side effects:
<h:form ... prependId="false">
Never use prependId. Remove the whole attribute.
<p:dataTable var="paddock" value="#{paddock.getfromPaddock()}">
You should give var a different name than the managed bean. E.g. paddockItem.
As to the concrete question, your other mistake is here:
<p:inputText id="modelInput" value="0" />
You didn't bind the input value to the model. So JSF won't be able to update the model with the submitted values anyway.
Fix it accordingly, e.g.:
<p:inputText id="modelInput" value="#{paddockItem.grass}" />
In the submit method, it'll be right away there in the model.
You should only make absolutely sure that you aren't interacting with the database in the getter method of the <p:dataTable value>, otherwise you will be overwriting the model on every iteration round, hereby basically trashing the submitted values until the last row before the submit method is hit. The strange method name behind the data table value value="#{paddock.getfromPaddock()}" namely suggests that you're doing that. If it were a real property, the average starter would just have used value="#{paddock.fromPaddock}" or so.
See also:
How and when should I load the model from database for h:dataTable

How to add control to the module

I've seen a few examples but they are outdated.
I'm using standard template for module creation with View, Edit, Setting.
I'm adding a new control TestPage : MyModuleBase
in mymodule.dnn
<moduleControl>
<controlKey>TestPage</controlKey>
<controlSrc>DesktopModules/mymodule/TestPage.ascx</controlSrc>
<supportsPartialRendering>False</supportsPartialRendering>
<controlTitle>TestPage.ascx</controlTitle>
<controlType>Edit</controlType>
<iconFile />
<helpUrl />
<viewOrder>0</viewOrder>
</moduleControl>
then on View on button click:
this.Response.Redirect(DotNetNuke.Common.Globals.NavigateURL(this.TabId, "TestPage"));
and it redirects to /mymodule/ctl/TestPage/portalid/0 and it is empty.
What is wrong in my settings?
You have to use EditURL instead of NavigateURL in order to specify you want to load a specific control for the module that the moduleID is specified in the URL.

Obout Suite Superform DateField issue

I am using the Obout Suite in a website.
I have a SuperForm control in which I have inserted some controls like BoundFields or DateFields.
The problem is that when I select a date at the DateField Calendar, the textbox associated doesn't refresh the value of the date.
I have something like:
<obout:SuperForm ID="SuperForm2" runat="server" AutoGenerateInsertButton ="true" AutoGenerateEditButton="false" AutoGenerateDeleteButton="false" AutoGenerateRows="false" DataKeyNames="IdDocumento" DefaultMode="Insert" Width="525" DataSourceID="SqlDataSource2">
<Fields>
<obout:BoundField DataField="DocumentType" HeaderText="Name" FieldSetID="FieldSet1" />
<obout:DateField DataField="OrderDate" HeaderText="Order Date" FieldSetID="FieldSet2" DataFormatString="{0:MM/dd/yyyy}" ApplyFormatInEditMode="true" />
<obout:DateField DataField="RequiredDate" HeaderText="Required Date" FieldSetID="FieldSet2" DataFormatString="{0:MM/dd/yyyy}" ApplyFormatInEditMode="true" />
</Fields>
<FieldSets>
<obout:FieldSetRow>
<obout:FieldSet ID="FieldSet1" />
</obout:FieldSetRow>
<obout:FieldSetRow>
<obout:FieldSet ID="FieldSet2" />
</obout:FieldSetRow>
</FieldSets>
</obout:SuperForm>
The tag prefix is:
<%# Register TagPrefix="obout" Namespace="Obout.SuperForm" Assembly="obout_SuperForm" %>
The "obout_Calendar2_Net.dll" is referenced by the solution.
Am I forgotting something?
Thanks in advance.
Cartojal
Well, finally I found the solution. If you are using .net 4.0, like me.... you must to add the attribute clientIDMode="AutoID" to the section "pages" at the web.config file:
<pages clientIDMode="AutoID">
....
</pages>
This generate the asp.net controls ids like past versions of .net

Resources