w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
dynamic ui:include with ui:fragment: component with rendered false still make inside component tree
The <ui:include> doesn't extend from UIComponent. It's a tag handler. It does thus not support the rendered attribute at all. It's also nowhere listed in the tag documentation. <ui:fragment> is indeed an UIComponent. So basically you end up with all those 3 include files being included during view build time and thus all 3 physically end up in JSF component tree. It's only the HTML output which is conditionally rendered via <ui:fragment rendered>. You still end up with duplicate component IDs from those includes because they all end up in JSF component tree. You should be using a taghandler like <c:if> instead of <ui:fragment> to conditionally build the JSF component tree. So, theoretically, this should do for each of them: <c:if test="#{filtersPopup.fi

Categories : JSF

How to execute javascript method from server side?
The easiest but also hackiest way would be to set a property which represents the content of a <h:outputScript> and ajax-update it by adding its client ID to PartialViewContext#getRenderIds(). So, given a <h:panelGroup id="script"><h:outputScript>#{bean.script}</h:outputScript></h:panelGroup> you can ajax-update it with script = "alert('peek-a-boo')"; FacesContext.getCurrentInstance().getPartialViewContext().getRenderIds().add("script");

Categories : JSF

Execute a server side program asynchronously with an asp.net mvc4 app
Asp.Net MVC has the concept of an Async Controller that is suited to perform long-running tasks. It will help you by not locking a thread while you wait for out program to execute. But to do what you are after I think you need to create you own Http Handler (probaby by implementing the IHttpHandler interface) that wraps the process and returns the results incrementally. This will not be trivial to do, but it should be possible. A third viable alternative might be to use SignalR. That would be a fun project, but would still require much work I think.

Categories : Asp Net

How to execute a shell command on the server side within javascript?
I don't believe this is possible with client-side JavaScript. Althought it's not really your question, you could do it if you were using NodeJS server-side (http://nodejs.org/api/all.html#all_child_process_exec_command_options_callback).

Categories : Javascript

Execute contents inside