ui:repeatn tag inside ui:repeat..not working - icefaces

I am using ice:faces in my project.
I have issues with UI:Repeat.
It never works ....
ui:repeatn tag inside ui:repeat..
do I need to do anything different..
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:c="http://java.sun.com/jstl/core"
xmlns:ice="http://www.icesoft.com/icefaces/component">
<ui:repeat value="#{item.rowField3}" var="section">
<ice:panelGrid columns="#{section.columns}">
<ui:repeat items="#{section.fieldInfo}" var="fieldInfo">
<ui:include src="rowField.jspx" />
</ui:repeat>
</ice:panelGrid>
</ui:repeat>
</html>

Attribute "items" in your nested ui:repeat should be "value".

Related

Primefaces Forms and LayoutUnit

I am new to primefaces and I am using the latest version 6.2. Following the guidelines on the user guide I have created a template using 2 forms (one for each layoutunit) setting different ID for each form.
<?xml version = "1.0" encoding = "UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:fn="http://java.sun.com/jsp/jstl/functions" xmlns:p="http://primefaces.org/ui">
<ui:composition>
<h:head>
<title>#{messages.appname}</title>
<link rel="shortcut icon" href="#{resource['images/favicon.ico']}" type="image/x-icon" />
</h:head>
<body>
<p:layout fullPage="true" id="myPage">
<p:layoutUnit id="up" position="north" size="130" header="" resizable="true" closable="false" collapsible="true">
<h:form id="upform">
<ui:include src="/templates/top.xhtml" />
</h:form>
</p:layoutUnit>
<p:layoutUnit id="center" position="center">
<h:form id="centerform">
<ui:include src="/templates/center.xhtml" />
</h:form>
</p:layoutUnit>
<p:layoutUnit id="down" position="south" size="60" header="" resizable="true" closable="true" collapsible="true">
<h:outputText value="© 2018 - IT" />
</p:layoutUnit>
</p:layout>
</body>
</ui:composition>
</html>
My problem is that when I load the page in Chrome and I inspect the elements, Chrome is complaining for DOM,as it tracks 2 elements with non-unique ID.
​login.xhtml:1 [DOM] Found 2 elements with non-unique id #j_id1:javax.faces.ViewState:0: (More info:) <input type=..."hidden" name=..."javax.faces.ViewState" id=..."j_id1:...javax.faces.ViewState:...0" value=..."bla bla" autocomplete=..."off">... <input type=..."hidden" name=..."javax.faces.ViewState" id=..."j_id1:...javax.faces.ViewState:...0" value=..."bla bla 2" autocomplete=..."off">...
As I suspect that this will cause javascript problems - how can I overcome this?

How to expose an iterator variable from a JSF composite component to the IDE in the using page

My setup is Eclipse Oxygen, JSF 2.2, JBoss 7.0 (Mojarra JSF implementation) and Primefaces 6.0.
I've wrapped the Primefaces dataTable in a JSF composite-component (my:dataTable):
<ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:f="http://xmlns.jcp.org/jsf/core" xmlns:h="http://xmlns.jcp.org/jsf/html" xmlns:p="http://primefaces.org/ui"
xmlns:pt="http://xmlns.jcp.org/jsf/passthrough" xmlns:composite="http://xmlns.jcp.org/jsf/composite"
xmlns:c="http://java.sun.com/jsp/jstl/core">
<composite:interface>
<composite:attribute name="value" required="true" type="java.lang.Object" />
<composite:attribute name="var" required="true" type="java.lang.String" targets="dataTable"/>
</composite:interface>
<composite:implementation>
<div class="ui-g">
<div class="ui-g-12">
<p:dataTable id="dataTable" value="#{cc.attrs.value}" sortMode="multiple"
paginator="true" rows="10"
rowsPerPageTemplate="10, 20, 50, 100" currentPageReportTemplate="Ergebnisse {startRecord} - {endRecord} von {totalRecords}"
paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}">
<c:set target="#{component}" property="var" value="#{cc.attrs.var}"/>
<composite:insertChildren/>
</p:dataTable>
</div>
</div>
</composite:implementation>
The Primefaces column is implemented as a custom component (my:column):
<ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:f="http://xmlns.jcp.org/jsf/core" xmlns:h="http://xmlns.jcp.org/jsf/html" xmlns:p="http://primefaces.org/ui"
xmlns:pt="http://xmlns.jcp.org/jsf/passthrough" >
<p:column headerText="#{headerText}" sortable="#{sortable}">
<ui:insert />
</p:column>
</ui:composition>
And the component is called in the using page:
<my:dataTable id="datenTabelleID" value="#{showcaseDatenTabelleBean.quellWerteListe}" var="laufvar">
<my:column headerText="ID">
<h:outputText value="#{laufvar.id}" />
</my:column>
<my:column headerText="Name">
<h:outputText value="#{laufvar.name}" />
</my:column>
</my:dataTable>
Everything works as expected except for the IDE (in my case Eclipse) code assist for the iterator variable. I have no code completion for the attribute declared as var (laufvar).
Thanks in advance.

sap.m.MessageBox.confirm working sap.m.MessageBox.error or sap.m.MessageBox.warning not working

In my sapui5 project i am using sap.m.MessageBox.confirm its working fine but when i use sap.m.MessageBox.error or sap.m.MessageBox.warning it shows error
Uncaught TypeError: undefined is not a function
I have added jQuery.sap.require("sap.m.MessageBox"); still the issue is not solved. please give solution for this problem
Thanks
Sorry for not posting the code earlier
Edited 1
View
<core:View xmlns:core="sap.ui.core" xmlns:mvc="sap.ui.core.mvc" xmlns="sap.m"
controllerName="trial.S1" xmlns:html="http://www.w3.org/1999/xhtml">
<Page title="Title">
<content>
</content>
<footer>
<OverflowToolbar>
<ToolbarSpacer />
<Button id="errorId" text="Error" type="Accept"
press="fnOnerror" />
<Button id="confirmId" text="Confirm" type="Accept"
press="fnOnconfirm" />
</OverflowToolbar>
</footer>
</Page>
</core:View>
Conroller
jQuery.sap.require("sap.m.MessageBox");
sap.ui.controller("trial.S1", {
fnOnerror : function(oEvent){
sap.m.MessageBox.error("My error message");
},
fnOnconfirm : function(oEvent){
sap.m.MessageBox.confirm("My Confirm message")
}
});
index.html
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta http-equiv='Content-Type' content='text/html;charset=UTF-8'/>
<script src="resources/sap-ui-core.js"
id="sap-ui-bootstrap"
data-sap-ui-libs="sap.m"
data-sap-ui-theme="sap_bluecrystal">
</script>
<!-- only load the mobile lib "sap.m" and the "sap_bluecrystal" theme -->
<script>
sap.ui.localResources("trial");
var app = new sap.m.App({initialPage:"idS11"});
var page = sap.ui.view({id:"idS11", viewName:"trial.S1", type:sap.ui.core.mvc.ViewType.XML});
app.addPage(page);
app.placeAt("content");
</script>
</head>
<body class="sapUiBody" role="application">
<div id="content"></div>
</body>
</html>
How should we give you a solution for your issue if your information is not enough? From what you describe it is hard to tell what you are doing wrong. Make sure to always add more information including code.
After getting the information from you we know now that you are using version 1.28.9 of UI5. If you would have checked the API docs at https://openui5.hana.ondemand.com/#docs/api/symbols/sap.m.MessageBox.html#.error then you would have known that the APIs you are using were introduced in 1.30!!!

Orbreon - 2 input fields

I've just started with Orbeon forms and cannot figure out the simplest possible thing (I guess).
I want to have two input fields : one for name, the other for surname. Here is my code :
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:xh="http://www.w3.org/1999/xhtml"
xmlns:xf="http://www.w3.org/2002/xforms"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:ev="http://www.w3.org/2001/xml-events"
xmlns:xxf="http://orbeon.org/oxf/xml/xforms"
xmlns:xforms="http://www.w3.org/2002/xforms">
<head>
<xforms:model>
<xforms:instance>
<first-name xmlns=""/>
</xforms:instance>
<xforms:instance>
<second-name xmlns=""/>
</xforms:instance>
</xforms:model>
</head>
<body>
<xforms:input ref="/first-name">
<xforms:label>Sth</xforms:label>
</xforms:input>
<br/>
<xforms:input ref="/second-name">
<xforms:label>Sth2</xforms:label>
</xforms:input>
</body> </html>
For some reason on the page I can see only the first one (first-name input field). What am I doing wrong ?
Here is a working example:
<xh:html
xmlns:xh="http://www.w3.org/1999/xhtml"
xmlns:xf="http://www.w3.org/2002/xforms"
xmlns:xxf="http://orbeon.org/oxf/xml/xforms"
xmlns:ev="http://www.w3.org/2001/xml-events"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xh:head>
<xf:model>
<xf:instance>
<form>
<first-name/>
<last-name/>
</form>
</xf:instance>
</xf:model>
</xh:head>
<xh:body>
<xf:input ref="first-name">
<xf:label>First name:</xf:label>
</xf:input>
<xf:input ref="last-name">
<xf:label>Last name:</xf:label>
</xf:input>
</xh:body>
</xh:html>

How to add meta tags from widget in Orchard?

I'm trying to add some meta tags from widget (/views/parts/ folder) that gets data from database outside of orchard. I need to put them to head section, and frankly I got no idea how to achieve that.
I tried:
using (Script.Head())
{
<meta property="description" content="ABC">
}
SetMeta("ABC", "description");
But none of these work :-(
Edit: our document.cshtml code:
#using Orchard.Mvc.Html;
#using Orchard.UI.Resources;
#{
RegisterLink(new LinkEntry { Type = "image/x-icon", Rel = "shortcut icon", Href = Url.Content("~/modules/orchard.themes/Content/orchard.ico") });
string title = Convert.ToString(Model.Title);
string siteName = Convert.ToString(WorkContext.CurrentSite.SiteName);
string classForPage = "static " + Html.ClassForPage();
}
<!DOCTYPE html>
<!--[if lt IE 7]>
<html lang="#WorkContext.CurrentCulture" class="#classForPage no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]>
<html lang="#WorkContext.CurrentCulture" class="#classForPage no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]>
<html lang="#WorkContext.CurrentCulture" class="#classForPage no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!-->
<html lang="#WorkContext.CurrentCulture" class="#classForPage no-js"> <!--<![endif]-->
<head>
<meta charset="utf-8" />
<title>#Html.Title(title, siteName)</title>
<meta name="viewport" content="width=device-width">
#{
Display(Model.Head);
}
<meta property="og:title" content="#Layout.Title - #Convert.ToString(WorkContext.CurrentSite.SiteName)">
<meta property="og:site_name" content="#Convert.ToString(WorkContext.CurrentSite.SiteName)">
<meta property="og:url" content="#Request.Url">
<meta property="og:type" content="article">
<script>(function(d){d.className="dyn"+d.className.substring(6,d.className.length);})(document.documentElement);</script>
</head>
<body>
#Display(Model.Body)
#Display(Model.Tail)
</body>
</html>
Does anybody know how to achieve that?
IResourceManager provides the necessary methods.
For use it in view:
var resourceManager = WorkContext.Resolve<Orchard.UI.Resources.IResourceManager>();
resourceManager.SetMeta(new Orchard.UI.Resources.MetaEntry
{
Name = "description",
Content = "ABC"
});
But it can be also used in other places (e.g. part driver).
Edit
using SetMeta("description", "ABC") in view give the same results.
I used the following code in my layout.cshtml file before header tag and it worked.
#using (Script.Head())
{
<meta name="description" content="<your description>"/>
<meta name="keywords" content="<your keywords here>"/>
}
Enjoy!!!