我想写一个有点复杂的web gui应用程序.它将用于通过显示面板编辑某些内容,并允许用户拖动项目以编辑内容.
这个解释有些抽象,但重点是我正在寻找一种现代的gui写作技术,越是标准,我就越有可能找到使用它的信息和样本.
我一直在使用JavaFaces编写一些简单的网页,并且已经看过RichFaces以编写上述应用程序.我很想听到类似技术的推荐(例如 - 用来写这个网站的是什么?)
谢谢!!!
更新:感谢您的答案到目前为止,由于我被要求更多说明,我将尝试解释应用程序的使用:它将用于编辑复杂的脚本.将有一个面板包含脚本的操作(阶段),另一个面板将显示当前所选操作的内容.对于每种操作类型,将有一组不同的属性要修改.您可以通过将操作拖动到新位置(有点像powerpoint幻灯片管理器或flickr照片管理器)来重新排序操作,并以这种方式复制它们.动作属性面板的内容将能够显示各种类型的内容,如html文本和按钮以及各种内容.
希望有所帮助.再次感谢!
Update2:在阅读了这个StackOverflow线程后,我倾向于RichFaces,因为它提供了广泛的支持和标准化.
我是一个jquery新手.我可以在我的表单中使用验证规则.我正在使用Java框架,出于某种原因,当它从.xhtml转换为.html时,所有ui组件的id/name都以包含它的形式为前缀.我想将这些验证规则重用于其他两种形式,但由于前缀问题,我需要使用js变量并将formId传递给函数.出于某种原因,这给我一个问题:
var positionTitle = "#myForm:positionTitle";
$("#" + formId).validate({
rules:{
positionTitle : {required:true, maxlength:50},
...
Run Code Online (Sandbox Code Playgroud)
$("#" + formId).validate({
rules:{
"#myForm:positionTitle" : {required:true, maxlength:50},
...
Run Code Online (Sandbox Code Playgroud) 我开发了这个联系表格:
<!DOCTYPE html>
<ui:composition
xmlns="http://www.w3.org/1999/xhtml"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:a4j="http://richfaces.org/a4j"
xmlns:rich="http://richfaces.org/rich">
<h:form>
<h:panelGrid columns="3">
<h:outputLabel for="name" value="Nome (Obrigatório)" />
<h:inputText id="name" value="#{contact.client.name}" />
<h:message for="name" />
<h:outputLabel for="email" value="E-Mail (Obrigatório)" />
<h:inputText id="email" value="#{contact.client.email}" />
<h:message for="email" />
<h:outputLabel for="website" value="Website (Opcional)" />
<h:inputText id="website" value="#{contact.client.website}" />
<h:message for="website" />
</h:panelGrid>
<h:outputLabel for="text" value="Mensagem (Obrigatório):" /> <br/>
<h:inputTextarea id="text" value="#{contact.client.text}" rows="20" cols="80" /><br/>
<h:message for="text" />
<br/>
<h:commandButton value="Enviar" action="#{contact.sendMessage}" >
<f:ajax execute="@form" render="@form" />
</h:commandButton>
<h:outputText value="#{contact.messageStatus}" id="out" />
<a4j:status> …Run Code Online (Sandbox Code Playgroud) 如何通过选中/取消选中selectBooleanCheckbox来重新加载页面(并更新模型值)?
@Ellie:我都尝试<a4j:ajax event="click" action="doiListView"/>和<f:ajax event="click" action="doiListView"/>,但没有任何反应.(片段)代码是这样的:
<td style="font-size: 5pt; border: 0; min-width:60px">
<rich:calendar id="creationToDate" value="#{listModel.creationDate.rangeEnd}"
datePattern="yyyy-MM-dd" enableManualInput="true"
rendered="#{listModel.creationDate.range}"
valueChangeListener="#{listController.filterFieldChanged}">
</rich:calendar>
</td>
<td rowspan="2">
<h:selectBooleanCheckbox value="#{listModel.creationDate.range}">
<a4j:ajax event="click" action="doiListView"/>
</h:selectBooleanCheckbox>
</td>
Run Code Online (Sandbox Code Playgroud)
如果选中该复选框,则应该可以看到日期选择器.但是根据你的提示,没有任何反应......如果我在selectBooleanCheckbox标签中添加onclick ="window.location.href = window.location.href",那么它可以工作,但正如我所说的,我想使用RF组件可能...
如何在弹出面板显示之前从支持bean调用方法?
<h:commandButton value="Call the popup" action="#{bean.doSomething}" >
<rich:componentControl target="popup" operation="show" />
</h:commandButton>
<rich:popupPanel id="popup" modal="true" resizeable="true" onmaskclick="#{rich:component('popup')}.hide()">
...
</rich:popupPanel>
Run Code Online (Sandbox Code Playgroud)
在这种情况下,doSomething()方法不会调用.
我在JSF2.1/Richfaces 4.2应用程序中观察到了一件有趣的事情.在Filter(或)JSF Bean操作方法中的所有response.sendRedirect()调用都不起作用.
如果我们在客户端(浏览器)使用location.href,它工作正常.
什么可能导致发送重定向失败的任何建议?我试过下面的签名.
response.sendRedirect("/appRoot/mypage.xhtml");
or
(HttpServletResponse) facesCtx.getResponse()).sendRedirect(((HttpServletRequest)request).getContextPath()+"/appRoot/mypage.faces");
Run Code Online (Sandbox Code Playgroud) 我正在使用JSF和RichFaces 4.我有一个巨大的形式,我必须分成几个面板.但是当我这样做时,我会收到警告.
例如,这使它显示警告:
<h:form>
<rich:tabPanel>
<rich:tab>
//Form elements go here
</rich:tab>
</rich:tabPanel>
</h:form>
Run Code Online (Sandbox Code Playgroud)
我该如何避免呢?
我有一个用例,我计划有一个rich:pickList,以便用户可以从列表中选择多个项目.但是,在少数情况下,pickList中的项目数量太大(在hunderd中,有时数以千计),用户滚动整个长度是不实际的.那么,有没有办法在pickList的左侧列表上方有一个搜索框?它应该类似于autoComplete组件,因此pickList中总共有10个项目,这些项目是在搜索框中输入的关键字的最接近的匹配项.
我使用richfaces 4和JSF 2.0.
我使用JSF和RichFaces为我的SOAP Web服务创建了一个客户端.以下是我的观点:
<h:form>
<h:panelGrid id="panel" width="80%" columns="2" columnClasses="col1,col2">
<rich:panel>
<h:outputLabel value="Application Name " />
<h:selectOneMenu value="#{userComplaintBean.appName}">
<f:selectItem itemValue="1" itemLabel="Select" />
<f:selectItem itemValue="App1" itemLabel="App1" />
<f:selectItem itemValue="App2" itemLabel="App2" />
<f:selectItem itemValue="App3" itemLabel="App3" />
<f:selectItem itemValue="App4" itemLabel="App4" />
<f:selectItem itemValue="App5" itemLabel="App5" />
</h:selectOneMenu>
<br />
<h:outputLabel value="Complaint Description " />
<h:inputTextarea value="#{userComplaintBean.complaintDesc}" />
<br />
<h:outputLabel value="Date Expected "/>
<rich:calendar datePattern="yyyy/MM/dd" />
<br/>
<h:commandButton value="submit" action="#{userComplaintBean.save()}" />
</rich:panel>
</h:panelGrid>
</h:form>
Run Code Online (Sandbox Code Playgroud)
下面是我的托管bean:
@ManagedBean(name = "userComplaintBean")
@RequestScoped
public class UserComplaintBean {
UserComplaintVO userComplaintVO;
UserComplaintWS …Run Code Online (Sandbox Code Playgroud) 我得到了关于glassfish 4.1的项目,但它不断"unable to find resource JQuery.js"提出以前版本的Richfaces和glassfish它100%工作.它现在打破我的菜单等,并有一个恼人的弹出窗口显示错误.
<h:outputScript name="jquery.js"/>
Run Code Online (Sandbox Code Playgroud)
要么
<h:outputScript name="jquery.js" target="head"/>
Run Code Online (Sandbox Code Playgroud)
不起作用,有什么建议吗?
还确保核心是包含.POM:
<dependencies>
<dependency>
<groupId>org.richfaces</groupId>
<artifactId>richfaces</artifactId>
<version>4.5.0.CR1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.richfaces</groupId>
<artifactId>richfaces-core</artifactId>
<version>4.5.0.CR1</version>
</dependency>
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-web-api</artifactId>
<version>7.0</version>
<scope>provided</scope>
</dependency>
</dependencies>
Run Code Online (Sandbox Code Playgroud)
依赖项包括:
sac-1.3
cssparser-0.9.14
guava-18.0
richfaces-4.5.0.CR1
richfaces-core-4.5.0.CR1
richfaces-a4j-4.5.0.CR1
Run Code Online (Sandbox Code Playgroud)
有什么遗失的吗?
谢谢.