Thursday, 15 March 2012

jsf 2 - Primefaces BlockUI blocks all with widgetvar -


I want to use the widgetware of the primaryface blockUI (at this time I use a model dialog for this). The application should be closed only when I select something (a long method calls) and should be unblocked after it is complete. But it blocks completely on first access. Make me something wrong?

When I work on table specific blocks ( block = "table" ) but I want to block the whole page.

Primefaces 5.1 & amp;

Html xmlns = "http: //www.w3.org/1999/xhtml" xmlns: h = "http://java.sun.com/jsf/html" xmlns: f = "http: //java.sun. Com / jsf / core "xmlns: p =" http://primefaces.org/ui "& gt; & Lt; H: top & gt; & Lt; Title & gt; Trial & lt; / Title & gt; & Lt; / H: top & gt; & Lt; A: Body & gt; & Lt; H: form & gt; & Lt; P: blockUI widgetVar = "block" blocked = "wrong" /> & Lt; P: dataTable id = "table" value = "# {myController.tableItems}" row = "# {data}" selection = "# {myController.selectedItem}" selectionMode = "single" var = "data" & gt; & Lt; P: ajax event = "select row" onstart = "pf ('block'). Show ()" listener = "# {mycontroller.doSomething}" incomplete = "pf ('block'). Hide ()" /> ; & Lt; P: column & gt; # {Data} & lt; / P: column & gt; & Lt; / P: DataTable & gt; & Lt; / H: form & gt; & Lt; / H: Body & gt; & Lt; / Html & gt; Bean:

  @Menzben @VivisScope enforces public final class microcontroller serializable {/ ** * * / / / Private Static Finals Long SerialVersionUID = 1L; Private listing & lt; String & gt; TableItems; Private string selected items; @PostConstruct Public Zero init () {tableItems = new ArrayList & lt; String & gt; (); TableItems.add ("test1"); TableItems.add ("test2"); } Public Zero doSomething (SelectEvent event) {System.out.println ("DO Some"); Try {Thread.Sleep (2000); } Grip (Interrupted E) E. {// TODO Auto-Generated Catch Block e.printStackTrace (); }} Select Public String Selected () {return selectItem; } Public Zero SetHeckedTime (string selected item) {this.selectedItem = selectedItem; } Public listing & lt; String & gt; GetTableItems () {return table item; } Public Zero Settables (List & lt; String & gt; Table Items) {this.tableItems = tableItems; }}  

add a id to block component Block = in attribute


No comments:

Post a Comment