Skip to content

Instantly share code, notes, and snippets.

@brito
Last active June 17, 2016 01:31
Show Gist options
  • Save brito/fa5fcdfb70de9f8fe1b5794f0ab43f5f to your computer and use it in GitHub Desktop.
Save brito/fa5fcdfb70de9f8fe1b5794f0ab43f5f to your computer and use it in GitHub Desktop.
MAF or ADF reusable scope POJO class
<panelFormLayout xmlns:amx="http://xmlns.oracle.com/adf/mf/amx">
<inputText label="key" value="#{scope.key}"/>
<inputText label="value" value="#{scope.value}"/>
<commandButton text="Update" actionListener="#{scope.update}"/>
</panelFormLayout>
<iterator var="key" value="#{scope.properties.keySet}">
<iterator var="properties" value="#{scope.properties.valMap}">
<inputText label="#{key}" value="#{properties[key]}" changeListener="#{scope.update}"/>
</iterator>
</iterator>
public class Scope {
private Map<Object, Object> properties = (new HashMap<>(){{
// initialize: put(1, "A");
}})
.forEach( (key, value) ->
// emit: somefunction(key, value)
);
private RichInputText key;
private RichInputText value;
public void setKey(RichInputValue key){ this.key = key; }
public RichInputValue getKey(){ return key; }
public void setValue(RichInputValue value){ this.value = value; }
public RichInputText getValue(){ return value; }
public void update(ActionEvent action){
properties.put(key.getValue(), value.getValue());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment