How can i drag a view over an view that has an html content in Open Laszlo 5.0? - drag

I am trying to drag an content over an html content in OL5.0.
the observations are
i am able to drag from the laszlo component to html component without any problem.
I am able to drag from laszlo to html to laszlo.
But, if i drag that view to html and then release it and then drag from html it's not working.
This is the code.
<canvas>
<view bgcolor="green" width="20" height="20" onmousedown="dragger.setAttribute('applied', true);this.bringToFront();" onmouseup="dragger.setAttribute('applied', false)">
<dragstate name="dragger"/>
</view>
<view y="50" width="100%" height="300" bgcolor="blue" onmousedown="res.apply()" onmouseup="res.remove()">
<resizestate name="res"/>
<dragstate name="drg"/>
<text width="100%" bgcolor="gray" onmousedown="parent.drg.apply()" onmouseup="parent.drg.remove()">Drag here</text>
<html id="ht" src="http://localhost:8080/lps-5.0.x/htmlTest/resource/text.html" x="15" y="15" width="${parent.width - 30}" height="${parent.height - 30}"/>
</view>
</canvas>

I have been programming in OpenLaszlo 2006 and when I have tried to use the OpenLaszlo <html> class it has been very unstable, buggy and unpredictable. I do not recommend using that particular class in any application.

Related

React scroll Parallax image are jittery on phone

I have tried to use React scroll parallax to get the famous scrolling effect on a couple of images which works perfectly fine in chrome, but in safari and I should say on a small screen looks jittery and give the user a bad experience.
here is a sample project created in stackBitz: https://stackblitz.com/edit/react-ybdmbn.
please guide me on how I can improve it or what I am doing wrong.
I fix the issue by removing the: speed={-10} property from the <Parallax> tag.
Parallax gets a couple of property which the speed and the translateY are basically the same thing.
<Parallax translateY={[20, -70]} >
<img src="https://picsum.photos/200/300" />
</Parallax>
<Parallax translateY={[30, -90]} >
<img src="https://picsum.photos/seed/picsum/200/300" />
</Parallax>
</div>
<div className={styles.Bottom}>
<Parallax translateY={[20, -80]} >
<img src="https://picsum.photos/200/300?grayscale" />
</Parallax>
<Parallax translateY={[40, -80]} >
<img src="https://picsum.photos/id/870/200/300?grayscale&blur=2" />
</Parallax>
</div>

How to define composable components in AngularJS

In AngularJS (1.x), how can we create a reusable widget (component) that has insertion points (slots) for other widgets (components)?
Imagine we have a component/directive called "verticalsplitter". It's purpose is to divide the screen area into a "top" and "bottom" area (perhaps allowing user resizing, collapsing, etc).
Now imagine we have a bunch of other rich components e.g. a richtextview, a treeview, a videoplayer and a gridview.
One page/view 1 I want a verticalsplitter with a richtextview on top and treeview on bottom. On page/view 2 I want a verticalsplitter with a videoplayer on top and a gridview on bottom.
Page 1
<html>
<body>
<verticalsplitter>
<top ng-initialSize="30%">
<richtextview />
</top>
<bottom ng-initialSize="70%">
<treeview />
</bottom>
</verticalsplitter>
</body>
</html>
Page 2
<html>
<body>
<verticalsplitter ng-locked="true">
<top>
<videoplayer />
</top>
<bottom>
<gridview />
</bottom>
</verticalsplitter>
</body>
</html>
How can I achieve this? If it's not possible with components (and I need to use directives for transclude) then that's OK.
Components can transclude. It is clearly stated so in the AngularJS Developers Guide for Components:
app.component("verticlesplitter", {
transclude: {
'topPart': 'top',
'bottomPart': 'bottom'
},
template: `
<div style="border: 1px solid black;">
<div class="top" ng-transclude="topPart"></div>
<div>Something in the middle</div>
<div class="bottom" ng-transclude="bottomPart"></div>
</div>
`
});
For more information, see
AngularJS Developers Guide for Components
AngularJS ng-transclude Directive API Reference (Multi-slot Transclusion)

Creating dashboard using VisualForce page in salesforce

I want to create a custom dashboard in Sales Force using visual force page. I want to get data from customs objects. For this I write a apex controller
<apex:page controller="Sample">
<apex:chart height="400" width="700" data="{!pweb}">
<apex:axis type="Numeric" position="left" fields="pweb2"
title="users Count" grid="true"/>
<apex:axis type="Category" position="bottom" fields="pweb1"
title="Week Days">
</apex:axis>
<apex:lineSeries axis="left" fill="true" xField="pweb1" yField="pweb2"
markerType="cross" markerSize="4" markerFill="#FF0000"/>
</apex:chart>
</apex:page>
and creating a chart using visualforce page:
<apex:page controller="Sample">
<apex:chart height="400" width="700" data="{!pweb}">
<apex:axis type="Numeric" position="left" fields="pweb2"
title="users Count" grid="true"/>
<apex:axis type="Category" position="bottom" fields="pweb1"
title="Week Days">
</apex:axis>
<apex:lineSeries axis="left" fill="true" xField="pweb1" yField="pweb2"
markerType="cross" markerSize="4" markerFill="#FF0000"/>
</apex:chart>
</apex:page>
It's not showing any error but after saving this, when I am clicking on preview button, its not showing anything. Could anyone please help me solve it?

