Custom component data binding
Hey people,
I'm trying to write a custom component which extends from JPanel (has a List<?>). It will basically display some sub-panels on itself by considering the underlying data (database table rows). I want to have the same functionality with JTable binding. I'm having difficulty listening changes occur on the list. How can I listen to changes inside the list in my JPanel component? Should I write a custom model? or Should I use a ObservableList? any suggestions are welcome..
Actually, it's not a JList. My component is a custom JPanel which has an underlying collection to hold data. I'm binding this underlying collection to an ObservableList which is filled with the result set fetched from the database. It's a standart ArrayList<?> and I want to listen to the changed that made to this list.
MyPanel extends JPanel {
private List<Person> list = new ArrayList<Person>();
}I'd like to see any changes made to the list inside MyPanel class.
Similar Messages
-
How to handle custom component data on overviewset save button CRM UI
Hi,
I have added a custom component to a standard view which is enchanted.
I can handle any data with my buttons on the component but after editing data
i need the save the data when the save button on the overview(top) is pressed.
I have redefined save button of overview but i cant get my data.
My node name is Root. I think i couldnt bind it to overview.
How can i do that?
Thank youProbably it can be done by
http://wiki.sdn.sap.com/wiki/display/CRM/CRMWebUITechnical-CreatingTableViewInWebUI
i am trying
Thank you -
Repeater component data binding
I have a repeater that repeats a custom component:
<mx1:Repeater id="addressParts"
dataProvider="{personPresentationModel.currentPerson.addresses}">
<components:Address left="144"
top="1"
enabled="{personPresentationModel.editMode}"/>
</mx1:Repeater>
visually it works fine however I'm trying to find out how to bind particular data of the dataprovider inside the repeated component. In other words, inside the repeated component, how could I do something along the lines of
<s:TextInput text = "{myHostRepeater.dp.getItemAt(repeaterIndex)}"/>
if that makes sense.
thanksAs so often happens when I post a question, I figured it out immediately after submitting. I'd spent an hour on it and it's amazing how pressing
the submit button so often unblocks my mind.
Hey, maybe if we asked all world leaders to click submit buttons, do you think..... oh, never mind. -
NetBeans BluePrints Ajax autocomplete component data binding
Hello,
I'd like to test the autocomplete feature of an input field from the BluePrints Ajax. But I have difficulties to bind the autocomplete list to a datasource. Is this possbile within the gui (netbeans, vwp) or do I have to code it manually?
loonyHello,
I'd like to test the autocomplete feature of an input field from the BluePrints Ajax. But I have difficulties to bind the autocomplete list to a datasource. Is this possbile within the gui (netbeans, vwp) or do I have to code it manually?
loony -
Properly binding an object to a custom component.
I am apparently not doing this. What am I missing to properly
bind an
object from a repeater looping over an array of object to the
custom
component called in the repeater?
<mx:Repeater
id="dayCells"
dataProvider="{days}"
startingIndex="{weekRows.currentItem}"
count="7">
<mx:GridItem
width="14%"
borderColor="black"
borderThickness="1"
borderStyle="solid">
<mx:Label
text="{dayCells.currentItem.formatedDate}" />
<ian:dayFormat2
drawData="{dayCells.currentItem as drawDay}"
test="{dayCells.currentItem.formatedDate}" />
</mx:GridItem>
</mx:Repeater>
{days} is an array of drawDate.as objects returned with a
remoteObject.
I can correctly bind properties of these drawDate objects in
the
lable and the test property of the dayFormat2
customComponent. But I
can NOT correctly bind the entire object over to dayFormat2.
What am I
missing?
My current version of dayFormat2.mxml, I have tried several
alternatives
for this file.
?xml version="1.0" encoding="utf-8"?>
<mx:VBox xmlns:mx="
http://www.adobe.com/2006/mxml"
width="100%">
<mx:Script>
<![CDATA[
import drawDay;
//Define public variables
[Bindable]
public var drawData:drawDay;
[Bindable]
public var test:String;
]]>
</mx:Script>
<mx:DateFormatter id="dayNum" formatString="DD" />
<mx:HBox
backgroundColor="0x002649"
width="100%"
horizontalAlign="right">
<mx:Label
text="{test}"
color="white" />
<mx:HBox
backgroundColor="0xAF1E2D"
horizontalAlign="center">
<mx:Label
text="{dayNum.format(drawData.date)}"
color="white" />
</mx:HBox>
</mx:HBox>
<mx:Label text="foobar" />
</mx:VBox>
The first label bound to the test String works correctly. The
second
label bound to the drawData drawDay object date property does
not work
correctly.
What is the proper way to bind this object?I have struggled with this all day and made no headway. The
only
strange thing I get is with this line:
<mx:Label text="{dayCells.currentItem.toString()}" />
outputs [object Object]
Not the expected string from this drawDay.as function.
// toString()
public function toString():String
return "Date: " + formatedDate;
Ian Skinner wrote:
> I am apparently not doing this. What am I missing to
properly bind an
> object from a repeater looping over an array of object
to the custom
> component called in the repeater?
>
> <mx:Repeater
> id="dayCells"
> dataProvider="{days}"
> startingIndex="{weekRows.currentItem}"
> count="7">
> <mx:GridItem
> width="14%"
> borderColor="black"
> borderThickness="1"
> borderStyle="solid">
> <mx:Label
> text="{dayCells.currentItem.formatedDate}" />
> <ian:dayFormat2
> drawData="{dayCells.currentItem as drawDay}"
> test="{dayCells.currentItem.formatedDate}" />
> </mx:GridItem>
> </mx:Repeater>
>
> {days} is an array of drawDate.as objects returned with
a remoteObject.
> I can correctly bind properties of these drawDate
objects in the lable
> and the test property of the dayFormat2 customComponent.
But I can NOT
> correctly bind the entire object over to dayFormat2.
What am I missing?
>
> My current version of dayFormat2.mxml, I have tried
several alternatives
> for this file.
>
> ?xml version="1.0" encoding="utf-8"?>
> <mx:VBox xmlns:mx="
http://www.adobe.com/2006/mxml"
width="100%">
> <mx:Script>
> <![CDATA[
> import drawDay;
>
> //Define public variables
> [Bindable]
> public var drawData:drawDay;
>
> [Bindable]
> public var test:String;
> ]]>
> </mx:Script>
>
> <mx:DateFormatter id="dayNum" formatString="DD" />
>
> <mx:HBox
> backgroundColor="0x002649"
> width="100%"
> horizontalAlign="right">
> <mx:Label
> text="{test}"
> color="white" />
> <mx:HBox
> backgroundColor="0xAF1E2D"
> horizontalAlign="center">
> <mx:Label
> text="{dayNum.format(drawData.date)}"
> color="white" />
> </mx:HBox>
> </mx:HBox>
>
> <mx:Label text="foobar" />
> </mx:VBox>
>
> The first label bound to the test String works
correctly. The second
> label bound to the drawData drawDay object date property
does not work
> correctly.
>
> What is the proper way to bind this object? -
Access data in custom component.
Hi Everyone,
I am new to Flex soo pardon me if my questions are quite basic. I have searched a lot before posting here, might be I was not looking in the right direction. Please redirect me to the path that leads to the solution of the problem. I really appreciate any help that I can get.
I'm followiing this video tutorial.
http://www.gotoandlearn.com/play.php?id=100
All was going fine, until the tutor wanted to add custom component in the application. He added the HBox which I couldn't find in Flash Builder 4.6 so I added HGroup instead in my new component. Now when I want to use the data that was fetched in the parent component in custom component it gives me error. Here is the code and their file names.
File: SearchHomeView.mxml
<?xml version="1.0" encoding="utf-8"?>
<s:View xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark" title="Twitter Search">
<fx:Declarations>
<!-- Place non-visual elements (e.g., services, value objects) here -->
<s:HTTPService result="onResult(event)" id="service" url="http://search.twitter.com/search.atom?q=adobe">
</s:HTTPService>
</fx:Declarations>
<fx:Script>
<![CDATA[
import flash.utils.flash_proxy;
import mx.collections.ArrayCollection;
import mx.rpc.events.ResultEvent;
[Bindable]
private var ac:ArrayCollection;
private function onResult(event:ResultEvent):void
ac = event.result.feed.entry as ArrayCollection;
trace(data);
trace(ac);
private function doSearch(event:MouseEvent):void
//service.url = "http://search.twitter.com/search.atom?q=" + tearch.text;
service.url = "http://search.twitter.com/search.atom?q=adobe";
service.send();
]]>
</fx:Script>
<s:TextInput x="25" y="26" width="146" id="tearch"/>
<s:Button x="224" y="26" height="33" label="Search" click="doSearch(event)" />
<s:List dataProvider="{ac}" itemRenderer="tweet" x="25" y="92" width="274" height="278"></s:List>
</s:View>
File: tweet.mxml
<?xml version="1.0" encoding="utf-8"?>
<s:HGroup xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark" width="400" height="300">
<fx:Declarations>
<!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>
<s:Image width="50" height="50" source="{parentDocument.data.link.getItemAt('1').href}">
</s:Image>
<s:TextBase width="100%" text="">
</s:TextBase>
</s:HGroup>
When I use source to be source="{parentDocument.data.link.getItemAt('1').href} ... it removes the error, but displays nothing on the resulting app.
When I use source to be source="{data.link[1].href} ... it gives the error,
Multiple markers at this line:
-1120: Access of undefined property data.
-parentDocument
What needs to be done to use the item renderer right in custom component ? Please tell me the solution to it... I'm stuck on it for quite a few time.
Thanks
Bilal AhmadHello Ravi,
one option is the create a public attribute to share your value note data with other components.
Another option is a function group with two function modules "SET_" and "GET_".
I´m sure one of the webclient UI Gurus here in this forum could share less "dirty" ways with you.
Kind regards
Manfred -
Data Binding for Custom Controls?
Hello,
I'm a little bit confused of how to use databinding for custom controls.
I know i can bind a property, as seen here http://help.sap.com/saphelp_uiaddon10/helpdata/en/91/f0f3cd6f4d1014b6dd926db0e91070/content.htm, but how can I map whole arrays?
My problem is the following:
I want to create a custom table control in SAPUI5 (as the default one doesn't provide the neccessary options and properties I need), but I can't seem to find an example how to bind "rows".
There has to be a way to do this properly. All I can think of now, and implemented, is, passing the name of the variable in the model...
var x = new my.controls.complex.table({data: "/status"});
var row1 = new my.controls.complex.columnHeaderRow();
row1.addColumn(new my.controls.complex.column({text: "", rowspan: "2", colspan: "1", content: "FIRST_COL"}));
x.addColumnsRow(row1);
x.placeAt("content");
...my JSON/model looks like:
{ "status": [ {"FIRST_COL": "a" , ...}, {"FIRST_COL": "b", ... }, ... ], ... }
(which should translate into /status/0/FIRST_COL, /status/1/FIRST_COL, ... AFAIK)
... and then I use this variable name by getting the application-wide model and use the variable passed as key for the model... (please note, this code is just a snippet)
var sapCore = sap.ui.getCore();
if (sapCore !== undefined) {
var model = sapCore.getModel().getObject();
if (model === undefined || model == [] || model == null){ } else {
$.each(model, function(idx, item){
$.each(oControl.getColumnsRows(), function(idx, item2) {
$.each(item2.getColumns(), function(idx, item3){
var content = item3.getContent();
if (content !== undefined && content != ""){
outpLine = outpLine + "<td>" + model[idx][content] + "</td>";
...which still leaves me with the problem of to get an event to react to re-render on changes within the data model, as well as when there would be just an control-specific model, or just a sub-node within a model etc.
So my question is:
Is there a way/best practice to define data binding in a custom control and have a way to react on it, and how to react on data changes within a custom control?
Thanks & KR
ChrisI create a entirely new control, from sap.ui.core.Control.
sap.ui.core.Control.extend("my.controls.complex.table",{... });
I did define a aggregation...
aggregations : { columnsRows: {type : "my.controls.complex.columnRow", multiple : true, visibility: "public"} },
...yet I'm still unclear how I work with this aggregation and databinding. I know we can use the bindAggreation functionallity, but since the aggregation is a object (my.control.complex.columnRow) I don't know how my JSON model should be able to bind to that aggregation (as well as how would one be able to cascade a aggregation like this down futher? For example if there is an aggregation in the object of my aggregation?), plus it still doesn't solve my problem of how I can react (for example redraw) on model changes.
Thanks in advance,
Chris -
Custom component accessing data
I am trying to build a custom component that utilizes the
datagrid. I want to create a class that loads in xome XML and
populates the datagrid. The datagrid's ID is not available in the
class's load.COMPLETE event handler, so I cannot populate the
datagrid from the class. I then tried making a public property in
the class that holds the XML, but, still I run into problems,
because that property is null before the XML is loaded, so I cannot
access it outside the class until the load is complete anyways. So,
I guess the question is, what would be the best practice for
passing data, loaded from a class, to a custom component.Events.
There are some examples in the archives.
Tracy -
Using a repeater in a custom FileInfo Panel --data binding error
When I developed a custom FileInfo panel in Flex Builder 3, I could use an array to populate a checkBox control inside a repeater, and it worked.
Now, using Flash Builder 4, data binding with <mx:Repeater> doesn't seem to work, resulting in an empty fileInfo panel.
When I remove the dataProvider from the <mx:Repeater> tag, my panel displays, but without the repeater. How can I specify the dataProvider in a different way that works?
Thanks
The code:
<fi:XMPForm
xmlns:mx="http://www.adobe.com/2006/mxml"
xmlns:fi="com.adobe.xmp.components.*" width="100%" height="100%"
label="TestPanel2_1" xmlns:s="library://ns.adobe.com/flex/spark" >
<!-- Each namespace prefix that is used within an xmpPath-attribute,
MUST BE registered at the top of EACH panel where it is referenced -->
<fi:XMPNamespaces>
<fi:XMPNamespace prefix="dc" value="http://purl.org/dc/elements/1.1/"/>
</fi:XMPNamespaces>
<mx:Script>
<![CDATA[
import mx.collections.ArrayCollection;
[Bindable] public var newArray:Array =["One", "Two", "Three", "Four", "Five"];
]]>
</mx:Script>
<fi:XMPFormItem>
<mx:VBox id="primaryFrame" width="800">
<mx:Repeater id="myRep" dataProvider="{newArray}">
<mx:Label text="{myRep.currentItem}"/>
</mx:Repeater>
</mx:VBox>
</fi:XMPFormItem
</fir:XMPForm>Okay, I may have been making a rookie mistake. I see online reports that you can't bind an array to a repeater (even though it has worked for me).
I've added the following variable to make my array an array collection:
[Bindable] public var newArray2:ArrayCollection = new ArrayCollection(newArray);
After changing the binding of the repeater to the new array and running the build, the fileInfo panel still does not function.
Any thoughts? -
Error:
"Unable to generate initialization code within Repeater, due to id or data binding on a component that is not a visual child. "
Code snippet:
<mx:Repeater
width="100%" height="100%" id="rpp" dataProvider="{loginDataseriesData.series}" >
<mx:Panel width="100%" title="{rpp.currentItem.@name}">
<mx:DataGrid width="100%" dataProvider="{rpp.currentItem.data}" id="loginDataDG" itemClick="loginDataDGClickevent)" sortableColumns="false" draggableColumns="false">
<mx:columns>
<mx:DataGridColumn headerText="Age Group" dataField="@periodValue"/>
<mx:DataGridColumn headerText="Year" dataField="@timePeriod"/>
<mx:DataGridColumn headerText="Value" dataField="@dataValue"/>
<mx:DataGridColumn headerText="User Name" dataField="@userName" editable="false"/>
<mx:DataGridColumn headerText="Notes" dataField="@notes"/>
</mx:columns>
</mx:DataGrid>
Thanks<mx:DataGrid
width="100%" dataProvider="{rpp.currentItem.data}"
DataGrid indeed not a visual child of your Repeater, since it's visual child is Panel not a Grid -
Unselecting Data List in custom component
Hi,
I am trying to make a dropdown menu. I've followed instructions here: http://cookbooks.adobe.com/post_Creating_a_custom_combobox_component_using_Flash_C-17234.h tml and it works well but there is a problem.
Here's what I did.
Created a custom component with 2 parts. Toggle Button and Datalist. then I set up the states appropriately. When I select a specific item on the datalist, I go to a different screen state but I share that button across the states (it's basically a menu option). That part works great.
Here's my problem:
On my datalist, I have a "on select" event which takes me to the right screen state. However, When I come back to that component, the datalist still has that item selected.
Is there a way to "deselect" something on the datalist when I move from one state to another? Or to force the selectedIndex to be -1 whenever the datalist appears?
Thanks!
- JanaIn which part of the timeline did you add this action? Inside the datalist? I don't see the property "selected index"
-
Plant Maintenance / Customer Service Orders - Component Data
I asked this question yesterday but was told to go and look at SAP Help. Which I had done anyway but i've looked again and I'm still confused. On our SAP ECC system we use PM/CS Orders. I can see that I can extract the data from these orders using the 2LIS_17 & 2LIS_18 (Cubes 0PM_C04 & OCS_C03) . However these dont show the linked component data it's pureley operation data. I can see there is a goods movement cube that shows goods movements but is there any standard PM/CS cube that show stock and nonstock components that are linked to operations?
Thanks
JoelHi,
Thanks for your suggestion.
I've also already turned on the BC for inventory management and I can see the stock / non stock data there but i want to actually link it to the operation on the order. If the inventory management stuff si the only way to do it I guess we'll have to see if there is anyway of customising to get there. -
Problem with inputText in my custom component
Hi, I have a custom dataTable component that I'm trying to get to work. It has to be a custom component because dataTable doesn't support rowspan, colspan, multi line headers, and a rendered attribute for rows. The problem is, that when I wrap the column tag inside my row tag then the method for the inputText tag never gets called in the UPDATE_MODEL_VALUES phase.
I'm starting to think that JSF doesn't support 2 levels of tags between the inputText and dataTable. I'm hoping that someone can tell me what I have wrong with my components.
Here is the JSP snippet.
<cjsf:rptTable>
<cjsf:data id="dataTable1" value="#{allAuthUser.tableRows}" var="myTableRow1">
<cjsf:row>
<cjsf:col>
<h:inputText id="tableTestFld" value="#{myTableRow1.testFld}" size="5" maxlength="5"/>
</cjsf:col>
</cjsf:row>
</cjsf:data>
</cjsf:rptTable>Here is what it renders. It looks to me like everything renders fine. So I'm guessing that there is something in a component that is causing JSF during the life cycle to not be able to process correctly.
<table>
<tbody>
<tr>
<td><input id="tblmaintForm:body:dataTable1_0:tableTestFld" name="tblmaintForm:body:dataTable1_0:tableTestFld" type="text" value="" maxlength="5" size="5"/></td>
</tr>
<tr>
<td><input id="tblmaintForm:body:dataTable1_1:tableTestFld" name="tblmaintForm:body:dataTable1_1:tableTestFld" type="text" value="" maxlength="5" size="5"/></td>
</tr>
<tr>
<td><input id="tblmaintForm:body:dataTable1_2:tableTestFld" name="tblmaintForm:body:dataTable1_2:tableTestFld" type="text" value="" maxlength="5" size="5"/></td>
</tr>
</tbody>
</table>Note: If I leave off the row tag it renders the same way except of course the <tr> and </tr> tags are missing. If I do this, then the backing method for the inputText tag is called and everything works fine. Why doesn't it work with the row tag in place?
Here are the components:
public class UIRptTable extends UIComponentBase {
public UIRptTable() {
setRendererType("tblmaint.rptTableRenderer");
public String getFamily() {
return "javax.faces.Output";
public class UIRptTableData extends HtmlDataTable {
public UIRptTableData() {
setRendererType("tblmaint.rptTableDataRenderer");
public String getFamily() {
return "javax.faces.Data";
public class UIRptTableRow extends UIOutput {
public UIRptTableRow() {
setRendererType("tblmaint.rptTableRowRenderer");
public String getFamily() {
return "javax.faces.Output";
public class UIRptTableCol extends UIColumn {
public UIRptTableCol() {
setRendererType("tblmaint.rptTableColRenderer");
public String getFamily() {
return "javax.faces.Column";
}Here is part of the faces-config file in case you need it.
<!-- Components -->
<component>
<component-type>tblmaint.rptTable</component-type>
<component-class>com.monsanto.ag_it.fieldops.aim.tblmaint.component.UIRptTable</component-class>
</component>
<component>
<component-type>tblmaint.rptTableData</component-type>
<component-class>com.monsanto.ag_it.fieldops.aim.tblmaint.component.UIRptTableData</component-class>
</component>
<component>
<component-type>tblmaint.rptTableRow</component-type>
<component-class>com.monsanto.ag_it.fieldops.aim.tblmaint.component.UIRptTableRow</component-class>
</component>
<component>
<component-type>tblmaint.rptTableCol</component-type>
<component-class>com.monsanto.ag_it.fieldops.aim.tblmaint.component.UIRptTableCol</component-class>
</component>
<!-- Render Kits -->
<render-kit>
<renderer>
<component-family>javax.faces.Output</component-family>
<renderer-type>tblmaint.rptTableRenderer</renderer-type>
<renderer-class>com.monsanto.ag_it.fieldops.aim.tblmaint.renderer.RptTableRenderer</renderer-class>
</renderer>
</render-kit>
<render-kit>
<renderer>
<component-family>javax.faces.Data</component-family>
<renderer-type>tblmaint.rptTableDataRenderer</renderer-type>
<renderer-class>com.monsanto.ag_it.fieldops.aim.tblmaint.renderer.RptTableDataRenderer</renderer-class>
</renderer>
</render-kit>
<render-kit>
<renderer>
<component-family>javax.faces.Output</component-family>
<renderer-type>tblmaint.rptTableRowRenderer</renderer-type>
<renderer-class>com.monsanto.ag_it.fieldops.aim.tblmaint.renderer.RptTableRowRenderer</renderer-class>
</renderer>
</render-kit>
<render-kit>
<renderer>
<component-family>javax.faces.Column</component-family>
<renderer-type>tblmaint.rptTableColRenderer</renderer-type>
<renderer-class>com.monsanto.ag_it.fieldops.aim.tblmaint.renderer.RptTableColRenderer</renderer-class>
</renderer>
</render-kit>I sure hope that someone can help me out. Please let me know if you need any additional information.
Thanks,
RayHi, Ray!
1) I was trying to put a button in the column header (for sorting) and I couldn't get that to work. That involved the >colhdr tag. I got that to work but I don't remember the fix. I'll look it up and reply back with that when I can.Dealing the first part of your trouble, you need NOT a custom component.
I have looked through the implementation of RepeaterRenderer, as you advised me, and found that the multi-header possibility is included in the implementation of dataTable control.
The code below is the part of source of repeater.jsp with only change:
<d:data_repeater>  <h:dataTable>
And it works fine.
<h:dataTable id="table"
binding="#{RepeaterBean.data}"
rows="5"
value="#{RepeaterBean.customers}"
var="customer">
<f:facet name="header">
<h:outputText value="Customer List"/> <!� First Header row -- >
</f:facet>
<h:column>
<%-- Visible checkbox for selection --%>
<h:selectBooleanCheckbox
id="checked"
binding="#{RepeaterBean.checked}"/>
<%-- Invisible checkbox for "created" flag --%>
<h:selectBooleanCheckbox
id="created"
binding="#{RepeaterBean.created}"
rendered="false"/>
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="Account Id"/> <!�Second Header row -- >
</f:facet>
<h:inputText id="accountId"
binding="#{RepeaterBean.accountId}"
required="true"
size="6"
value="#{customer.accountId}">
</h:inputText>
<h:message for="accountId"/>
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="Customer Name"/> <!�Second Header row -- >
</f:facet>
<h:inputText id="name"
required="true"
size="50"
value="#{customer.name}">
</h:inputText>
<h:message for="name"/>
</h:column>
<h:column>
<f:facet name="header"> <!�Second Header row -- >
<h:outputText value="Symbol"/>
</f:facet>
<h:inputText id="symbol"
required="true"
size="6"
value="#{customer.symbol}">
<f:validateLength
maximum="6"
minimum="2"/>
</h:inputText>
<h:message for="symbol"/>
</h:column>
<h:column>
<f:facet name="header"> <!�Second Header row -- >
<h:outputText value="Total Sales"/>
</f:facet>
<h:outputText id="totalSales"
value="#{customer.totalSales}">
<f:convertNumber
type="currency"/>
</h:outputText>
</h:column>
<h:column>
<f:facet name="header"> <!�Second Header row -- >
<h:outputText value="Commands"/>
</f:facet>
<h:commandButton id="press"
action="#{RepeaterBean.press}"
immediate="true"
value="#{RepeaterBean.pressLabel}"
type="SUBMIT"/>
<h:commandLink id="click"
action="#{RepeaterBean.click}"
immediate="true">
<h:outputText
value="Click"/>
</h:commandLink>
</h:column>
</h:dataTable>
You may have a look at HTML source to prove that dataTable is already what you need:
<table id="myform:table">
<thead>
<tr><th colspan="6" scope="colgroup">Customer List</th></tr>
<tr>
<th scope="col"></th>
<th scope="col">Account Id</th>
<th scope="col">Customer Name</th>
<th scope="col">Symbol</th>
<th scope="col">Total Sales</th>
<th scope="col">Commands</th>
</tr>
</thead>
<tbody>
2.) The second trouble is still unsettled as previously. Right now I have different task at my job, and I can�t continue investigation of this problem.
But when you find smth., please let me know. I�ll be very grateful.
Regards,
Oleksa Stelmakh -
How do you reference a valueObject located in main to a custom component created in Catalyst?
Hello,
I have been working with the Catalyst Beta 2 / Flash Builder beta trying to create a photogallery and have hit a little bit of a snag, try as I might I can't seem to find the answer anywhere. I am still new to Flex so please excuse me if this is a basic question, I have been trying to understand more about Flex to make my designs in Catalyst better.
I found this video on Adobe TV: http://tv.adobe.com/watch/rich-internet-applications-101/ria-stepbystep-16-binding-a-data- service-to-flash-builder-components/
It's wonderful and I have the datalist I created in Catalyst working with the XML file I generated but I designed my little photogallery a bit diffrent, I created a Custom Component in Catalyst so that when you click an item on the DataList it pop's up a little screen with a larger photo in on it, rather then having an image in the main application. Now my problem seems to be that I can't refrence the valueObject I created with the wizard as it's in my Main.mxml file, is there a way to refrence it from my Custom Component so the larger image will display? Is there a way to let the component know which item on the dataList in the main application is selected and display the correct image?
I should also say I really enjoy working with the Beta for both Flash Builder / Catalyst, thanks for the hard work!
Thanks for the help,
ChrisI am afraid you cannot bind to static properties in Windows Store Apps. It is simply not supported.
You could create a proxy class that exposes the static command property and bind to this property of an instance of the proxy object:
http://stackoverflow.com/questions/14186175/bind-to-a-static-field-in-windows-8-xaml
http://stackoverflow.com/questions/4708711/how-can-i-use-the-xstatic-extension-for-phone7-silverlight-apps
You will of course have to create an instance of the proxy object. There is no way around this.
Please remember to mark helpful posts as answer to close your threads and then start a new thread if you have a new question. -
How to handle value change events of select list in custom component?
My HelloUIComp code...How to handle events for "Select"...if i choose option1 from select then one text box is to be displayed in custom component and if i choose another option then some other text box is to be displayed in custom components...
public class HelloUIComp extends UIComponentBase {
public static final String account="custom.account";
public static final String RENDERER_TYPE = null;
HtmlCommandButton button = createButton();
//HtmlSelectOneMenu select=createSelect();
public void processDecodes(FacesContext context) {
Calling the lifecycle method "processDecodes" on the
internal button is absolutely critical to create action events
button.processDecodes(context);
super.processDecodes(context);
private HtmlCommandButton createButton() {
FacesContext context = FacesContext.getCurrentInstance();
HtmlCommandButton newButton = new HtmlCommandButton();
newButton.setId("Add");
newButton.setValue("Add");
newButton.setType("submit");
//newButton.setOnclick("return func_1(this,event);");
MethodBinding binding = context.getApplication().createMethodBinding("#{pc_MyProjectView.go}", null);
newButton.setAction(binding);
newButton.setParent(this);
return newButton;
/* private HtmlSelectOneMenu createSelect()
HtmlSelectOneMenu selectCategory=createSelect();
return selectCategory;
public void encodeBegin(FacesContext context) throws IOException {
String style = (String)getAttributes().get("style");
String startdate = (String)getAttributes().get("startdate");
String enddate = (String)getAttributes().get("enddate");
//String add=(String)getAttributes().get("add");
ResponseWriter writer = context.getResponseWriter();
writer.startElement("table", this);
writer.writeAttribute("border","2","2");
writer.startElement("tbody", this);
writer.startElement("tr", this);
writer.startElement("td", this);
writer.writeText("Account Category", null);
writer.endElement("td");
writer.startElement("td", this);
writer.writeText("Reg-No", null);
writer.endElement("td");
writer.startElement("td", this);
writer.writeText("Account-No", null);
writer.endElement("td");
writer.startElement("td", this);
writer.writeText("", null);
writer.endElement("td");
writer.startElement("td", this);
writer.writeText("Start-Date", null);
writer.endElement("td");
writer.startElement("td", this);
writer.writeText("End-Date", null);
writer.endElement("td");
writer.endElement("tr");
writer.startElement("tr",this);
writer.startElement("td", this);
writer.startElement("select", this);
if (style!=null)
writer.writeAttribute("style", style, null);
writer.writeAttribute("name","category","category");
writer.startElement("option", this);
writer.writeText("Select", null);
writer.endElement("option");
//to access data
Account accountObj;
AccountData accountDataobj;
List listOfAccounts;
int noOfAccounts;
accountDataobj=new AccountData();
listOfAccounts=accountDataobj.getAccounts();
noOfAccounts=listOfAccounts.size();
for(int i=0;i<noOfAccounts;i++)
writer.startElement("option", this);
accountObj=(Account) listOfAccounts.get(i);
writer.writeText(accountObj.getCategory(), null);
writer.endElement("option");
//System.out.println(accountObj.getRegNo());
//System.out.println(accountObj.getAccountNo());
writer.endElement("select");
writer.endElement("td");
writer.startElement("td", this);
writer.startElement("select", this);
if (style!=null)
writer.writeAttribute("style", style, null);
writer.writeAttribute("name","regno","regno");
writer.startElement("option", this);
writer.writeText("Select", null);
writer.endElement("option");
for(int i=0;i<noOfAccounts;i++)
accountObj=(Account) listOfAccounts.get(i);
writer.startElement("option", this);
writer.writeText(""+accountObj.getRegNo(), null);
writer.endElement("option");
writer.endElement("select");
writer.endElement("td");
writer.startElement("td", this);
writer.startElement("select", this);
if (style!=null)
writer.writeAttribute("style", style, null);
writer.writeAttribute("name","accno","accno");
writer.startElement("option", this);
writer.writeText("Select", null);
writer.endElement("option");
for(int i=0;i<noOfAccounts;i++)
accountObj=(Account) listOfAccounts.get(i);
writer.startElement("option", this);
writer.writeText(accountObj.getAccountNo(), null);
writer.endElement("option");
//writer.startElement("option", this);
//writer.writeText("00200155", null);
//writer.endElement("option");
writer.endElement("select");
writer.endElement("td");
writer.startElement("td", this);
button.encodeBegin(context);
button.encodeChildren(context);
button.encodeEnd(context);
writer.endElement("td");
writer.startElement("td", this);
writer.startElement("input", this);
if (style!=null)
writer.writeAttribute("style", style, null);
writer.writeAttribute("type","text","text");
writer.writeAttribute("name","startdate","startdate");
writer.writeAttribute("value",startdate,startdate);
writer.writeAttribute("readonly", "","");
//writer.endElement("input");
writer.endElement("td");
writer.startElement("td", this);
writer.startElement("input", this);
if (style!=null)
writer.writeAttribute("style", style, null);
writer.writeAttribute("type","text","text");
writer.writeAttribute("name","enddate","enddate");
writer.writeAttribute("value",enddate,enddate);
writer.writeAttribute("readonly", "","");
writer.endElement("td");
writer.endElement("tr");
writer.endElement("tbody");
writer.endElement("table");
public String getFamily() {
return "HelloFamily";
}NewEclipseCoder wrote:
How to handle events for "Select"...if i choose option1 from select then one text box is to be displayed in custom component and if i choose another option then some other text box is to be displayed in custom components...Two ways:
1) submit the form to the server and render the desired textbox depending on the option.
or
2) render all textboxes and use Javascript/DOM to display/hide them depending on the option.
Maybe you are looking for
-
Dear Friends I have a ibook G3. I have bought a external DVD burner for it. I have made some films on iMovie that I have exported to Toast Titanium for burning, but I don't like how it handles menus and buttons. Do you know by chance a nice alternati
-
Data connection issue - Unable to load URL
Hi Folks, when I am trying to import URL (developed based on Query as Web services) in Xcelsius 2008, I am getting error "Unable to load URL". My other teammates are able to upload using their own laptop, so it indicates there is no issue on server s
-
Problem with interactive map....
Hi, I made interactive map in Actionscript 2, but i have to link it to the Mysql database by JavaScript. Can i do it? If yes than i will be happy for every posts. If no, than please help me with this prob. Thanks.
-
My father and I downloaded three holiday albums from iTunes to his account a few days ago. We created a "Christmas" Playlist on his iPod, transferred the songs from the three new albums into the playlist. We also went to "Get Info" on each song from
-
I can not find the Libraries folder, I can not find the Libraries folder
file://localhost/Users/karenbascom/Desktop/Screen%20Shot%202012-12-19%20at%207.5 1.53%20PM.png