I have a dialog which lets the user choose a network share with the help of a custom action. I don't want the user to be able to continue the installation unless this location has been set. To achieve this aim, I disabled the PushButton Control that takes the user to the next dialog. My CustomAction sets a property which is checked for in the Condition element of that PushButton control.
This all works well. What is bothering me is that I want the user to be able to navigate through the dialogs as easily as possible. That's why I made the PushButton control, which takes the user to the browse dialog CustomAction, the Default control of the Dialog. This also is based on the condition of the property set by the CustomAction. After the property has been set, the PushButton taking the user to the next dialog is enabled and set as the default control. As you can see in the screenshots this actually works.
The interesting thing is that the Default control of the Dialog has indeed been changed, but the tabbed control still remains the PushButton which opens the browse dialog CustomAction. This circumstance leads to the erratic behaviour that when the Return key is pressed, the browse Dialog opens up again, although the Property has already been set, i.e. the folder path has already been chosen.
Is there any way I can correct this behaviour? I want the focus to move away from one control to the other based on the state of a property. How would I do that?
Also: How do the TabSkip and the Default attribute go together?
Here is the Code for the Dialog:
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Fragment>
<CustomActionRef Id="OpenFolderBrowser"/>
<UI>
<Dialog Id="RemoteViewDirectory" X="0" Y="0" Width="374" Height="266" Title="!(loc.GlobalDialogTitle)" NoMinimize="yes">
<Control Id="TopBanner" Type="Bitmap" X="0" Y="0" Width="374" Height="44" Text="TopBanner" TabSkip="yes" Disabled="yes" />
<Control Id="BannerLine" Type="Line" X="0" Y="44" Width="373" Height="0" TabSkip="yes" Disabled="yes" />
<Control Id="DlgSubTitle" Type="Text" X="13" Y="6" Width="292" Height="25" TabSkip="yes" Transparent="yes">
<Text><![CDATA[{&MSSansBold8}!(loc.VwDrctryDlgSubtitle)]]></Text>
</Control>
<Control Id="DlgDesc" Type="Text" X="21" Y="23" Width="292" Height="25" TabSkip="yes" Transparent="yes">
<Text><![CDATA[{&Tahoma8}!(loc.VwDrctryDlgDesc)]]></Text>
</Control>
<Control Id="GroupBox" Type="GroupBox" X="15" Y="174" Width="344" Height="41" TabSkip="yes">
<Text><![CDATA[!(loc.VwDrctryDlgSubtitle)]]></Text>
</Control>
<Control Id="ChangeRemoteFolder" Type="PushButton" X="285" Y="189" Width="66" Height="17" TabSkip="no">
<Text><![CDATA[!(loc.BtnTextChange)]]></Text>
<Condition Action="default"><![CDATA[NOT VIEWDIR]]></Condition>
<Publish Event="DoAction" Value="OpenFolderBrowser" Order="1">1</Publish>
<Publish Property="VIEWDIR" Value="[REMOTEDIR]" Order="2"><![CDATA[REMOTEDIR]]></Publish>
<Publish Property="REMOTEDIR" Order="3">1</Publish>
</Control>
<Control Id="ChgdLocation" Type="Text" X="57" Y="192" Width="220" Height="20" Property="VIEWDIR" Text="[VIEWDIR]" TabSkip="yes">
<Condition Action="show"><![CDATA[VIEWDIR]]></Condition>
<Condition Action="hide"><![CDATA[NOT VIEWDIR]]></Condition>
</Control>
<Control Id="DummyNetworkLocation" Type="Text" X="57" Y="192" Width="220" Height="20" Text="!(loc.TxtDummyViewNetworkPath)" TabSkip="yes">
<Condition Action="show"><![CDATA[NOT VIEWDIR]]></Condition>
<Condition Action="hide"><![CDATA[VIEWDIR]]></Condition>
</Control>
<Control Id="Back" Type="PushButton" X="164" Y="243" Width="66" Height="16" TabSkip="yes">
<Text>!(loc.BtnTextBack)</Text>
<Publish Event="NewDialog" Value="PreviousDialog">1</Publish>
</Control>
<Control Id="Next" Type="PushButton" X="230" Y="243" Width="66" Height="17" TabSkip="yes">
<Text>!(loc.BtnTextNext)</Text>
<Condition Action="enable"><![CDATA[VIEWDIR]]></Condition>
<Condition Action="disable"><![CDATA[NOT VIEWDIR]]></Condition>
<Condition Action="default"><![CDATA[VIEWDIR]]></Condition>
<Publish Event="NewDialog" Value="NextDialog">1</Publish>
</Control>
<Control Id="Cancel" Type="PushButton" X="301" Y="243" Width="66" Height="17" TabSkip="yes" Cancel="yes">
<Text>!(loc.BtnTextCancel)</Text>
<Publish Event="SpawnDialog" Value="CancelSetup">1</Publish>
</Control>
<Control Id="DlgLine" Type="Line" X="0" Y="234" Width="373" Height="0" TabSkip="yes" Disabled="yes" />
</Dialog>
</UI>
</Fragment>
</Wix>
And here is the output of the log created by Windows Installer:
Action 17:36:08: RemoteViewDirectory. Dialog created
MSI (c) (68:AC) [17:36:09:525]: Doing action: OpenFolderBrowser
Action 17:36:09: OpenFolderBrowser.
Action start 17:36:09: OpenFolderBrowser.
MSI (c) (68:28) [17:36:09:525]: Invoking remote custom action. DLL: C:\...\Temp\MSI9B.tmp, Entrypoint: OpenFolderBrowser
MSI (c) (68!1C) [17:36:18:608]: PROPERTY CHANGE: Adding \\Win2k3iis6\cmak property. Its value is 'exists'.
MSI (c) (68!1C) [17:36:18:608]: PROPERTY CHANGE: Adding REMOTEDIR property. Its value is '\\Win2k3iis6\cmak'.
Action ended 17:36:18: OpenFolderBrowser. Return value 1.
MSI (c) (68:AC) [17:36:18:638]: PROPERTY CHANGE: Adding VIEWDIR property. Its value is '\\Win2k3iis6\cmak'.
MSI (c) (68:AC) [17:36:18:638]: PROPERTY CHANGE: Deleting REMOTEDIR property. Its current value is '\\Win2k3iis6\cmak'.
I'm not aware of a way to control focus in the MSI UI. One thing you could try is to leave the Next button Default but Disabled. That might make the Enter key cause the focused button (the Change button) to be pressed. There is also a good chance that won't work. MSI UI is fairly limited in many ways.
To answer you second question TabSkip attribute removes a control from the tab order. In other words, a control with TabSkip='yes' should never be selected when pressing tab to navigate amongst the controls. The Default attribute indicates what button should be pressed when the Enter key is hit.
Related
I want to add a upload button the start-workflow page and for that i need to add upload component xml tags as follows in template instance:
<component>
<region-id>html-upload</region-id>
<url>/components/upload/html-upload</url>
</component>
<component>
<region-id>flash-upload</region-id>
<url>/components/upload/flash-upload</url>
</component>
<component>
<region-id>file-upload</region-id>
<url>/components/upload/file-upload</url>
</component>
<component>
<region-id>dnd-upload</region-id>
<url>/components/upload/dnd-upload</url>
</component>
<component>
<region-id>archive-and-download</region-id>
<url>/components/download/archive</url>
</component>
Why you wanted to add a upload button to the start-workflow page alfresco OOTB provides the workflow package you can attach your documents here.
You just need to define it in share config
<config evaluator="string-compare" condition="activiti$submitDocument">
<forms>
<form>
<field-visibility>
<show id="packageItems" />
</field-visibility>
<appearance>
<set id="general" appearance="title" label-id="workflow.set.other" />
<field id="packageItems" set="general" label="Purchase request document">
<control template="/org/alfresco/components/form/controls/workflow/packageitems.ftl">
</control>
</field>
</appearance>
</form>
</forms>
</config>
and you can get all the attached document using javascript
var documents = bpm_package.children;
It was as simple and obvious as it could have been. All you need to do is create a file named start-workflow.xml in the directory src/main/resources/alfresco/web-extension/site-data/template-instances. Then just copy paste the original file and add your components. This isn't enough in itself. You also have to add regions of these components to the template of start-workflow. Again, a simple process. Create a file start-workflow.ftl in the directory src/main/resources/alfresco/web-extension/site-data/templates/org/alfresco. Once again copy paste the original file and add your regions. In my case it was :
<#region id="html-upload" scope="template"/>
<#region id="flash-upload" scope="template"/>
<#region id="file-upload" scope="template"/>
<#region id="dnd-upload" scope="template"/>
<#region id="archive-and-download" scope="template"/>
I have a UX class called InputWithLabel that includes both a label and a TextInput.
I am trying to add an 'X' to it that can be used to clear the input text. My plan is to later add the functionality to only display this 'X' when there is actual text in the input field.
For now though, I can't figure out how to do this while not allowing the input to go over top of the 'X'. If you think it's a bug, I'll clean it up and report it as such but I suspect it's just something simple I don't understand so I thought I'd just ask you about it... I tried a number of ideas but none of them seemed to work for me...
<StackPanel ux:Class="InputWithLabel" Width="50%">
<string ux:Property="Label" />
<string ux:Property="Value"/>
<string ux:Property="IsPassword"/>
<Text Color="#28549b" FontSize="12" Margin="0,12,0,0" Value="{ReadProperty Label}"/>
<Rectangle CornerRadius="2" StrokeWidth="1" StrokeColor="#bdbebf">
<TextInput FontSize="16" Value="{Property Value}" IsPassword="{ReadProperty IsPassword}"/>
<Panel ux:Name="ClearButton" Alignment="Right">
<Rectangle SnapToPixels="True" Height="1px" Width="10px" Color="#bdbebf">
<Rotation Degrees="45"/>
</Rectangle>
<Rectangle SnapToPixels="True" Height="1px" Width="10px" Color="#bdbebf">
<Rotation Degrees="-45"/>
</Rectangle>
</Panel>
</Rectangle>
</StackPanel>
There is no bug, it's all about understanding how layout works in Fuse. When you put a TextInput along with a Panel in a Rectangle, they both occupy the same space. There is no implicit space consumption happening (by design). The result of that is, as you can see, that things go over one another.
To achieve what you need, it would be a far better strategy to go with a DockPanel, because inside of a DockPanel you can explicitly consume space by docking its children to its sides. Here's an example, based on the code you initially posted:
<StackPanel ux:Class="InputWithLabel" Width="50%" IsPassword="false">
<string ux:Property="Label" />
<string ux:Property="Value"/>
<string ux:Property="IsPassword"/>
<Text Color="#28549b" FontSize="12" Margin="0,12,0,0" Value="{ReadProperty Label}"/>
<DockPanel>
<Rectangle CornerRadius="2" StrokeWidth="1" StrokeColor="#bdbebf" Layer="Background" />
<TextInput FontSize="16" Value="{Property Value}" IsPassword="{ReadProperty IsPassword}" Margin="4">
<WhileContainsText Invert="true">
<Change clearButton.Visibility="Collapsed" />
</WhileContainsText>
</TextInput>
<Panel ux:Name="clearButton" Dock="Right">
<Rectangle SnapToPixels="True" Height="1px" Width="10pt" Color="#bdbebf">
<Rotation Degrees="45"/>
</Rectangle>
<Rectangle SnapToPixels="True" Height="1px" Width="10pt" Color="#bdbebf">
<Rotation Degrees="-45"/>
</Rectangle>
</Panel>
</DockPanel>
</StackPanel>
You'll notice I also included UX code for only showing the close button when there's some text in the input. Cheers!
You're welcome to visit Fuse docs to read more about Layout in general and Responsive layout in particular for useful details on the topic.
Can anyone post an example of how to setup fileuploaddialogbutton widget in a dialog?
I'm assuming this can be done - From the docs:
"The FileUploadDialogButton creates a button that opens a new dialog for uploading a file via the FileUploadField. Can be used inside edit dialogs where the upload must happen in a separate form in the new dialog."
The only results my searches seem to return is the Widget API documentation which offer no examples.
I've tried various random configurations in my dialog but get the JS error:
TypeError: c.setSize is not a function
c.setSize(cw || undefined, ch || undefined);
Note I'm not specifying any height or width in the config (documentation doesn't list them as options). Can anyone offer an example of how to configure this correctly (dialog.xml snippet would be great)?
Thanks in advance
EDIT:
Here is my dialog XML as it stands. It gives the error, but it's not the only version that causes this js error in the console, nor do I make any claims that this should work hence (due to the lack of documentation) me asking for an example.
<jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"
jcr:primaryType="cq:Dialog"
height="{Long}700"
xtype="dialog">
<items
jcr:primaryType="cq:Widget"
xtype="tabpanel">
<items jcr:primaryType="cq:WidgetCollection">
<tab1
jcr:primaryType="cq:Panel"
title="Tab 1">
<items jcr:primaryType="cq:WidgetCollection">
<name
jcr:primaryType="cq:Widget"
fieldLabel="Enter name"
name="./theName"
xtype="textfield"/>
<description
jcr:primaryType="cq:Widget"
fieldLabel="Change description"
name="./changeDescription"
xtype="richtext"/>
<files
jcr:primaryType="cq:Widget"
collapsed="{Boolean}false"
collapsible="{Boolean}false"
title="Files"
xtype="dialogfieldset">
<items jcr:primaryType="cq:WidgetCollection">
<test
jcr:primaryType="cq:Widget"
fieldLabel="Test"
xtype="textfield"/>
<file-upload
jcr:primaryType="cq:Widget"
dialogTitle="the dialog title"
fieldLabel="the field label"
text="the text"
xtype="fileuploaddialogbutton"/>
</items>
</files>
</items>
</tab1>
</items>
</items>
I have this problem in this scenario:
1-I made a new silverlight project with webapplication hosted the silverlight project.
2- when trying the silverlight project alone, it works very good with no errors.
3-but when trying the 'silverlighttestpage.aspx' the browser opens and a white page appears.and a the silverlight loading circle appears and after reaches 100% nothing is shown.
so can you please help me, I'm newbie in silverlight and asp,btw I have silverlight 4 sdk installed.
here is the html:
``
<div id="silverlightControlHost">
<object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="100%" height="100%">
<param name="source" value="ClientBin/silverlighttest3.xap"/>
<param name="onError" value="onSilverlightError" />
<param name="background" value="white" />
<param name="minRuntimeVersion" value="4.0.50826.0" />
<param name="autoUpgrade" value="true" />
<a href="http://go.microsoft.com/fwlink/?LinkID=149156&v=4.0.50826.0" style="text-decoration:none">
<img src="http://go.microsoft.com/fwlink/?LinkId=161376" alt="Get Microsoft Silverlight" style="border-style:none"/>
</a>
</object><iframe id="_sl_historyFrame" style="visibility:hidden;height:0px;width:0px;border:0px"></iframe></div>
</form>
and the silverlight project like this:
<UserControl x:Class="silverlighttest3.MainPage"
....
<Grid x:Name="LayoutRoot" Background="blue" Height="507" Width="842" HorizontalAlignment="Stretch">
<MultiScaleImage HorizontalAlignment="Left" Margin="146,27,0,0" Name="multiScaleImage1" VerticalAlignment="Top" Source="Source/dzc_output.xml"/>
</Grid>
</UserControl>
Do you have any distinguishable content in your main view? Could you maybe post your html in your test page?
Give your Silverlight main view a background color (other than white) and make sure that it isn't just blending in with the white background of your empty test page.
<UserControl x:Class="SilverlightApplication2.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="400">
<Grid x:Name="LayoutRoot" Background="Blue">
</Grid>
</UserControl>
I created my own validation control.
something like this
control.mxml:
<mx:states>
<mx:State name="ExceptionState">
<mx:AddChild relativeTo="{hbox1}">
<mx:TextArea id="txtError"
styleName="errorMessage"
width="140" minHeight="26"
wordWrap="true" editable="false"
/>
</mx:AddChild>
<mx:SetProperty name="height" value="56" />
<mx:SetProperty target="{txtInput}" name="y" />
<mx:SetProperty name="width" value="100%" />
</mx:State>
</mx:states>
<mx:HBox width="100%" x="0" y="0" id="hbox1" styleName="nopadding">
<mx:TextInput id="txtInput"
text="{text}"
displayAsPassword="{displayAsPassword}"
maxChars="{maxLength}"
cornerRadius="0"
height="22"
styleName="{inputStyleName}"
width="{_inputWidth}"
/>
</mx:HBox>
When I validate the txtinput and it's not valid, the textarea will appear with some information in it.
Now I have several textinput fields in a canvas
<custom:control id="eerstes" errormessage("message1");/>
<custom:control id="tweeds"errormessage("message2");/>
etc.
but when eerstes is not valid, the textarea appears and my custom control with id tweeds will shift a little.
Is it possible to let the textarea float but that is is still relative to hbox1?
Thank you,
JSMB
If I were you, I would try using the PopUpManager.addPopUp to place the TextField into the box. Once you've done that, you can manually reposition the TextField without effecting the alignment of the box's children. You may even be able to get this to work using BindingUtils, so that you don't have to reposition this every time.
On the other hand, you could use Alert.show, which would simply put a pop-up over the entire SWF.
What is the base class for your component custom:control ? Does it extend Canvas?