我有这个代码:
<h:form>
<h:commandLink value="Créer un compte" onclick="dlg3.show();"/>
</h:form>
<p:dialog id="modalDialoog" widgetVar="dlg3" draggable="false" resizable="false" dynamic="true" header="Inscription">
<center>
<p:panel id="xyzBody">
<h:form id="inscri-f">
<h:panelGrid id="loginPan" columns="2" bgcolor="White">
<h:outputText value="Nom d'utilisateur :" />
<p:inputText id="username" value="#{demandeBean.login}"></p:inputText>
<h:outputText value="Mot de passe :" />
<p:password id="pwd" value="#{demandeBean.pwd}"/>
<h:commandButton value="Envoyer demande" update=":inscri-f:cr"
actionListener="#{demandeBean.envoi_dde}"></h:commandButton>
<h:commandButton value="Retour" action="page1?faces-redirect=true"></h:commandButton>
<p:outputPanel id="cr">
<h:outputText rendered="#{demandeBean.saved}" value="#{demandeBean.message}"/>
</p:outputPanel>
</h:panelGrid>
</h:form>
</p:panel>
</center>
</p:dialog>
Run Code Online (Sandbox Code Playgroud)
我的问题是当我单击 commandLink 时显示“Créer un compte”对话框并且它很快消失。
我在 java 站点上找到了一个关于如何制作对话框窗口的网页,但是当我尝试它时它不起作用。该网站说键入:
JOptionPane.showMessageDialog(frame, "Window text.");
Run Code Online (Sandbox Code Playgroud)
我只是想用一些文本和一个确定按钮来制作一个窗口,但是当我输入它时,我的 Eclipse IDE 想让我为 JOptionPane 导入一些东西,在我这样做之后,它说“框架” 部分不正确,即“无法解析为变量”。我在这里做错了什么?
我想创建一个没有确定/取消按钮的对话框。我知道如果你重写 createButton 方法,这可以实现。
如果根本不需要按钮栏,您如何覆盖 createButtonBar 方法以返回 null?这将节省一些代码。
我想使用我的 .resw 文件中的字符串设置 ContentDialog 的 PrimaryButtonText、SecondaryButtonText 和 Title 属性。很遗憾 ?只能对使用 x:Uid 的一个属性执行此操作,因为不能接受在 ContentDialog 内设置 x:Uid 两次。我什至试图做这样的事情:
<ContentDialog>
<ContentDialog.PrimaryButtonText x:Uid="DialogConfirm" />
<ContentDialog.SecondaryButtonText x:Uid="DialogCancel" />
</ContentDialog>
Run Code Online (Sandbox Code Playgroud)
但我有一个例外
XBF 生成错误代码 0x09c8
有什么办法可以做到这一点吗?
我正在使用此代码在我的 android 应用程序中创建一个对话框。弹出对话框创建成功,但问题是如果我触摸屏幕上的任何地方,对话框就会消失。我希望对话框保持在屏幕上,即使用户触摸屏幕的任何其他部分。应允许用户仅在对话框中选择肯定或否定响应,然后才能继续。
有人可以告诉我如何修改我的代码来实现这一点。
AlertDialog.Builder builder1 = new AlertDialog.Builder(context);
builder1.setMessage("Would you click to proceed with this app.");
builder1.setCancelable(true);
builder1.setPositiveButton(
"Yes",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
dialog.cancel();
}
});
builder1.setNegativeButton(
"No",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
dialog.cancel();
}
});
AlertDialog alert11 = builder1.create();
alert11.show();
Run Code Online (Sandbox Code Playgroud)
提前致谢
我想要做什么:键盘应该显示在对话框的底部。
代码:我正在扩展 Dialog 类。
window.setLayout(WindowManager.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.WRAP_CONTENT)
window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE)
window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE)
Run Code Online (Sandbox Code Playgroud)
我尝试过的:
window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE)
window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN)
正如我在这里学习的那样, SOFT_INPUT_ADJUST_RESIZE 应该可以工作,但我无法弄清楚为什么它在我的情况下不起作用?
我在项目中使用Angular 6.0.6和Angular Material 6.3.0。我已将对话框组件添加到entryComponents
应用程序模块中。如果直接在仪表板组件中打开该对话框,效果很好,但是在大多数情况下,当我在rightclick
Google Maps标记的事件处理程序中打开该对话框时,该对话框为空。
在这种情况下,它为空:
private attachEvents(wo) {
wo.marker.addListener('rightclick', (e) => {
this.dialog.open(DialogAlert, {
width: '400px',
data: {
confirmation: true,
message: 'test',
title: 'X'
}
});
});
}
Run Code Online (Sandbox Code Playgroud)
如果我将open
代码放在外面wo.marker.addListener
,效果很好。
乐于听到任何建议以使其在事件处理程序中正常运行。我尝试在事件处理程序中调用detectChanges
(ChangeDetectorRef
),但无济于事。
对话框的HTML代码:
<h1 mat-dialog-title>{{data.title ? data.title : defaultTitle}}</h1>
<div mat-dialog-content>
<p>{{ data.message }}</p>
</div>
<div mat-dialog-actions>
<button *ngIf="confirmation" mat-raised-button (click)="onNoClick()">Cancel</button>
<button *ngIf="confirmation && !options" mat-raised-button (click)="onConfirmClick()" cdkFocusInitial>Yes</button>
<button color="primary" *ngFor="let o of options; index as i" mat-raised-button (click)="onConfirmClick(i)">{{o}}</button> …
Run Code Online (Sandbox Code Playgroud) 将.Show()或.ShowDialog()方法作为WPF窗口构造函数的最后一行调用是一个好习惯吗?唯一的原因是简化使用我的窗口类 - 通过创建它的实例我已经显示它.
我正在使用 material-ui ReactJs 中的 Dialog 组件。
<Dialog fullScreen open={this.state.open}
PaperProps={{ classes: {root: classes.dialogPaper} }}
onClose={this.handleClose.bind(this)} transition={this.props.transition}>
{this.props.children}
</Dialog>
Run Code Online (Sandbox Code Playgroud)
在上面的代码中,我已经覆盖了 PaperProps 的根类。现在我还想覆盖 PaperProps 中的样式。在 PaperProps 中是否可以覆盖样式。
就像是 PaperProps={{ classes: {root: classes.dialogPaper}, style:{} }}
如果我错了,请告诉我。我也想覆盖样式。
dialog ×10
android ×3
.net ×1
angular ×1
buttonbar ×1
c# ×1
constructor ×1
google-maps ×1
java ×1
javascript ×1
jface ×1
joptionpane ×1
jsf ×1
material-ui ×1
overriding ×1
popup ×1
primefaces ×1
reactjs ×1
resize ×1
swing ×1
uwp ×1
window ×1
winrt-xaml ×1
wpf ×1
xaml ×1