(Created page with "<div style="float:right; clear:both; margin-left:0.5em;">__TOC__</div> <span STYLE="font-size: xx-large"><code>gn:act_copyDataNew</code></span> Category:Action_Library ;D...") |
m (formatting) |
||
Line 3: | Line 3: | ||
[[Category:Action_Library]] | [[Category:Action_Library]] | ||
− | ;Description: Action used to copy content from source to target. Content that is copied '''ALWAYS REPLACES''' the content in target. Source and target have to be of same datatype unless there is a supported conversion. For supported conversions see table below. | + | ;Description: Action used to copy content from source to target. Content that is copied '''ALWAYS REPLACES''' the content in target. Source and target have to be of same datatype unless there is a supported conversion. |
+ | :For supported conversions see table below. | ||
;Action returns: boolean, <code>true</code> if content was successfully copied otherwise <code>false</code> | ;Action returns: boolean, <code>true</code> if content was successfully copied otherwise <code>false</code> | ||
Line 75: | Line 76: | ||
;Examples of row operation signatures from rows to rows datatype with index: | ;Examples of row operation signatures from rows to rows datatype with index: | ||
− | <code>[gn:act_copyDataNew]|[@variable/rows,@variable/targetRows]</code><br> | + | :<code>[gn:act_copyDataNew]|[@variable/rows,@variable/targetRows]</code><br> |
− | <code>[gn:act_copyDataNew]|[@variable/rows(indexSource)(),@variable/targetRows]</code><br> | + | :<code>[gn:act_copyDataNew]|[@variable/rows(indexSource)(),@variable/targetRows]</code><br> |
− | <code>[gn:act_copyDataNew]|[@variable/rows(indexSource)(),@variable/targetRows(indexTarget)()]</code><br> | + | :<code>[gn:act_copyDataNew]|[@variable/rows(indexSource)(),@variable/targetRows(indexTarget)()]</code><br> |
;Examples of row operation signatures from rows to rows datatype with column: | ;Examples of row operation signatures from rows to rows datatype with column: | ||
− | <code>[gn:act_copyDataNew]|[@variable/rows()(columnSource),@variable/targetRows()(columnTarget)]</code> source and target have single row | + | :<code>[gn:act_copyDataNew]|[@variable/rows()(columnSource),@variable/targetRows()(columnTarget)]</code> source and target have single row |
;Examples of row operation signatures from rows to rows datatype with index and column: | ;Examples of row operation signatures from rows to rows datatype with index and column: | ||
− | <code>[gn:act_copyDataNew]|[@variable/rows(indexSource)(columnSource),@variable/targetRows(indexTarget)(columnTarget)]</code><br> | + | :<code>[gn:act_copyDataNew]|[@variable/rows(indexSource)(columnSource),@variable/targetRows(indexTarget)(columnTarget)]</code><br> |
− | <code>[gn:act_copyDataNew]|[@variable/rows()(columnSource),@variable/targetRows(indexTarget)(columnTarget)]</code> source has single row<br> | + | :<code>[gn:act_copyDataNew]|[@variable/rows()(columnSource),@variable/targetRows(indexTarget)(columnTarget)]</code> source has single row<br> |
− | <code>[gn:act_copyDataNew]|[@variable/rows(indexSource)(columnSource),@variable/targetRows()(columnTarget)]</code> target has single row | + | :<code>[gn:act_copyDataNew]|[@variable/rows(indexSource)(columnSource),@variable/targetRows()(columnTarget)]</code> target has single row |
;Examples of datatype internal operation signatures with index and column: | ;Examples of datatype internal operation signatures with index and column: | ||
− | <code>[gn:act_copyDataNew]|[@variable/emails,@variable/emailsNew]</code><br> | + | :<code>[gn:act_copyDataNew]|[@variable/emails,@variable/emailsNew]</code><br> |
− | <code>[gn:act_copyDataNew]|[@variable/emails(indexSource)(columnSource),@variable/text]</code><br> | + | :<code>[gn:act_copyDataNew]|[@variable/emails(indexSource)(columnSource),@variable/text]</code><br> |
− | <code>[gn:act_copyDataNew]|[@variable/emails()(columnSource),@variable/text]</code> source has single row<br> | + | :<code>[gn:act_copyDataNew]|[@variable/emails()(columnSource),@variable/text]</code> source has single row<br> |
− | <code>[gn:act_copyDataNew]|[@variable/emails(indexSource)(),@variable/emailsNew]</code><br> | + | :<code>[gn:act_copyDataNew]|[@variable/emails(indexSource)(),@variable/emailsNew]</code><br> |
− | |||
====Example2==== | ====Example2==== | ||
=====initial value===== | =====initial value===== | ||
− | :<code>@variable/allReportRows</code> | + | :<code>@variable/allReportRows</code> - 3 rows with 10 columns each |
− | :<code>@variable/allReportRowsCopy</code> | + | :<code>@variable/allReportRowsCopy</code> - empty |
=====variables.xml===== | =====variables.xml===== | ||
Line 128: | Line 128: | ||
=====after action execution===== | =====after action execution===== | ||
if numerical value i.e. 0 was defined at widget <code>@+id/screen_integerNumberLabel_input</code> | if numerical value i.e. 0 was defined at widget <code>@+id/screen_integerNumberLabel_input</code> | ||
− | :<code>@variable/allReportRowsCopy</code> | + | :<code>@variable/allReportRowsCopy</code> - 0'th row from <code>@variable/allReportRows</code> |
====Example==== | ====Example==== | ||
=====initial value===== | =====initial value===== | ||
− | :<code>@variable/allReportRows</code> | + | :<code>@variable/allReportRows</code> - 3 rows with 10 columns each |
− | :<code>@variable/allReportRowsCopy</code> | + | :<code>@variable/allReportRowsCopy</code> - empty |
=====variables.xml===== | =====variables.xml===== | ||
Line 164: | Line 164: | ||
=====after action execution===== | =====after action execution===== | ||
if numerical value i.e. 0 was defined at widget <code>@+id/screen_integerNumberLabel_input</code> | if numerical value i.e. 0 was defined at widget <code>@+id/screen_integerNumberLabel_input</code> | ||
− | :<code>@variable/allReportRowsCopy</code> | + | :<code>@variable/allReportRowsCopy</code> - 0'th row from <code>@variable/allReportRows</code> |
if widget<code>@+id/screen_integerNumberLabel_input</code> is empty | if widget<code>@+id/screen_integerNumberLabel_input</code> is empty | ||
− | :<code>@variable/allReportRowsCopy</code> | + | :<code>@variable/allReportRowsCopy</code> - all rows from <code>@variable/allReportRows</code> |
====Example2==== | ====Example2==== | ||
=====initial value===== | =====initial value===== | ||
− | :<code>@+id/screen_mediaPhotoLabel_button</code> | + | :<code>@+id/screen_mediaPhotoLabel_button</code> - widget contains 3 images loaded from database |
− | :<code>@+id/screen_textLabel_fileInfo</code> | + | :<code>@+id/screen_textLabel_fileInfo</code> - empty input field |
=====screen.xml===== | =====screen.xml===== | ||
Line 205: | Line 205: | ||
=====after action execution===== | =====after action execution===== | ||
− | :<code>@+id/screen_textLabel_fileInfo</code> | + | :<code>@+id/screen_textLabel_fileInfo</code> - input field will show name of the first file that is stored in <code>@+id/screen_mediaPhotoLabel_button</code> widget |
<hr> | <hr> |
Revision as of 12:17, 2 August 2017
gn:act_copyDataNew
- Description
- Action used to copy content from source to target. Content that is copied ALWAYS REPLACES the content in target. Source and target have to be of same datatype unless there is a supported conversion.
- For supported conversions see table below.
- Action returns
- boolean,
true
if content was successfully copied otherwisefalse
Source Target pointer
text
text
pointer
email
pointer
number
pointer
text
number
date
long
dateTime
long
Action signatures
Copy data
[gn:act_copyDataNew]|[source(indexSource)(columnSource),target(indexTarget)(columnTarget)]
Parameter Description source
source from where the value will be copied target
target where the value will be stored indexSource
indexTarget
optionalsource or target which will be used as index for source and target, needs to be an integer
columnSource
columnTarget
optionalsource or target which will be used as column name within a row or complex datatype.
- Examples of row operation signatures from rows to rows datatype with index
[gn:act_copyDataNew]|[@variable/rows,@variable/targetRows]
[gn:act_copyDataNew]|[@variable/rows(indexSource)(),@variable/targetRows]
[gn:act_copyDataNew]|[@variable/rows(indexSource)(),@variable/targetRows(indexTarget)()]
- Examples of row operation signatures from rows to rows datatype with column
[gn:act_copyDataNew]|[@variable/rows()(columnSource),@variable/targetRows()(columnTarget)]
source and target have single row
- Examples of row operation signatures from rows to rows datatype with index and column
[gn:act_copyDataNew]|[@variable/rows(indexSource)(columnSource),@variable/targetRows(indexTarget)(columnTarget)]
[gn:act_copyDataNew]|[@variable/rows()(columnSource),@variable/targetRows(indexTarget)(columnTarget)]
source has single row[gn:act_copyDataNew]|[@variable/rows(indexSource)(columnSource),@variable/targetRows()(columnTarget)]
target has single row
- Examples of datatype internal operation signatures with index and column
[gn:act_copyDataNew]|[@variable/emails,@variable/emailsNew]
[gn:act_copyDataNew]|[@variable/emails(indexSource)(columnSource),@variable/text]
[gn:act_copyDataNew]|[@variable/emails()(columnSource),@variable/text]
source has single row[gn:act_copyDataNew]|[@variable/emails(indexSource)(),@variable/emailsNew]
Example2
initial value
@variable/allReportRows
- 3 rows with 10 columns each@variable/allReportRowsCopy
- empty
variables.xml
<variable id="allReportRows" type="rows"/> <variable id="allReportRowsCopy" type="rows"/>
screen.xml
<com.ginstr.widgets.GnEditText android:id="@+id/screen_integerNumberLabel_input" android:layout_height="wrap_content" android:layout_width="match_parent" gn:dataType="number" gn:inputType="NUMBER" gn:s_decimalFormat="#" gn:s_sourceType="input" gn:style="@style/numberInteger_input"/> <FrameLayout android:id="@+id/exampleFrame" android:layout_width="wrap_content" android:layout_height="wrap_content" android:visibility="gone" gn:act_set="[gn:act_copyDataNew]|[@variable/allReportRows(@+id/screen_integerNumberLabel_input)(),@variable/allReportRowsCopy]" />
after action execution
if numerical value i.e. 0 was defined at widget @+id/screen_integerNumberLabel_input
@variable/allReportRowsCopy
- 0'th row from@variable/allReportRows
Example
initial value
@variable/allReportRows
- 3 rows with 10 columns each@variable/allReportRowsCopy
- empty
variables.xml
<variable id="allReportRows" type="rows"/> <variable id="allReportRowsCopy" type="rows"/>
screen.xml
<com.ginstr.widgets.GnEditText android:id="@+id/screen_integerNumberLabel_input" android:layout_height="wrap_content" android:layout_width="match_parent" gn:dataType="number" gn:inputType="NUMBER" gn:s_decimalFormat="#" gn:s_sourceType="input" gn:style="@style/numberInteger_input"/> <FrameLayout android:id="@+id/exampleFrame" android:layout_width="wrap_content" android:layout_height="wrap_content" android:visibility="gone" gn:act_set="[gn:act_copyDataNew]|[@variable/allReportRows(@+id/screen_integerNumberLabel_input)(),@variable/allReportRowsCopy]" />
after action execution
if numerical value i.e. 0 was defined at widget @+id/screen_integerNumberLabel_input
@variable/allReportRowsCopy
- 0'th row from@variable/allReportRows
if widget@+id/screen_integerNumberLabel_input
is empty
@variable/allReportRowsCopy
- all rows from@variable/allReportRows
Example2
initial value
@+id/screen_mediaPhotoLabel_button
- widget contains 3 images loaded from database@+id/screen_textLabel_fileInfo
- empty input field
screen.xml
<com.ginstr.widgets.GnMediaAction android:id="@+id/screen_mediaPhotoLabel_button" android:layout_height="wrap_content" android:layout_width="wrap_content" gn:act_setAfterMediaTaken="[gn:act_copyDataNew]|[@+id/screen_mediaPhotoLabel_button,@+id/screen_mediaPhotoLabel_gallery]" gn:dataType="pictures" gn:maxMediaTaken="5" gn:s_actionType="photo" gn:singleValueMode="false" gn:style="@style/mediaPhoto_button"/> <com.ginstr.widgets.GnEditText android:id="@+id/screen_textLabel_fileInfo" android:layout_height="wrap_content" android:layout_width="match_parent" gn:dataType="text" gn:s_hint="@string/fileInfo" gn:s_sourceType="input" gn:style="@style/textEditable_input"/> <FrameLayout android:id="@+id/exampleFrame" android:layout_width="wrap_content" android:layout_height="wrap_content" android:visibility="gone" gn:act_set="[gn:act_copyDataNew]|[@+id/screen_mediaPhotoLabel_button(0)(filename),@+id/screen_textLabel_fileInfo]" />
after action execution
@+id/screen_textLabel_fileInfo
- input field will show name of the first file that is stored in@+id/screen_mediaPhotoLabel_button
widget