我正在使用rich:ModalPanel来插入一些用户,但我的commandButton中的操作似乎没有响应。
<rich:modalPanel id="panel" moveable="true" top="150" width="400" autosized="true">
<h:form id="uploadForm">
<a4j:outputPanel id="uploadOutputPanel">
<h:panelGrid id="uploadPanelGridId" columns="2">
<h:inputText value="#{adminModele.checkerNumber}"/>
<a4j:commandButton value="save"
action="#{OperationController.add}"
oncomplete="if (#{facesContext.maximumSeverity==null}){#{rich:component('LogAddDownloadPanel')}.hide();}"/>
<h:outputText value="Uploaded File Name : #{adminModele.checkerNumber}"/>
</h:panelGrid>
</a4j:outputPanel>
</h:form>
</rich:modalPanel>
答案 0 :(得分:1)
通常您使用其名称访问bean,但首字母是“小写”:
(适用于@extends('layouts.app')
@section('css')
@parent
<!-- Custom css -->
<link href="custom/css/custom.css" rel="stylesheet">
@stop
@section('content')
<div class="container">
<div class="row">
<div class="col-md-12">
<!-- Carousel -->
<div id="carousel-example-generic" class="carousel slide" data-ride="carousel">
<!-- Indicators -->
<ol class="carousel-indicators">
<li data-target="#carousel-example-generic" data-slide-to="0" class="active"></li>
<li data-target="#carousel-example-generic" data-slide-to="1"></li>
<li data-target="#carousel-example-generic" data-slide-to="2"></li>
</ol>
<!-- Wrapper for slides -->
<div class="carousel-inner" role="listbox">
<div class="item active">
<img src="{{asset('images/carousel1.jpg')}}" alt="...">
<div class="carousel-caption">
We are commited
</div>
</div>
<div class="item">
<img src="{{asset('images/carousel2.jpg')}}" alt="...">
<div class="carousel-caption">
To ensuring
</div>
</div>
<div class="item">
<img src="{{asset('images/carousel3.jpg')}}" alt="...">
<div class="carousel-caption">
You get your house of choice
</div>
</div>
</div>
<!-- Controls -->
<a class="left carousel-control" href="#carousel-example-generic" role="button" data-slide="prev">
<span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</a>
<a class="right carousel-control" href="#carousel-example-generic" role="button" data-slide="next">
<span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</div>
<!-- End of carousel -->
</div>
</div>
<!-- Houses title -->
<div class="row">
<div class="col-md-12">
<div class="houses-title-bar">
<h1 class="search-title">Search for your house of choice..</h1>
<hr id="hr-position">
<!-- <p>
@if (count($errors) > 0)
<div class="alert alert-danger">
<ul>
@foreach ($errors->all() as $error)
<li>{{ $error }}</li>
@endforeach
</ul>
</div>
@endif
</p> -->
<!-- Search bar -->
<!-- {!! Form::open(array('url' => ' ', 'method' => 'post', 'class' => 'form-inline', 'id' => 'search-bar')) !!} -->
{{Form::open(array('class'=>'form-inline', 'url'=>' ', 'id' => 'search-bar' ))}}
{{ csrf_field() }}
{{Form::select('Location', ['Kasarani','Allsoaps'], null, ['class' => 'form-control', 'placeholder' => 'Location'])}}
{{ Form::select('Size', ['Bedsitter'], null, ['class' => 'form-control', 'placeholder' => 'Size']) }}
{{Form::submit('search', array('class' => 'btn btn-success'))}}
{{ Form::close() }}
</form>
<!-- End of search bar -->
</div>
</div>
</div>
<!-- End of title -->
<!-- Houses and details -->
<div class="row first-row">
@foreach($house as $house)
<div class="col-md-4">
<div>
<img src="{{ asset('images/'.$house->Photo) }}" class="img-responsive">
</div>
<div class="col-md-12 text-center" id="view-details-button">
<a href="{{ url('all/'.$house->slug) }}" class="btn btn-primary" id="btn-style">View details</a>
</div>
</div>
@endforeach
</div>
<!-- End of houses and details -->
</div>
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="{{URL::asset('bootstrap/js/jquery-1.11.2.js')}}"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="{{URL::asset('bootstrap/js/bootstrap.min.js')}}"></script>
@stop
,@Named
或隐含添加@ManagedBean
等范围。
@RequestScoped
你明确地将豆子命名为那个,或者你的意思是:
action="#{OperationController.add}"
(来自你的action="#{operationController.add}"
我会假设后者......)
请注意,此表达式区分大小写,但您应收到有关此内容的错误/警告:“无法解析变量名称”或类似?
ps。:如果至少前两个字母为大写字母,则不适用
...为了支持偶尔使用所有大写名称,我们检查是否 名称的前两个字符都是大写的,如果是的话 不要管它。因此,例如,“FooBah”变成“fooBah”“Z”变为 “z”“URL”变为“URL”我们提供方法Introspector.decapitalize 它实现了这个转换规则。
因此,名为adminModele
的Bean不会被URLController
访问,而是以其原始名称访问。