From wiki.ginstr.com
Jump to: navigation, search
m (formatting)
Line 10: Line 10:
 
===Update row based on column values===
 
===Update row based on column values===
  
;<code>[gn:act_updateRow]|[target;searchColumn{n};searchSource{n};column{n};source{n}]</code>
+
:;<code>[gn:act_updateRow]|[target;searchColumn{n};searchSource{n};column{n};source{n}]</code>
  
{| class="wikitable sortable" style="font-size: 85%; text-align: left;"
+
:{| class="wikitable sortable" style="font-size: 85%; text-align: left;"
 
|-
 
|-
 
! scope="col" | Parameter
 
! scope="col" | Parameter
 
! scope="col" | Description
 
! scope="col" | Description
 
|-
 
|-
| [[target]]
+
| <code>[[target]]</code>
 
| [[target]] where the row will be updated
 
| [[target]] where the row will be updated
 
* Valid [[target|targets]]:
 
* Valid [[target|targets]]:
** [[Datatypes#rows|rows]]
+
** <code>[[Datatypes#rows|rows]]</code>
** [[Datatypes#rowsColumn|rowsColumn]]
+
** <code>[[Datatypes#rowsColumn|rowsColumn]]</code>
 
|-
 
|-
| [[configuration.xml#Column|searchColumn]]{n}
+
| <code>[[configuration.xml#Column|searchColumn]]{n}</code>
| [[configuration.xml#Column|searchColumn]] where the value from [[source|searchSource]]{n} will be compared  
+
| [[configuration.xml#Column|searchColumn]] where the value from <code>[[source|searchSource]]{n}</code> will be compared  
 
|-
 
|-
| [[source|searchSource]]{n}
+
| <code>[[source|searchSource]]{n}</code>
| [[source|searchSource]] from which the value will be compared with [[configuration.xml#Column|searchColumn]] value and if the row matches, row will be updated
+
| [[source|searchSource]] from which the value will be compared with <code>[[configuration.xml#Column|searchColumn]]</code> value and if the row matches, row will be updated
 
* Valid [[source|sources]]:
 
* Valid [[source|sources]]:
** [[Datatypes#text|text]]
+
** <code>[[Datatypes#text|text]]</code>
 
|-
 
|-
| [[configuration.xml#Column|column]]{n}
+
| <code>[[configuration.xml#Column|column]]{n}</code>
| [[configuration.xml#Column|column]] where the value from [[source]]{n} will be updated
+
| [[configuration.xml#Column|column]] where the value from <code>[[source]]{n}</code> will be updated
 
|-
 
|-
| [[source]]{n}
+
| <code>[[source]]{n}</code>
| [[source]] from which the value will be used to update the value of [[configuration.xml#Column|column]]{n}
+
| [[source]] from which the value will be used to update the value of <code>[[configuration.xml#Column|column]]{n}</code>
 
* Valid [[source|sources]]:
 
* Valid [[source|sources]]:
** [[Datatypes#text|text]]  
+
** <code>[[Datatypes#text|text]]</code>
 
|-
 
|-
 
|}
 
|}
  
 
====Example====
 
====Example====
<code>@+id/lstResidents</code> - target<br>
+
:<code>@+id/lstResidents</code> - target<br>
<code>resident_firstName, resident_lastName</code> - search column names<br>
+
:<code>resident_firstName, resident_lastName</code> - search column names<br>
<code>@+id/firstName,@+id/lastName</code> - search source<br>
+
:<code>@+id/firstName,@+id/lastName</code> - search source<br>
<code>resident_firstName,resident_lastName</code> - updated column names<br>
+
:<code>resident_firstName,resident_lastName</code> - updated column names<br>
<code>@+id/lastNameNew,@+id/firstNameNew</code> - update value source<br><br>
+
:<code>@+id/lastNameNew,@+id/firstNameNew</code> - update value source<br>
<code>[gn:act_updateRow]|[@+id/lstResidents;resident_firstName,resident_lastName;@+id/firstName,@+id/lastName;resident_firstName,resident_lastName;@+id/lastNameNew,@+id/firstNameNew]</code>
+
:; ⤷ <code>[gn:act_updateRow]|[@+id/lstResidents;resident_firstName, resident_lastName;@+id/firstName, @+id/lastName;resident_firstName, resident_lastName;@+id/lastNameNew, @+id/firstNameNew]</code>
 
<hr>
 
<hr>
  
 
===Update row based on row index===
 
===Update row based on row index===
  
;<code>[gn:act_updateRow]|[target,rowIndex;;;column{n};source{n}]</code>
+
:;<code>[gn:act_updateRow]|[target,rowIndex;;;column{n};source{n}]</code>
  
{| class="wikitable sortable" style="font-size: 85%; text-align: left;"
+
:{| class="wikitable sortable" style="font-size: 85%; text-align: left;"
 
|-
 
|-
 
! scope="col" | Parameter
 
! scope="col" | Parameter
 
! scope="col" | Description
 
! scope="col" | Description
 
|-
 
|-
| [[target]]
+
| <code>[[target]]</code>
 
| [[target]] where the row will be updated
 
| [[target]] where the row will be updated
 
* Valid [[target|targets]]:
 
* Valid [[target|targets]]:
** [[Datatypes#rows|rows]]
+
** <code>[[Datatypes#rows|rows]]</code>
** [[Datatypes#rowsColumn|rowsColumn]]
+
** <code>[[Datatypes#rowsColumn|rowsColumn]]</code>
 
|-
 
|-
| rowIndex
+
| <code>rowIndex</code>
| <div style="text-align: right;">'''optional'''</div>
+
| <div style="text-align: right; background-color: #e5e5e5; padding-right: 7px">'''optional'''</div>
[[source]] which represents the row index in [[target|target]] where the row will be removed
+
[[source]] which represents the row index in <code>[[target|target]]</code> where the row will be removed
  
 
* Valid [[source|sources]]:
 
* Valid [[source|sources]]:
** [[Datatypes#number|number]]  
+
** <code>[[Datatypes#number|number]]</code>
 
|-
 
|-
| [[configuration.xml#Column|column]]{n}
+
| <code>[[configuration.xml#Column|column]]{n}</code>
| [[configuration.xml#Column|column]] where the value from [[source]]{n} will be updated
+
| [[configuration.xml#Column|column]] where the value from <code>[[source]]{n}</code> will be updated
 
|-
 
|-
| [[source]]{n}
+
| <code>[[source]]{n}</code>
 
| [[source]] from which the value will be used to update the value of [[configuration.xml#Column|column]]{n}
 
| [[source]] from which the value will be used to update the value of [[configuration.xml#Column|column]]{n}
 
* Valid [[source|sources]]:
 
* Valid [[source|sources]]:
** [[Datatypes#text|text]]  
+
** <code>[[Datatypes#text|text]]</code>
 
|-
 
|-
 
|}
 
|}
  
 
====Example====
 
====Example====
<code>@+id/lstResidents</code> - target<br>
+
:<code>@+id/lstResidents</code> - target<br>
<code>@variable/rowIndex</code> - row index<br>
+
:<code>@variable/rowIndex</code> - row index<br>
<code>resident_firstName,resident_lastName</code> - updated column names<br>
+
:<code>resident_firstName,resident_lastName</code> - updated column names<br>
<code>@+id/lastNameNew,@+id/firstNameNew</code> - update value source<br><br>
+
:<code>@+id/lastNameNew,@+id/firstNameNew</code> - update value source<br>
<code>[gn:act_updateRow]|[@+id/lstResidents,@variable/rowIndex;;;resident_firstName,resident_lastName;@+id/lastNameTest,@+id/firstNameTest]</code>
+
:; ⤷ <code>[gn:act_updateRow]|[@+id/lstResidents,@variable/rowIndex;;;resident_firstName,resident_lastName;@+id/lastNameTest,@+id/firstNameTest]</code>
 
<hr>
 
<hr>

Revision as of 16:32, 12 July 2017

gn:act_updateRow

Description
Updates a row by defined column values or specified index on target which supports rows, rowsColumn
Action returns
void

Action signatures

Update row based on column values

[gn:act_updateRow]|[target;searchColumn{n};searchSource{n};column{n};source{n}]
Parameter Description
target target where the row will be updated
searchColumn{n} searchColumn where the value from searchSource{n} will be compared
searchSource{n} searchSource from which the value will be compared with searchColumn value and if the row matches, row will be updated
column{n} column where the value from source{n} will be updated
source{n} source from which the value will be used to update the value of column{n}

Example

@+id/lstResidents - target
resident_firstName, resident_lastName - search column names
@+id/firstName,@+id/lastName - search source
resident_firstName,resident_lastName - updated column names
@+id/lastNameNew,@+id/firstNameNew - update value source
[gn:act_updateRow]|[@+id/lstResidents;resident_firstName, resident_lastName;@+id/firstName, @+id/lastName;resident_firstName, resident_lastName;@+id/lastNameNew, @+id/firstNameNew]

Update row based on row index

[gn:act_updateRow]|[target,rowIndex;;;column{n};source{n}]
Parameter Description
target target where the row will be updated
rowIndex
optional

source which represents the row index in target where the row will be removed

column{n} column where the value from source{n} will be updated
source{n} source from which the value will be used to update the value of column{n}

Example

@+id/lstResidents - target
@variable/rowIndex - row index
resident_firstName,resident_lastName - updated column names
@+id/lastNameNew,@+id/firstNameNew - update value source
[gn:act_updateRow]|[@+id/lstResidents,@variable/rowIndex;;;resident_firstName,resident_lastName;@+id/lastNameTest,@+id/firstNameTest]