ZK Spreadsheet with combobox

how can i get combobox in a ZK spreadsheet cell as shown in the link below?
ZK spreadsheet
Try this code...
<?page title="new page title" contentType="text/html;charset=UTF-8"?>
<zk>
<div height="100%" width="100%" apply="org.zkoss.zssessentials.config.SheetDimensionComposer">
<combobox id="sheets">
</combobox>
<spreadsheet id="spreadsheet" src="/WEB-INF/excel/config/demo_sample.xls"
maxrows="200"
maxcolumns="40"
width="100%"
height="450px"></spreadsheet>
</div>
</zk>
The combobox is a ZK Spreadsheet data validation drop down(when excel cell validation type is a list), it is not a embedded zk combobox. I think ZK Spreadsheet doesn't support to embedded a outside zk component into it yet.
I've never used ZK Spreadsheet but I think this could be the same behavior that in a classic listbox.
In a listbox you have to use a listbox in mold "select" instead a combobox, like this bellow.
<listbox id="listOfItems" model="#bind(vm.listOfItems) #template('anItem')" selectedItem="#bind(vm.selectedItem)">
<listhead>
<listheader label="Item-Label" hflex="1" />
<listheader label="Thing-Label" hflex="1" />
</listhead>
<template name="anItem" var="i">
<listitem>
<listcell>
<textbox value="#bind(i.code)" hflex="1" />
</listcell>
<listcell>
<listbox mold="select" model="#bind(vm.listOfThings) #template('aThing')" selectedItem="#bind(i.selectedThing)" hflex="1">
<template name="aThing"var="t">
<listitem label="#load(t.label)" />
</template>
</listbox>
</listcell>
</listitem>
</template>
</listbox>

Silverlight app and an iframe co-existing on the same page

this should be simple...could someone provide me a simple code sample that has an aspx page hosting both a silverlight app (consisting of, say a button) and an iframe (pointing to, say stackoverflow.com). The silverlight app and iframe could be in separate div's, the same div, whatever.
Everything I've tried so far leaves me with a page that has no silverlight control rendered on it.
EDIT: At the request for what my xaml looks like (Plus I should point out that my controls render just fine if I comment out the iframe.)
<UserControl x:Class="SilverlightApplication1.Page"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Grid x:Name="LayoutRoot" Background="Pink">
<Button Content="Click Me!"/>
</Grid>
</UserControl>
Thats it. Just for good measure here is my aspx page...
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server"/>
<div style="height:100%;">
<asp:Silverlight ID="Silverlight1" runat="server" Source="~/ClientBin/SilverlightApplication1.xap" MinimumVersion="2.0.30523" Width="400" Height="400" />
</div>
<iframe src ="http://www.google.com" width="400"/>
</form>
Hmm, sound a bit odd, a quick google gave me this top result which talks about using an Iframe and Silverlight on the same page, without problems.
Also a quick test with the following code:
<%# Page Language="C#" AutoEventWireup="true" %>
<%# Register Assembly="System.Web.Silverlight" Namespace="System.Web.UI.SilverlightControls"
TagPrefix="asp" %>
<!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" style="height:100%;">
<head runat="server">
<title>Test Page</title>
</head>
<body style="height:100%;margin:0;">
<form id="form1" runat="server" style="height:100%;">
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
<div style="height:100%;">
<asp:Silverlight ID="Xaml1" runat="server" Source="~/ClientBin/Test.xap" MinimumVersion="2.0.30523" Width="400" Height="400" />
</div>
<iframe src ="http://www.google.com" width="400"></iframe>
</form>
</body>
</html>
Renders out both Silverlight and the Iframe quite happily.
What code were you using when trying and it didn't work?
What does your XAML look like?
It could be something along the lines of the size set on the usercontrol in XAML, doesn't match the size set on the plugin on the aspx page. In that case, your button might be there but just not in the viewable area... Try checking the size of things, make sure they match.
A quick test you could do is to change the background color of your root element in the XAML and see if anything happen on the page.
Also, does the silverlight work if you remove the Iframe but leave everything else as is?
Sorry if this a too simple suggestion but without knowing your experience level with XAML...
Funny enough, I just solved this issue by ensuring that I specify the iframe dimensions by pixel.

Resources